Thread: [GD-Windows] Loading new DLLs on old Windows
Brought to you by:
vexxed72
From: Andras B. <bn...@ma...> - 2004-02-10 17:34:51
|
MSDN says: "Windows Me/98/95: If you are using LoadLibrary to load a module that contains a resource whose numeric identifier is greater than 0x7FFF, LoadLibrary fails. If you are attempting to load a 16-bit DLL directly from 32-bit code, LoadLibrary fails. If you are attempting to load a DLL whose subsystem version is greater than 4.0, LoadLibrary fails. If your DllMain function tries to call the Unicode version of a function, LoadLibrary fails." Now, I believe that my DLLs' subsystem version is greater than 4.0 (how can I check?). How can I make it work on Win95/98/ME?? Is there a linker option? Or some other workaround? Thanks, Andras |
From: Simon O'C. <si...@sc...> - 2004-02-11 00:22:03
|
Hi Andras, The subsystem for a DLL is controlled by the /SUBSYSTEM: linker option in your project settings. For a DLL project, this will be set to /SUBSYSTEM:WINDOWS. The /SUBSYSTEM: linker option has an **OPTIONAL** subsystem version parameter (e.g. /SUBSYSTEM:WINDOWS,5.01). This optional parameter allows you to specify the _minimum_ OS version that the DLL requires to be run. You'll find a list of OS version numbers in the documentation for OSVERSIONEX. Some examples are: Windows 95: 4.0 Windows 98: 4.10 Windows ME: 4.90 Windows 2000: 5.0 Windows XP: 5.1 (5.01) Note that the OS version number comes as two parts, major (4, 5 etc) and minor (0, 10, 90, 1 etc). The point isn't a decimal point so 5.1 is the same as 5.01 (the "minor" number is 1). If you (or your development tools) do *not* specify the optional version parameter at the end of the /SUBSYSTEM:WINDOWS option, a default subsystem of 4.00 will be used, regardless of your development tool or OS. [NB: only for x86 code targets, for Itanium code targets this is 5.01] So a DLL created with Visual Studio .NET 2003 on a WindowsXP machine for example will still have a subsystem of 4.00. The only time you'll encounter a DLL under Win32 OSes that has a subsystem that is different than 4.00 is if that DLL absolutely requires that version of Windows. You can view the subsystem of a DLL using Dependency Walker (it comes with the platform SDK, depends.exe). DUMPBIN should tell you this too. To change the subsystem of an existing DLL that you don't have the sourcecode to (i.e. when you aren't able to alter the /SUBSYSTEM option), you can change it using EDITBIN. So in short, all that part of the documentation is saying is "if the DLL specifies that it needs a newer version of Windows than the one currently installed (if 9x) then the LoadLibrary() call will fail". HTH Cheers, Simon O'Connor Programmer @ Acclaim & Microsoft DirectX MVP > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Andras Balogh > Sent: 10 February 2004 16:31 > To: gam...@li... > Subject: [GD-Windows] Loading new DLLs on old Windows > > MSDN says: > > "Windows Me/98/95: If you are using LoadLibrary to load a > module that contains a resource whose numeric identifier is > greater than 0x7FFF, LoadLibrary fails. If you are attempting > to load a 16-bit DLL directly from 32-bit code, LoadLibrary > fails. If you are attempting to load a DLL whose subsystem > version is greater than 4.0, LoadLibrary fails. If your > DllMain function tries to call the Unicode version of a > function, LoadLibrary fails." > > Now, I believe that my DLLs' subsystem version is greater > than 4.0 (how can I check?). How can I make it work on > Win95/98/ME?? Is there a linker option? Or some other workaround? > > > Thanks, > > Andras > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 Premiere > Conference on Open Tools Development and Integration See the > breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004 |
From: Andras B. <bn...@ma...> - 2004-02-11 18:31:08
|
Ah, thanks! Huge amount of info there! You were right, my DLLs are all having subversion 4.0. So my problem is probably somewhere else.. Thanks again, Andras Wednesday, February 11, 2004, 1:21:44 AM, Simon O'Connor wrote: > Hi Andras, > The subsystem for a DLL is controlled by the /SUBSYSTEM: linker option in > your project settings. > For a DLL project, this will be set to /SUBSYSTEM:WINDOWS. > The /SUBSYSTEM: linker option has an **OPTIONAL** subsystem version > parameter (e.g. /SUBSYSTEM:WINDOWS,5.01). This optional parameter allows you > to specify the _minimum_ OS version that the DLL requires to be run. > You'll find a list of OS version numbers in the documentation for > OSVERSIONEX. Some examples are: > Windows 95: 4.0 > Windows 98: 4.10 > Windows ME: 4.90 > Windows 2000: 5.0 > Windows XP: 5.1 (5.01) > Note that the OS version number comes as two parts, major (4, 5 etc) and > minor (0, 10, 90, 1 etc). The point isn't a decimal point so 5.1 is the same > as 5.01 (the "minor" number is 1). > If you (or your development tools) do *not* specify the optional version > parameter at the end of the /SUBSYSTEM:WINDOWS option, a default subsystem > of 4.00 will be used, regardless of your development tool or OS. [NB: only > for x86 code targets, for Itanium code targets this is 5.01] > So a DLL created with Visual Studio .NET 2003 on a WindowsXP machine for > example will still have a subsystem of 4.00. > The only time you'll encounter a DLL under Win32 OSes that has a subsystem > that is different than 4.00 is if that DLL absolutely requires that version > of Windows. > You can view the subsystem of a DLL using Dependency Walker (it comes with > the platform SDK, depends.exe). DUMPBIN should tell you this too. > To change the subsystem of an existing DLL that you don't have the > sourcecode to (i.e. when you aren't able to alter the /SUBSYSTEM option), > you can change it using EDITBIN. > So in short, all that part of the documentation is saying is "if the DLL > specifies that it needs a newer version of Windows than the one currently > installed (if 9x) then the LoadLibrary() call will fail". > HTH > Cheers, > Simon O'Connor > Programmer @ Acclaim > & Microsoft DirectX MVP >> -----Original Message----- >> From: gam...@li... >> [mailto:gam...@li...] On >> Behalf Of Andras Balogh >> Sent: 10 February 2004 16:31 >> To: gam...@li... >> Subject: [GD-Windows] Loading new DLLs on old Windows >> >> MSDN says: >> >> "Windows Me/98/95: If you are using LoadLibrary to load a >> module that contains a resource whose numeric identifier is >> greater than 0x7FFF, LoadLibrary fails. If you are attempting >> to load a 16-bit DLL directly from 32-bit code, LoadLibrary >> fails. If you are attempting to load a DLL whose subsystem >> version is greater than 4.0, LoadLibrary fails. If your >> DllMain function tries to call the Unicode version of a >> function, LoadLibrary fails." >> >> Now, I believe that my DLLs' subsystem version is greater >> than 4.0 (how can I check?). How can I make it work on >> Win95/98/ME?? Is there a linker option? Or some other workaround? >> >> >> Thanks, >> >> Andras >> |
From: Andras B. <bn...@ma...> - 2004-02-12 18:14:50
|
My program supports dynamic loading of plugins. Every plugin represents a class, and resides in a separate DLL. Instead of exporting the class itself, I only export a factory function and provide a header file with the declaration of the pure virtual base class (ie. the interface). At runtime, I load the DLL and call the exported factory function, which instances an object and returns a pointer to the base class. This architecture works like a charm on most machines. However, on some configurations, my program reports the following: "Error Code 1114: A dynamic link library (DLL) initialization routine failed." But I have no clue why. Do I have to use DllMain? MSDN says it's only an optional entrypoint.. My DLLs are dynamically linked to the C/CPP run-time libraries. Thanks, Andras |
From: Jon W. <hp...@mi...> - 2004-02-12 20:14:38
|
Typically this means that you're linking with a DLL that doesn't exist, or you're calling UNICODE functions without unicode support, or you're plain running out of memory. Do you have one of the machines available for debugging? WinDbg sometimes helps in debugging these things. Cheers, / h+ -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Andras Balogh Sent: Thursday, February 12, 2004 4:21 AM To: gam...@li... Subject: [GD-Windows] DLL initialization (was: Loading new DLLs on old Windows) My program supports dynamic loading of plugins. Every plugin represents a class, and resides in a separate DLL. Instead of exporting the class itself, I only export a factory function and provide a header file with the declaration of the pure virtual base class (ie. the interface). At runtime, I load the DLL and call the exported factory function, which instances an object and returns a pointer to the base class. This architecture works like a charm on most machines. However, on some configurations, my program reports the following: "Error Code 1114: A dynamic link library (DLL) initialization routine failed." But I have no clue why. Do I have to use DllMain? MSDN says it's only an optional entrypoint.. My DLLs are dynamically linked to the C/CPP run-time libraries. Thanks, Andras ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Andras B. <bn...@ma...> - 2004-02-13 17:24:14
|
Hi Jon, The DLL exists (otherways the error code would be different), and it also doesn't mess with UNICODE. The logs report that memory is also sufficient. Unfortunately, I can't use a debugger, as this error doesn't happen on my machine. Actually, this program is just my tech demo. Many people have tried it and I got a lot of positive feedbacks so far, but now some guy told me that it breaks on his machine, giving this error message... So I have to figure this out blindly.. Thanks, Andras Thursday, February 12, 2004, 9:10:43 PM, Jon Watte wrote: > Typically this means that you're linking with a DLL that doesn't exist, or > you're calling UNICODE functions without unicode support, or you're plain > running out of memory. Do you have one of the machines available for > debugging? WinDbg sometimes helps in debugging these things. > Cheers, > / h+ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Andras Balogh > Sent: Thursday, February 12, 2004 4:21 AM > To: gam...@li... > Subject: [GD-Windows] DLL initialization (was: Loading new DLLs on old > Windows) > My program supports dynamic loading of plugins. Every plugin > represents a class, and resides in a separate DLL. Instead of > exporting the class itself, I only export a factory function and > provide a header file with the declaration of the pure virtual base > class (ie. the interface). At runtime, I load the DLL and call the > exported factory function, which instances an object and returns a > pointer to the base class. > This architecture works like a charm on most machines. However, on > some configurations, my program reports the following: "Error Code > 1114: A dynamic link library (DLL) initialization routine failed." > But I have no clue why. Do I have to use DllMain? MSDN says it's only > an optional entrypoint.. My DLLs are dynamically linked to the C/CPP > run-time libraries. > Thanks, > Andras |
From: Jon W. <hp...@mi...> - 2004-02-13 18:15:31
|
Yeah, Windows is like that :-( If it's a crash, you can look into the minidump facility that's built-into Windows XP, but this error probably doesn't count as a catchable exception. Does it say what the offending library is? Can you run a debug output spy and capture information? If you can't even do that, I can't think of another way to debug it. Re-write your demo to load all shared libraries manually? :-) Good luck! Cheers, / h+ -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Andras Balogh Sent: Friday, February 13, 2004 9:21 AM To: gam...@li... Subject: Re: [GD-Windows] DLL initialization (was: Loading new DLLs on old Windows) Hi Jon, The DLL exists (otherways the error code would be different), and it also doesn't mess with UNICODE. The logs report that memory is also sufficient. Unfortunately, I can't use a debugger, as this error doesn't happen on my machine. Actually, this program is just my tech demo. Many people have tried it and I got a lot of positive feedbacks so far, but now some guy told me that it breaks on his machine, giving this error message... So I have to figure this out blindly.. Thanks, Andras Thursday, February 12, 2004, 9:10:43 PM, Jon Watte wrote: > Typically this means that you're linking with a DLL that doesn't exist, or > you're calling UNICODE functions without unicode support, or you're plain > running out of memory. Do you have one of the machines available for > debugging? WinDbg sometimes helps in debugging these things. > Cheers, > / h+ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Andras Balogh > Sent: Thursday, February 12, 2004 4:21 AM > To: gam...@li... > Subject: [GD-Windows] DLL initialization (was: Loading new DLLs on old > Windows) > My program supports dynamic loading of plugins. Every plugin > represents a class, and resides in a separate DLL. Instead of > exporting the class itself, I only export a factory function and > provide a header file with the declaration of the pure virtual base > class (ie. the interface). At runtime, I load the DLL and call the > exported factory function, which instances an object and returns a > pointer to the base class. > This architecture works like a charm on most machines. However, on > some configurations, my program reports the following: "Error Code > 1114: A dynamic link library (DLL) initialization routine failed." > But I have no clue why. Do I have to use DllMain? MSDN says it's only > an optional entrypoint.. My DLLs are dynamically linked to the C/CPP > run-time libraries. > Thanks, > Andras ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Andras B. <bn...@ma...> - 2004-02-14 16:41:31
|
No, it's not crashing. When my framework detects that the required DLL cannot be loaded, it records the error messages in the log, then quits nicely. I think I'll just write a stripped down test program, and see if it works on his machine.. Andras Friday, February 13, 2004, 7:10:59 PM, Jon Watte wrote: > Yeah, Windows is like that :-( > If it's a crash, you can look into the minidump facility that's built-into > Windows XP, but this error probably doesn't count as a catchable exception. > Does it say what the offending library is? Can you run a debug output spy > and capture information? If you can't even do that, I can't think of another > way to debug it. > Re-write your demo to load all shared libraries manually? :-) > Good luck! > Cheers, > / h+ |
From: Brian H. <ho...@py...> - 2004-02-13 18:47:23
|
> but now some guy told me that it breaks on his machine, giving this > error message... So I have to figure this out blindly.. Welll...the obvious thing is to do a "diff" on his system vs. yours/others. What OS, memory, etc.? Brian |
From: Andras B. <bn...@ma...> - 2004-02-14 16:41:32
|
Unfortunately I haven't collected detailed system info from other users, but I believe that most of them had Windows2000/XP (not sure, just extrapolating from the few guys I've talked to), while this guy is running a Win98SE box (Windows 4.10.67766446 A). Andras Friday, February 13, 2004, 7:45:15 PM, Brian Hook wrote: >> but now some guy told me that it breaks on his machine, giving this >> error message... So I have to figure this out blindly.. > Welll...the obvious thing is to do a "diff" on his system vs. > yours/others. What OS, memory, etc.? > Brian |
From: Brian H. <ho...@py...> - 2004-02-14 17:05:47
|
> Unfortunately I haven't collected detailed system info from other > users, but I believe that most of them had Windows2000/XP (not > sure, just extrapolating from the few guys I've talked to), while > this guy is running a Win98SE box (Windows 4.10.67766446 A). Well, at the risk of stating the glaringly obvious, it's possible that your own DLL is dependent on a DLL that is only available on Win2K/WinXP -- have you itemized your dependencies and then looked to see if those are available on Win98SE? Brian |
From: Andras B. <bn...@ma...> - 2004-02-15 09:09:04
|
Saturday, February 14, 2004, 6:03:08 PM, Brian Hook wrote: >> Unfortunately I haven't collected detailed system info from other >> users, but I believe that most of them had Windows2000/XP (not >> sure, just extrapolating from the few guys I've talked to), while >> this guy is running a Win98SE box (Windows 4.10.67766446 A). > Well, at the risk of stating the glaringly obvious, it's possible that > your own DLL is dependent on a DLL that is only available on > Win2K/WinXP -- have you itemized your dependencies and then looked to > see if those are available on Win98SE? Dependency Walker says it depends only on kernel32.dll, msvcp71.dll and msvcr71.dll (I have provided the last two). The nicest thing about such plugins, is that they mostly use the services provided by my framework (or other plugins), thus they are really lean! Andras |
From: Nicolas R. <nic...@fr...> - 2004-02-15 11:26:05
|
Hi, I hope I'm not saying something too obvious, like ... Not loading more than 64+ DLLs ? Handles are quite limited under W9x (DOS), and in the past, we had several trouble loading numerous plug-ins from big number of DLLs (in fact 64+ :( ), we had to regroup some plug-ins. BTW I saw in your first message something like "a DLL = a class" ! For a medium project (1000 classes ?) that might be far too many DLLs to handle for W9x :) 1 DLL = 1 Class is a bad choice. You'd better have 1 class <--n----1--> 1 factory = 1 DLL. Soz if this was what you were doing. Nicolas Romantzoff > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Andras Balogh > Sent: Saturday, February 14, 2004 5:11 PM > To: gam...@li... > Subject: Re: [GD-Windows] DLL initialization (was: Loading > new DLLs on old Windows) > > > Unfortunately I haven't collected detailed system info from > other users, but I believe that most of them had > Windows2000/XP (not sure, just extrapolating from the few > guys I've talked to), while this guy is running a Win98SE box > (Windows 4.10.67766446 A). > > > Andras |
From: Andras B. <bn...@ma...> - 2004-02-15 14:47:55
|
It's not like one DLL for each class! :) You could have a class that provides factory functions, that can create multiple other classes. Also, the exported interface is usually _very_ high level. On the implementation side, the plugin can use thousands of classes in one DLL, it's just that they are internal to that module and not accessible to the outer world. BTW: I'm not loading that many DLLs. In fact, this small demo loads only one DLL, that contains all the logic. The factory creates a very small class called Main, that upon initialization creates multiple internal classes, which themselves subscribe to such events like Simulation, UI_Update, RenderScene, InputEvent, etc... (Event handling is provided by the framework, through a globally accessible interface). Andras Sunday, February 15, 2004, 12:21:00 PM, Nicolas Romantzoff wrote: > Hi, > I hope I'm not saying something too obvious, like ... Not loading more > than 64+ DLLs ? > Handles are quite limited under W9x (DOS), and in the past, we had > several trouble loading numerous plug-ins from big number of DLLs (in > fact 64+ :( ), we had to regroup some plug-ins. > BTW I saw in your first message something like "a DLL = a class" ! For a > medium project (1000 classes ?) that might be far too many DLLs to > handle for W9x :) > 1 DLL = 1 Class is a bad choice. You'd better have 1 class <--n----1--> > 1 factory = 1 DLL. > Soz if this was what you were doing. > Nicolas Romantzoff |
From: Simon O'C. <si...@sc...> - 2004-02-16 01:51:45
|
Hi Andras, If the entry point (_DllMainCRTStartup, DllMain or a custom entry point) returns FALSE, LoadLibrary() will return the error you're getting (ERROR_DLL_INIT_FAILED). There aren't many reasons why _DllMainCRTStartup (the function called before DllMain) would fail, but a few examples would be: - memory (HeapAlloc() inside the CRT stuff failing). - static/global object creation failing (e.g. out of stack, exceptions from constructors etc). - clashes between the version of the C runtime library used by the DLL and the client app (pretty rare unless the DLL and client pass CRT objects between each other). - CRT file handle problems (e.g. if your client app redirected the standard CRT handles in a bad way). - [extremely unlikely, but...] MFC DLLs built with MSVC++ version 4 - there were two versions of the 4.2 MFC DLLs that had identical names but were slightly different - some apps (mostly OLE heavy ones) where the DLL used one version and the client used another would have a few problems. Have you done anything at all special with your DLLs? (re-basing, function forwarding, delay loading etc) I'd still have a DllMain with just a simple "return TRUE;" (and maybe a DisableThreadLibraryCalls() for DLL_PROCESS_ATTACH notifications for performance reasons where relevant) just to be certain I knew what was being returned for entry. Do all the plugin DLLs you load suffer from the same issue or is it just one? - try statically linking the offending DLL and see if the tester gets any more specific error message (such as the missing export message box you'll get if your DLL requires an OS function only present in a newer version of Windows). Cheers, Simon O'Connor Programmer @ Acclaim & Microsoft DirectX MVP > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Andras Balogh > Sent: 12 February 2004 12:21 > To: gam...@li... > Subject: [GD-Windows] DLL initialization (was: Loading new > DLLs on old Windows) > > My program supports dynamic loading of plugins. Every plugin > represents a class, and resides in a separate DLL. Instead of > exporting the class itself, I only export a factory function > and provide a header file with the declaration of the pure > virtual base class (ie. the interface). At runtime, I load > the DLL and call the exported factory function, which > instances an object and returns a pointer to the base class. > > This architecture works like a charm on most machines. > However, on some configurations, my program reports the > following: "Error Code > 1114: A dynamic link library (DLL) initialization routine failed." > > But I have no clue why. Do I have to use DllMain? MSDN says > it's only an optional entrypoint.. My DLLs are dynamically > linked to the C/CPP run-time libraries. > > > Thanks, > > Andras > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with a free > DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.572 / Virus Database: 362 - Release Date: 27/01/2004 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.588 / Virus Database: 372 - Release Date: 13/02/2004 |
From: Andras B. <bn...@ma...> - 2004-02-16 10:00:00
|
Hi Simon, > If the entry point (_DllMainCRTStartup, DllMain or a custom entry point) > returns FALSE, LoadLibrary() will return the error you're getting > (ERROR_DLL_INIT_FAILED). Yeah, I know. I've already included a fake DllMain that just returns TRUE, but the result is the same. I guess this means that it fails in _DllMainCRTStartup. > There aren't many reasons why _DllMainCRTStartup (the function called before > DllMain) would fail, but a few examples would be: > - memory (HeapAlloc() inside the CRT stuff failing). Well, the logs say that he's got 150MB+ of free memory. > - static/global object creation failing (e.g. out of stack, exceptions from > constructors etc). There ain't no static objects in my DLL. It shouldn't do anything upon loading. > - clashes between the version of the C runtime library used by the DLL and > the client app (pretty rare unless the DLL and client pass CRT objects > between each other). They are dynamically linked to the same CRT (which is installed in the same directory as the executables + DLLs) > - CRT file handle problems (e.g. if your client app redirected the standard > CRT handles in a bad way). Don't even know what you're talkin' about :) > - [extremely unlikely, but...] MFC DLLs built with MSVC++ version 4 - there > were two versions of the 4.2 MFC DLLs that had identical names but were > slightly different - some apps (mostly OLE heavy ones) where the DLL used > one version and the client used another would have a few problems. Have not even touched MFC in any way. > Have you done anything at all special with your DLLs? (re-basing, function > forwarding, delay loading etc) Nope. > I'd still have a DllMain with just a simple "return TRUE;" (and maybe a > DisableThreadLibraryCalls() for DLL_PROCESS_ATTACH notifications for > performance reasons where relevant) just to be certain I knew what was being > returned for entry. I've already done that without success... :( > Do all the plugin DLLs you load suffer from the same issue or is it just > one? - try statically linking the offending DLL and see if the tester gets > any more specific error message (such as the missing export message box > you'll get if your DLL requires an OS function only present in a newer > version of Windows). Currently this program only uses one DLL, but I'll create some more (simple ones), and see if they work or not. Now I'm pretty sure that I'm using something in my DLL, that Win98 doesn't support, just doesn't know what. :) Thanks for your help, Andras |
From: brian s. <pud...@po...> - 2004-02-16 16:01:08
|
On Monday, February 16, 2004, at 01:55 AM, Andras Balogh wrote: > Currently this program only uses one DLL, but I'll create some more > (simple > ones), and see if they work or not. Now I'm pretty sure that I'm using > something in my DLL, that Win98 doesn't support, just doesn't know > what. :) Maybe you should run "dumpbin /imports" on your DLL, and then write some code in your main app to attempt to load each and every one of those imported functions by hand. See which one fails. It's like killing a fly with a rocket launcher, but at this point it seems like you really need to kill that fly :) --brian |
From: Jon W. <hp...@mi...> - 2004-02-16 16:36:13
|
> There aren't many reasons why _DllMainCRTStartup (the function called before > DllMain) would fail, but a few examples would be: Another would be if the "subsystem" version of the DLL, or one of the DLLs that it's referencing, is greater than the version of Windows you're running on. For Windows 98/ME, the "subsystem" version must be 4; on 2k/XP it can be 5. (Didn't we discuss this just recently?) Note that I'd suspect the runtime DLLs (version 71) before I'd suspect the actual DLL you built yourself. You can check the subsystem version using DEPENDS.EXE that comes with Visual Studio. Cheers, / h+ |
From: Andras B. <bn...@ma...> - 2004-02-17 16:23:12
|
Monday, February 16, 2004, 5:29:54 PM, Jon Watte wrote: >> There aren't many reasons why _DllMainCRTStartup (the function called >> before DllMain) would fail, but a few examples would be: > Another would be if the "subsystem" version of the DLL, or one of the DLLs > that it's referencing, is greater than the version of Windows you're running > on. For Windows 98/ME, the "subsystem" version must be 4; on 2k/XP it can be > 5. (Didn't we discuss this just recently?) Yeah, it was me, who asked the question about subsystem versions a couple of days ago, because first I also thought it was something to do with versioning, but since then I've been told that every exec & DLL (including CRT and system stuff) is linked with version 4.0 (except 64 bit programs). Checking the version numbers with DependencyWalker confirms this. Andras |
From: Andras B. <bn...@ma...> - 2004-02-18 09:39:24
|
Ah, finally I've found the problem. Yes, it was an API call in the DLL (SetFilePointerEx) that's only supported on WinXP/2K. Thanks, Andras |