I'm currently writing a VFW codec, but am getting:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I've narrowed it down to a simple test case, but the test case makes no sense. In the test case, my DriverProc() returns 0 every time, so that installation fails immediately, and the video codec manager goes about its business without bringing up my codec. But when I add the other two object files at linktime, neither of which ever gets anything in them run under any circumstance, the crash comes back. Here are all the source files:
extern "C" LRESULT WINAPI DriverProc (DWORD dwDriverID, HDRVR hDriver, UINT uiMessage, LPARAM lParam1, LPARAM lParam2)
MessageBox (0, "Driver Pork Reached", "Driver Pork", 0);
extern "C" BOOL WINAPI DllMain (HINSTANCE hinst,DWORD reason,LPVOID lpReserved)
MessageBox (0, "Dull Mane Reached", "Dull Mane", 0);
void foobar ();
#endif // C1_H
#endif // C2_H
void C1::foobar ()
c = new C2 (); // comment out this line, and the crash disappears
I'm compilling with mingw gcc 4.5.2. Any help would be appreciated; I really have no idea what to make of it. None of the code in c1 or c2 ever gets run, yet linking it in makes the thing crash. And commenting out the one indicated line above makes the crash go away. I'm not really much of a C++ coder, unfortunately..