From: <mi...@ca...> - 2003-06-23 07:49:40
|
Oh, how dumb of me, I didnt see the condition :) Well, the cause of the error is that you have to use char *names[]= { instead of char *names=. In other words, add []:s. You must have a very kind compiler that lets your code through. /Anders Lindén ----- Original Message ----- From: "RomikB" <ro...@ma...> To: <min...@li...> Sent: Monday, June 23, 2003 7:47 AM Subject: [Mingw-users] Re: Just Funny > Hello mingw-users-request, > > Monday, June 23, 2003, 5:12:04 AM, you wrote: > > > Maybe LoadLibrary doesnt set the last error when it is succeeding. (Not all win32 API functions do that). > > Look if LoadLibrary returns NULL, then the last error is valid. > > (Or use SetLastError(0); before you use LoadLibrary. > > > > /Anders > > > As you can see GetLastError() Executed only when LoadLibrary returns > NULL. > > Something more? > > Explain me please this error. > > PS: There is no error, if dll's compiled by MSVC6. > > >> I have get a simple (simplest) test: > >> test.c--- > >> #include <windows.h> > >> char *names = { > >> "dll0.dll","dll1.dll","dll2.dll","dll3.dll","dll4.dll", > >> "dll5.dll","dll6.dll","dll7.dll","dll8.dll","dll9.dll" > >> }; > >> int main(void) > >> { > >> int i; > >> void *hlib; > >> for(i=0;i<10;i++) > >> { > >> hlib = LoadLibrary(names[i]); > >> if(!hLib) printf("%s |Error| %i\n",names[i],GetLastError()); > >> } > >> } > >> --------- > >> dllx.c--- > >> static long mem__[0x00200000]; > >> long func(void){ > >> int i; > >> for(i=0;i<0x00200000;i++) mem__[i] &= 66; > >> return mem__[0]; > >> } > >> --------- > >> Compile it: > >> gcc test.c -o test.exe -O2 > >> gcc -O2 -shared -o dll[number].dll dllx.c > >> Run it and get > >> dll6.dll |Error| 120 > >> dll8.dll |Error| 120 > >> == > >> 120 This function is not supported on this system. ERROR_CALL_NOT_IMPLEMENTED > >> == > >> Funny heh? > >> Result don't depend from dll's, it depend only from "dllx.dll" > >> positions is names[]. > >> What do you think about this? > > > -- > Best regards, > RomikB mailto:ro...@ma... > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users |