CrichEditCtrl::Find returns zero when second RichEdit is Created as a Child of A Different CDialog
-
Hi I have a CrichEditCtrl that works fine. However when the user Selects to view some other data in a Different Cdialog/CRichEditctrl. The first stops working and returns a zero I display the Text I am Searching for and the Returned code From FindText (in the caption bar) The Text looks fine However as soon as The Second Cdialog/RichEdit are created the return from the First CDaliog/RichEdit returns a zero I double checked things as resource id of both RicheditCtrl's and they are different
-
Hi I have a CrichEditCtrl that works fine. However when the user Selects to view some other data in a Different Cdialog/CRichEditctrl. The first stops working and returns a zero I display the Text I am Searching for and the Returned code From FindText (in the caption bar) The Text looks fine However as soon as The Second Cdialog/RichEdit are created the return from the First CDaliog/RichEdit returns a zero I double checked things as resource id of both RicheditCtrl's and they are different
-
Yes Actually this is the 3rd CDialog/CRicheditCtrl Pair That I have in my application The parent window is the First Cdialog/CrichEditCtrl. However After this is Created the Find functionality of the Richedit which is a child control of my main (for lack of a better term)CDialog stops working
-
Yes Actually this is the 3rd CDialog/CRicheditCtrl Pair That I have in my application The parent window is the First Cdialog/CrichEditCtrl. However After this is Created the Find functionality of the Richedit which is a child control of my main (for lack of a better term)CDialog stops working
-
Hi I have a CrichEditCtrl that works fine. However when the user Selects to view some other data in a Different Cdialog/CRichEditctrl. The first stops working and returns a zero I display the Text I am Searching for and the Returned code From FindText (in the caption bar) The Text looks fine However as soon as The Second Cdialog/RichEdit are created the return from the First CDaliog/RichEdit returns a zero I double checked things as resource id of both RicheditCtrl's and they are different
If you can see the problem starts when it's returning zero then you have an obvious debug point. Place a debug point inside an if statement on the zero return ... when it breaks follow the steps backwards. The hard part is generally finding a debug point with this sort of problem but you have that already.
In vino veritas
-
If you can see the problem starts when it's returning zero then you have an obvious debug point. Place a debug point inside an if statement on the zero return ... when it breaks follow the steps backwards. The hard part is generally finding a debug point with this sort of problem but you have that already.
In vino veritas
I added he following code want to see what is in the rich edit
linechar = myedit->FindText(FR_DOWN , &listtext);
if(linechar == 0)
{CFile dumpfile; CFileException e; TCHAR\* pszFileName = \_T("F:\\\\DUMPLIST.LST"); if(!dumpfile.Open(pszFileName, CFile::modeCreate | CFile::modeWrite, &e)) MessageBox("file could not be opened"); EDITSTREAM dmp; dmp.dwCookie = (DWORD\_PTR) &dumpfile; dmp.pfnCallback = (EDITSTREAMCALLBACK)dumpit; myedit->StreamOut(SF\_TEXT,dmp);
}
static DWORD CALLBACK dumpit(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CFile* pFile = (CFile*) dwCookie;pFile->Write(pbBuff, cb);
*pcb = cb;return 0;
} -
I added he following code want to see what is in the rich edit
linechar = myedit->FindText(FR_DOWN , &listtext);
if(linechar == 0)
{CFile dumpfile; CFileException e; TCHAR\* pszFileName = \_T("F:\\\\DUMPLIST.LST"); if(!dumpfile.Open(pszFileName, CFile::modeCreate | CFile::modeWrite, &e)) MessageBox("file could not be opened"); EDITSTREAM dmp; dmp.dwCookie = (DWORD\_PTR) &dumpfile; dmp.pfnCallback = (EDITSTREAMCALLBACK)dumpit; myedit->StreamOut(SF\_TEXT,dmp);
}
static DWORD CALLBACK dumpit(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CFile* pFile = (CFile*) dwCookie;pFile->Write(pbBuff, cb);
*pcb = cb;return 0;
} -
I added he following code want to see what is in the rich edit
linechar = myedit->FindText(FR_DOWN , &listtext);
if(linechar == 0)
{CFile dumpfile; CFileException e; TCHAR\* pszFileName = \_T("F:\\\\DUMPLIST.LST"); if(!dumpfile.Open(pszFileName, CFile::modeCreate | CFile::modeWrite, &e)) MessageBox("file could not be opened"); EDITSTREAM dmp; dmp.dwCookie = (DWORD\_PTR) &dumpfile; dmp.pfnCallback = (EDITSTREAMCALLBACK)dumpit; myedit->StreamOut(SF\_TEXT,dmp);
}
static DWORD CALLBACK dumpit(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CFile* pFile = (CFile*) dwCookie;pFile->Write(pbBuff, cb);
*pcb = cb;return 0;
}ForNow wrote:
I added he following code want to see what is in the rich edit
Why not just use:
CString str;
myedit->GetWindowText(str);"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
ForNow wrote:
I added he following code want to see what is in the rich edit
Why not just use:
CString str;
myedit->GetWindowText(str);"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
Would that code get what's in the rich edit good to know I did find the bug in my code What works in the debug version does not necessarily work in release by doing research the bugs have to do with the heap in my case I had forgotten to initialize CStatic *pointers after adding the '= new' code I resolved the problem thanks