I'm having trouble with a project that compiles ok but crashes on startup before even reaching InitInstance().
This happens after I added a string to a struct:
DWORD dwStartTime; // time_t
DWORD dwPlaytimeMs; // msecs
BOOL nOrigin; // 0= local, 1= cuemaster,
TCHAR szFSPath[MAX_PATH]; << THIS HERE IS THE PROBLEM
; Find next lower page and probe
sub eax, _PAGESIZE_ ; decrease by PAGESIZE
test dword ptr [eax],eax ; probe page.
jmp short cs10
The name of the module where the crash occurs
chkstk.asm is a clue to what is happening. It's checking the stack allocation to make sure you haven't run out. It appears you have run out, by adding a large new element to your structure. It's very hard to run out of stack space with a single structure, so I assume you have an array of them. Local variables are what get allocated to the stack, so the problem is likely a local variable containing an array of these structures.
You can give your program more stack space with the
/F compiler switch.
You could also use a
vector instead of an array, which will allocate the space in the heap instead of on the stack.