From: HARBAUGH AT FCRFV1 DOT NCIFCRF DOT GOV Subject: RE[2] Making DLL4s - found problem, but don't understand it 13 Apr 1997 18:35:22 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <970413191112.204124c0.cygnus.gnu-win32@FCRFV1.NCIFCRF.GOV> Original-To: GNU-WIN32 AT cygnus DOT com Original-CC: HARBAUGH AT FCRFV1 DOT NCIFCRF DOT GOV Original-Sender: owner-gnu-win32 AT cygnus DOT com I figured out one way to stop the errors I wrote about in my last message; I added a MessageBox call in the DllMain function, just as Ismael Jurado did. THEN THE DLL WORKED. Unfortunately, I really must get rid of that MessageBox call. The function: int WINAPI DllMain(HINSTANCE H, DWORD d, PVOID p) { /* MessageBox(NULL, "Hello from DllMain", "DLL", MB_OK); */ return TRUE; } (with the MessageBox call commented out) always leads to the following gripes from ld: (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) In cygwin_except_handler (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) Exception trapped! (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) exception C0000005 at 438238 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) exception: ax 45CA068 bx 0 cx 45F5D0C dx 28 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) exception: si 4000 di 100113BF bp 258F054 sp 258F048 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) exception is: STATUS_ACCESS_VIOLATION (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) Stack trace: (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 0: sp = 0x258EE60, pc = 0x1001282A (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 1: sp = 0x258EE7C, pc = 0xBFF76780 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 2: sp = 0x258EEA0, pc = 0xBFF858F3 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 3: sp = 0x258EF38, pc = 0xFFECBAD7 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 4: sp = 0x258F054, pc = 0x4383A9 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 5: sp = 0x258F0A4, pc = 0x43C476 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 6: sp = 0x258F4A4, pc = 0x424C2F (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 7: sp = 0x258F504, pc = 0x418CBA (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 8: sp = 0x258F548, pc = 0x10011BEB (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 9: sp = 0x258FE14, pc = 0x10011BFF (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 10: sp = 0x258FE20, pc = 0x453E50 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 11: sp = 0x258FE30, pc = 0x401012 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 12: sp = 0x258FE38, pc = 0xBFF88E93 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 13: sp = 0x258FF78, pc = 0xBFF88D41 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 14: sp = 0x258FFF4, pc = 0xBFF87759 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) frame 15: sp = 0x815AC6BC, pc = 0x5 (d:\CYGNUS\H-I386~1\BIN\ld.exe 1304) End of stack trace (more stack frames may be present) As soon as I uncomment the MessageBox line, everything works. Could somebody recommend a way around this problem? ------------------------------------------------------------------------------ | Toni Harbaugh-Blackford | Internet: harbaugh AT ncifcrf DOT gov | | System Manager | | | Biomedical Supercomputing Center | Phone: (301) 846-5798 | | SAIC | FAX: (301) 846-5762 | | NCI-FCRDC | | | PO Box B, Bldg 430 | | | Frederick, MD 21702-1201 USA | | ------------------------------------------------------------------------------ - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".