|
Are you saying both dialogs are open at the same time?
|
|
|
|
|
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
|
|
|
|
|
Without a lot more detail, including the code, it is anyone's guess. However using dialogs to open other dialogs does not sound like the best design.
|
|
|
|
|
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;
}
|
|
|
|
|
|
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
|
|
|
|
|
I get this message all of the sudden while I have a modless Cdialog and Richedit displayed
When I switch the debugger to threads I see a number of ntdll.dll worker threads
Can somebody point me in the right path
Thanks
|
|
|
|
|
Just look at the Call Stack and find in this list your own (last called) module. Click on it to see what was your command/operation that caused the exception
|
|
|
|
|
I did that went to the main thread (and looked at the stack) it pointed to thrdcore.cpp
!::GetMessage(&(pState->m_msgcur line 155 Please note I have created 5 other Threads 4 UI threads which act as a wrappers for my Derived CAsynSocket Class and a regular worker thread
Thanks
|
|
|
|
|
Access violation means that you're accessing memory that hasn't been allocated to your application ... so do the obvious.
Go back a few steps on the stack and look at the sequence and look at all the pointer use and check
1.) The pointer is valid
2.) Is what it pointing at allocated
3.) If it is required that the structure it points to #0 terminated ... is it.
Something in the last calls is failing one of those criteria, if need separate every pointer to a temp line of code in those sections and run a debug test on it.
In vino veritas
|
|
|
|
|
Without some more information about where this happened, the code that caused it, and the values of the variables involved, it is impossible even to make any suggestions. The only thing one can say is that you are using either an uninitialised variable, or one that has received an invalid value.
|
|
|
|
|
The strange thing Is there all these worker threads (ntdll.dll) that seem to have come up okay
Thanks
|
|
|
|
|
ForNow wrote: all these worker threads (ntdll.dll) that seem to have come up okay But that does not mean anything. The only way to solve this sort of problem is by tracking back to the point where the fault is created. This may be a simple bug in your code, cross-thread corruption, or any one of a million other things happening.
|
|
|
|
|
If I put these two functions in a Windows program
/*-----*/
void SetTitle(HWND wn,char*S)
{SendMessage(wn,WM_SETTEXT,0,(long)S);}
/*-----*/
void GetTitle(HWND wn,char*S,long n)
{SendMessage(wn,WM_GETTEXT,n,(long)S);}
/*-----*/
these functions will set and read the window's title.
If I use these to catch the mouse interrupts:-
case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK:
case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_RBUTTONDBLCLK:
case WM_MBUTTONDOWN: case WM_MBUTTONUP:
case WM_MBUTTONDBLCLK: case WM_MOUSEMOVE:
{int x=short(L&0xffff),y=short(L>>16)&0xffff; char Z[64];
sprintf(Z,"{%d,%d,%2x}",x,y,S); SetTitle(wn,Z); goto DEF;}
the window's title will show the current mouse return values.
Please, what are the message names used to catch interrupts from a game-type joystick?, if I want to program for a joystick or similar.
|
|
|
|
|
|
The Windows functions still faithfully keep a return code (MK_MBUTTON = 16) for if the middle mouse button is down. Can computer mice with 3 buttons still be bought? Or have they gone where the passenger pigeon went?
|
|
|
|
|
This is hardly a question for a C++ forum? You can find different mouse types in any PC store.
|
|
|
|
|
Many mice have a scroll wheel which is also the middle button. If you have such a mice, just try to press the wheel instead of scrolling it.
So only the simplest / cheapest mice have only two buttons. Many even have more than three buttons nowadays.
|
|
|
|
|
print these numbers 6 28 66 in form of pyramid like
00006
00028 00066
|
|
|
|
|
1) Do not repost. You have already posted this homework question in the thread immediately below.
2) We do not do your homework. It's set to test what you know, not how good you are at getting strangers on the Internet to do your work for you.
Try it yourself, and you'll probably find it's not as difficult as you think. After all, it will be based on topics you've recently covered in your course.
If you're still stuck, then talk to your teacher.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
print these numbers 6 28 66 in form of pyramid like
00006
00028 00066
|
|
|
|
|
It's called string formatting and you want leading zeros
Here is the full reference
printf - C++ Reference[^]
Look at the sample with leading zeros ... which will be in your case you want 6 digits
printf ("Preceding with zeros: %06d \n", 6);
printf("Preceding with zeros: %06d \n", 28);
printf("Preceding with zeros: %06d \n", 66);
In vino veritas
|
|
|
|
|
Hereinafter, / should be backslash.
I am working on a recursive directory search function. It uses FindFirstFile, FindNextFile, WIN32_FIND_DATA info; , etc. It seems to work. If while working on directory X it comes across a subdirectory X/Y, it calls itself recursively to search the contents of directory X/Y (unless the directory's name starts with a fullstop). OK so far.
But, if the function recurses (say) 6 deep in a deep nest of directories, then the computer will have to keep tract of 6 FindFirstFile, FindNextFile, WIN32_FIND_DATA info; directory scan processes at once. Can I trust the computer to keep tract of all that lot at once and not trip over itself?
|
|
|
|