Browse Source

Fixed 64bit crashes

ScottBrogden 8 years ago
parent
commit
ea78f4f4bc
2 changed files with 15 additions and 15 deletions
  1. 8 8
      RichEditCtrlEx.cpp
  2. 7 7
      RulerRichEditCtrl/RulerRichEditCtrl.cpp

+ 8 - 8
RichEditCtrlEx.cpp

@@ -68,7 +68,7 @@ CString CRichEditCtrlEx::GetRTF()
 
 	CString sRTF = "";
 
-	es.dwCookie = (DWORD) &sRTF;	// so sRTF receives the string
+	es.dwCookie = (DWORD_PTR) &sRTF;	// so sRTF receives the string
 	
 	StreamOut(SF_RTF, es);			// Call CRichEditCtrl::StreamOut to get the string.
 	///
@@ -88,10 +88,10 @@ void CRichEditCtrlEx::SetRTF(const char *pRTF)
 
 #ifdef _UNICODE
 	CString cs;
-	es.dwCookie = (DWORD) &cs;
+	es.dwCookie = (DWORD_PTR) &cs;
 #else
 	CString cs(pRTF);
-	es.dwCookie = (DWORD) &cs;
+	es.dwCookie = (DWORD_PTR) &cs;
 #endif
 
 	StreamIn(SF_RTF, es);	// Do it.
@@ -115,9 +115,9 @@ void CRichEditCtrlEx::SetRTF(CStringA sRTF)
 
 #ifdef _UNICODE
 	CString cs;
-	es.dwCookie = (DWORD) &cs;
+	es.dwCookie = (DWORD_PTR) &cs;
 #else
-	es.dwCookie = (DWORD) &sRTF;
+	es.dwCookie = (DWORD_PTR) &sRTF;
 #endif
 
 	StreamIn(SF_RTF, es);	// Do it.
@@ -159,7 +159,7 @@ CString CRichEditCtrlEx::GetText()
 	EDITSTREAM es;
 	es.dwError = 0;
 	es.pfnCallback = CBStreamOut;		// Set the callback
-	es.dwCookie = (DWORD) &sText;	// so sRTF receives the string
+	es.dwCookie = (DWORD_PTR) &sText;	// so sRTF receives the string
 	StreamOut(SF_TEXT, es);			// Call CRichEditCtrl::StreamOut to get the string.
 #endif
 
@@ -176,9 +176,9 @@ void CRichEditCtrlEx::SetText(CString sText)
 	es.pfnCallback = CBStreamIn;
 #ifdef _UNICODE
 	CString cs;
-	es.dwCookie = (DWORD) &cs;
+	es.dwCookie = (DWORD_PTR) &cs;
 #else
-	es.dwCookie = (DWORD) &sText;
+	es.dwCookie = (DWORD_PTR) &sText;
 #endif
 	StreamIn(SF_TEXT, es);	// Do it.
 

+ 7 - 7
RulerRichEditCtrl/RulerRichEditCtrl.cpp

@@ -806,7 +806,7 @@ CString CRulerRichEditCtrl::GetRTF()
 
 	CString* str = new CString;
 	EDITSTREAM	es;
-	es.dwCookie = ( DWORD ) str;
+	es.dwCookie = (DWORD_PTR) str;
 	es.pfnCallback = StreamOut;
 	m_rtf.StreamOut( SF_RTF, es );
 
@@ -837,7 +837,7 @@ void CRulerRichEditCtrl::SetRTF( const CString& rtf )
 	CString* str = new CString( rtf );
 
 	EDITSTREAM	es;
-	es.dwCookie = ( DWORD ) str;
+	es.dwCookie = (DWORD_PTR) str;
 	es.pfnCallback = StreamIn;
 	m_rtf.StreamIn( SF_RTF, es );
 
@@ -852,9 +852,9 @@ void CRulerRichEditCtrl::SetText(CString sText)
 //	es.pfnCallback = StreamIn;
 #ifdef _UNICODE
 	CString cs;
-	es.dwCookie = (DWORD) &cs;
+	es.dwCookie = (DWORD_PTR) &cs;
 #else
-	es.dwCookie = (DWORD) &sText;
+	es.dwCookie = (DWORD_PTR) &sText;
 	m_rtf.StreamIn(SF_TEXT, es);	// Do it.
 #endif
 	
@@ -896,7 +896,7 @@ CString CRulerRichEditCtrl::GetText()
 	EDITSTREAM es;
 	es.dwError = 0;
 	es.pfnCallback = StreamOut;		// Set the callback
-	es.dwCookie = (DWORD) &sText;	// so sRTF receives the string
+	es.dwCookie = (DWORD_PTR) &sText;	// so sRTF receives the string
 	m_rtf.StreamOut(SF_TEXT, es);			// Call CRichEditCtrl::StreamOut to get the string.
 #endif
 
@@ -928,7 +928,7 @@ BOOL CRulerRichEditCtrl::Save( CString& filename )
 	CString* str = new CString;
 
 	EDITSTREAM	es;
-	es.dwCookie = ( DWORD ) str;
+	es.dwCookie = (DWORD_PTR) str;
 	es.pfnCallback = StreamOut;
 	m_rtf.StreamOut( SF_RTF, es );
 
@@ -968,7 +968,7 @@ BOOL CRulerRichEditCtrl::Load( CString& filename )
 	if( result )
 	{
 		EDITSTREAM	es;
-		es.dwCookie = ( DWORD ) str;
+		es.dwCookie = (DWORD_PTR) str;
 //		es.pfnCallback = StreamIn;
 		m_rtf.StreamIn( SF_RTF, es );
 	}