|
Well, we've got nothing to go on either. In this sort of case, I tend to write a lot of logging code, and check the logs that are generated to work out where in the app the crash is happening.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello.
You say the crash happens in ntdll.dll. That normally indicates that you are calling some function in ntdll with invalid parameter(s).
The most common cause of such a behaviour (in my experience) is either uninitialized variables or using freed memory in function calls to ntdll.
If it works well in debug mode, you should definately look for uninitialized variables.
Remember that allocated memory is filled with nulls in debug builds, and completetly uninitialized in release builds, contaning garbage.
If your app crashes in your code, read this splendid and utterly useful article:
http://www.codeproject.com/debug/mapfile.asp[^]
That article has been of great help to me.
Kakan
|
|
|
|
|
I have an MDI application (originally written in VC6, now using VC7) and the
tooltips for the toolbar on the mainfrm window stop displaying when I open a
second document...if only 1 is open then they display fine. The status text
on the status bar continues to display but the tooltips do not.
Any ideas?
cje
|
|
|
|
|
Is there any way to strike through a line on a list ctrl?
I can delete a line and I can change it different colors,
but Id like to draw a line that strikes through the entire
line instead. I just cant figure out how.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
In my opinion this has to be owner drawn . I dont think there is an API for doing the same .
You might need to draw a line after getting the coordinates of the same .
Correct me if i m wrong
Engineering is the effort !
|
|
|
|
|
|
I need a notification of the "new hardware Found " dialog inside my applications . I tried to use Windows Hooks but fail to get the notification .
Am I doing the correct thing by expecting to get a notification for the same ?
This is what I tried in my MFC dialog application
void CWinHookEgDlg::OnButton1()
{
hookid = SetWindowsHookEx(WH_SHELL , CBTProc , NULL ,GetCurrentThreadId());
}
LRESULT CALLBACK CBTProc(int nCode,WPARAM wParam,LPARAM lParam)
{
if (nCode < 0) // do not process message
return CallNextHookEx(hookid, nCode, wParam,
lParam);
if(nCode == 4)
return CallNextHookEx(hookid,nCode , wParam , lParam) ;
if(nCode == HSHELL_WINDOWCREATED)
{
HANDLE handle = ( HANDLE ) wParam;
// CBT_CREATEWND *wnd = (CBT_CREATEWND * ) lParam ;
}
return CallNextHookEx(hookid,nCode , wParam , lParam) ;
}
Engineering is the effort !
|
|
|
|
|
Have you looked at the WM_DEVICECHANGE message?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
WM_DEVICECHANGE will not work in my case as it only reports
DBT_DEVNODES_CHANGED and will not report a device arrival until the device is configured (after its drivers have been installed ) . this is for a USB device .
i somehow need a notification of the new hardware found Dialog .
Engineering is the effort !
|
|
|
|
|
What about DBT_DEVICEARRIVAL ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DBT_DEVICEARRIVAL arrives when the device is fully configured . I will not get this until the drivers (inF / sys) files for the device have been loaded . But i need to intercept the Hardware Found dialog .
Engineering is the effort !
|
|
|
|
|
I think you might have to place all this code into a DLL, since I don't think you can hook the messages from another process if your hook code is within your EXE. It needs to be in a DLL so the code can be called by windows from the context of the other process. Then maybe you will see the messages you expect.
|
|
|
|
|
I have a DLL that exposes a Call to create the Hook
Here is a sample
HHOOK hookid = 0;
*LRESULT CALLBACK ShellProc(int nCode,WPARAM wParam,LPARAM lParam)*
{
TRACE("Shell message rcvd nCode = %d wParam = %d lParam=%d \n",nCode,wParam,lParam);
if(nCode==HSHELL_WINDOWCREATED )
{
int a =1;
}
return CallNextHookEx(hookid, nCode, wParam, lParam);
}
HOOKPROC proc = ShellProc;
HOOK_EXPORT WinHookRegister()
{
hookid = SetWindowsHookEx(WH_SHELL , proc , NULL ,GetCurrentThreadId());
}
I fail to get notifications of the new hardware found dialog . Am i missing some core concept here ?
Engineering is the effort !
|
|
|
|
|
You need to create a global hook to get notified of window creation in other processes.
hookid = SetWindowsHookEx(WH_SHELL, proc , hMyDllInstance, 0);
|
|
|
|
|
I tried the same and still no luck .
Is it expected that I get a notification for an new explorer window ?
Also I placed hookid in a shared data segment .
Any clues ?
Engineering is the effort !
|
|
|
|
|
Hi,
I want to use Windows Media player ActiveX in my MFC app. but I can't If you have its files please send me.
Thanks
cheers
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
dSolariuM wrote: but I can't...
Why not?
dSolariuM wrote: If you have its files please send me
Look for wmp.dll .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Google is your friend. Microsoft wants you to use the WMP control, which is why they offer a WMP SDK. You just need to go and download it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
good morning, all
Is there a way to locate certain memory address in app during the debug? say, I wanna find out 0x00FE55A0 is using by who?
the reason is memory leak, I kinda know which class is leaking, but I couldn't see where exactly it is, there is FE5420 is using by m_pValid, but it got deleted when it close down. so the FE55A0 should be somwhere near by, but I never really find it.
thanks for your time!
|
|
|
|
|
Hello,
You can use the Visual Leak Detector[^] to trace down those pesky bugs and then eliminate them!
Good hunt!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
You can set a breakpoint on a memory address such that the application will break when the data at the specified address changes. Then it will show you what line of code just caused that change.
You can do this by using the breakpoints dialog and then go to the data tab and enter your address in the edit block.
|
|
|
|
|
Thanks for your reply.
I have problem setting them up, it has message box says "Cannot set the breakpoint when "0x00FE55A0" (length: 1)changed". not sure why, It should be the valid adreee, because it's the leak report says 1305 bytes leak from. and I could see the 0x00FE54D0 in somewhere....thank you!
|
|
|
|
|
I would go with the other suggestion then.
I am not sure why that error would come up. I tried it myself on my platform and I was able to set the break point.
Since you have an idea where/when the code is changing, you could try to watch it in the memory window. Just press the memory button on the debug toolbar (when you are in debug) and then type the address of the memory location that you want to watch. You can then step through the code until your address changes.
|
|
|
|
|
|
I need to check the status of a socket on my client application before sending data....I was wondering if there was a way to tell whether the socket was connected to the server at any given point. I know there is WSAGetLastError, but doesn't that have to wait for the framework to alert that there is an error first?
Thanks for your help.
|
|
|
|