Click here to Skip to main content
15,892,480 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioncrash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 8:33
permutations12-Mar-10 8:33 
AnswerRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Bram van Kampen12-Mar-10 8:57
Bram van Kampen12-Mar-10 8:57 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 9:47
permutations12-Mar-10 9:47 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Bram van Kampen13-Mar-10 0:54
Bram van Kampen13-Mar-10 0:54 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations13-Mar-10 3:57
permutations13-Mar-10 3:57 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Bram van Kampen13-Mar-10 9:19
Bram van Kampen13-Mar-10 9:19 
AnswerRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Chris Losinger12-Mar-10 9:01
professionalChris Losinger12-Mar-10 9:01 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 9:41
permutations12-Mar-10 9:41 
Chris Losinger wrote:
2. are you loading any DLLs? are they doing anything non-trivial in their WinMain's ?


Yes, there is a very significant DLL. Here's a little bit more about what I'm doing. I wrote a DOS program back in 1991 that got some good reviews and sold pretty well. I wanted to rerelease this for both Windows and the Web, but without completely rewriting the thing. So I separated out all the DOS interface stuff, and created what I call the "engine", which I can then access from any interface.

Using precompiler directives, I can compile the engine as a DLL (called from my MFC interface), a CGI (compiled for Linux on the server) and accessed through HTML, or a standalone console app with no interface (I hardcode the values for testing).

In my InitInstance procedure, I find the user's My Documents directory, make a subdirectory beneath that for the files the app creates, then call a function in the DLL called BuildFileNames(). This basically takes some standard filenames and prepends the path that I found in InitInstance. I have stepped through this whole thing with the debugger and it is working correctly.

When I return from that, I initialize some global variables that I export in the DLL, open a database file (or create an empty one, if it does not exist), add the database file to the MRU list, and then display the app's main window.

The app uses a modeless dialog for the main window. I wrote a class called ModelessMain, which was easier than trying to circumvent the doc/view architecture.

One of my difficulties in tracking down the problem is that I don't know at what point it's crashing, from the perspective of my own code. The crash is in the _tWinMain() procedure, and I don't know at what point that is called. Isn't it called before InitInstance() even executes? And if so, how can my own code be causing this crash?

My difficulty here is my lack of understanding of how my MFC program is eventually calling the function that fails - the stack of calls from my program to eventually the failure point. That's why I don't even know where to look in my own code.

I really appreciate any help you can give me because I'm dead in the water at this point. I simply don't have the first clue how to proceed. I read something somewhere about looking at the stack of calls to figure this out, but I don't know how to do these advanced debugging techniques.
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Chris Losinger12-Mar-10 9:59
professionalChris Losinger12-Mar-10 9:59 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 10:13
permutations12-Mar-10 10:13 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Chris Losinger12-Mar-10 10:43
professionalChris Losinger12-Mar-10 10:43 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 12:13
permutations12-Mar-10 12:13 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Avi Berger12-Mar-10 11:15
Avi Berger12-Mar-10 11:15 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 12:00
permutations12-Mar-10 12:00 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Avi Berger12-Mar-10 13:30
Avi Berger12-Mar-10 13:30 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! [modified] Pin
permutations12-Mar-10 15:06
permutations12-Mar-10 15:06 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 16:15
permutations12-Mar-10 16:15 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 11:04
permutations12-Mar-10 11:04 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
Chris Losinger12-Mar-10 11:14
professionalChris Losinger12-Mar-10 11:14 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 9:42
permutations12-Mar-10 9:42 
AnswerRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 11:52
permutations12-Mar-10 11:52 
AnswerRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations12-Mar-10 18:27
permutations12-Mar-10 18:27 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations14-Mar-10 6:45
permutations14-Mar-10 6:45 
GeneralRe: crash in _tWinMain, crt0.c, XP SP3 only - HELP!! Pin
permutations14-Mar-10 9:35
permutations14-Mar-10 9:35 
QuestionThread and its custom window (!?) Pin
Russell'12-Mar-10 8:24
Russell'12-Mar-10 8:24 

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.