Click here to Skip to main content
15,896,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: needed dll's on other computers Pin
-Dy15-May-06 5:15
-Dy15-May-06 5:15 
GeneralRe: needed dll's on other computers Pin
Grimes15-May-06 9:39
Grimes15-May-06 9:39 
QuestionRemote Connection Pin
Anu_Bala15-May-06 2:31
Anu_Bala15-May-06 2:31 
AnswerRe: Remote Connection Pin
NiceNaidu15-May-06 19:26
NiceNaidu15-May-06 19:26 
GeneralRe: Remote Connection Pin
Anu_Bala15-May-06 22:57
Anu_Bala15-May-06 22:57 
Question[Message Deleted] Pin
ddmcr15-May-06 2:13
ddmcr15-May-06 2:13 
AnswerRe: Command line parameters [modified] Pin
Leo Davidson15-May-06 2:31
Leo Davidson15-May-06 2:31 
QuestionWin32 DLL project randomly crashes after moving to VS2005 Pin
Leo Davidson15-May-06 2:12
Leo Davidson15-May-06 2:12 
I've got a Win32 (no MFC, ATL etc.) DLL project which I recently moved from VS2003 to VS2005.

Of course, the first step was to take care of the compilation errors/warnings, mainly due to deprecated functions and the new "secure CRT", which I simply #defined away for now because much of the code is 3rd party graphics libraries I don't want to extensively modify. The code now compiles fine with no errors and no warnings.

The problem is that when I run my DLL it crashes in apparently random places and in different parts of the project which have very little in common. For example, I had a crash within a dialog's window procedure and another similar crash inside library code (also compiled by me in VS2005) which loads an image.

In the dialog proc's case I was able to "fix" the bug by refactoring my huge dlgproc into several smaller functions. (I could also "fix" it by commenting out the lines where the crash occurred but it's interesting to note that the crash still happened if I changed those lines to send a WM_NULL to the dialog.) The dialog crashes were occuring around the time of recursive calls to the dlgproc, and under a debugger the crash in both the dialog and the image library were generating a "stack overflow" message. But I don't buy this as the real cause because there are very few functions and very little data on the stack and the code is not in an infinite loop, worked fine under VS2003 and indeed works if I refactor the code in a way which ads *more* call data to the stack, not less. The recursion level is 3 calls deep, if that.

I sent the code to a friend who has BoundsChecker and he said it couldn't detect anything wrong with it, but he could still reproduce the crash.

This has been driving me nuts and wasted a lot of my holiday time that I wanted to spend actually making cool stuff. Frown | :( I wonder if anyone has experienced anything similar and has suggestions on where to look? It feels like a compiler error or a stack corruption issue rather than a genuine stack overflow.

Has anything changed in the way VS2005 deals with the stack? I haven't touched any project settings after converting from the VS2003 project, but I read that the default stack size has been increased from 64k to 1meg. Maybe there's a problem when DLLs are called from non-VS2005 programs and the VS2005-generated code is assume 1meg of stack has already been reserved or something? I'm clutching at straws really... (Writing a test harness for the DLL in VS2005 is on my list of things to try but that list is long, my holiday is over, and the whole ordeal has left me quite frustrated! So I'm hoping someone has some good advise.)

Thanks for reading and any help!

AnswerRe: Win32 DLL project randomly crashes after moving to VS2005 Pin
Stephen Hewitt15-May-06 16:17
Stephen Hewitt15-May-06 16:17 
GeneralRe: Win32 DLL project randomly crashes after moving to VS2005 Pin
Leo Davidson16-May-06 1:26
Leo Davidson16-May-06 1:26 
QuestionHow to create Windows service for listening on a socket Pin
zahid_ash15-May-06 1:52
zahid_ash15-May-06 1:52 
AnswerRe: How to create Windows service for listening on a socket Pin
led mike15-May-06 5:32
led mike15-May-06 5:32 
GeneralRe: How to create Windows service for listening on a socket Pin
zahid_ash15-May-06 19:20
zahid_ash15-May-06 19:20 
GeneralRe: How to create Windows service for listening on a socket Pin
led mike15-May-06 19:57
led mike15-May-06 19:57 
QuestionGetting Scroll information Pin
Sarath C15-May-06 1:44
Sarath C15-May-06 1:44 
AnswerRe: Getting Scroll information Pin
Russell'15-May-06 2:16
Russell'15-May-06 2:16 
AnswerRe: Getting Scroll information Pin
Naveen15-May-06 2:30
Naveen15-May-06 2:30 
GeneralRe: Getting Scroll information Pin
Sarath C15-May-06 2:40
Sarath C15-May-06 2:40 
GeneralRe: Getting Scroll information Pin
Naveen15-May-06 3:10
Naveen15-May-06 3:10 
Questionhow to square a value Pin
lindag178315-May-06 1:35
lindag178315-May-06 1:35 
AnswerRe: how to square a value Pin
Russell'15-May-06 1:37
Russell'15-May-06 1:37 
AnswerRe: how to square a value Pin
Eric Dahlvang15-May-06 4:00
Eric Dahlvang15-May-06 4:00 
GeneralRe: how to square a value Pin
lindag178315-May-06 23:33
lindag178315-May-06 23:33 
AnswerRe: how to square a value Pin
Eric Dahlvang16-May-06 2:54
Eric Dahlvang16-May-06 2:54 
AnswerRe: how to square a value Pin
Stephen Hewitt15-May-06 16:59
Stephen Hewitt15-May-06 16:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.