Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
ironhoof
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 13th Dec 2002 07:54
I made a DLL using DEV C++ ad all other C++'s i could find

but when i call em from darkbasic pro or the other it returns a lovely "the DLL file failed to execute" error
same in other lnguage i tried to run my DLL in this is getting frustrating it wont run my functions..

it wont even run the samples i compiled in from the extra's folders. But everyone says this compilier orks "and im NOT going to get delphi or visual c++" i have too many C++ compiliers as it is.

Ive seen them work when other people mae em maybe im not doing something right.
-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Dec 2002 11:13
Dont know anything about DEV C, so the following is only a guess : Does your DLL has the DLLMAIN function ?

Good news everybody! I really am THAT good...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Dec 2002 19:09
I don't use it either, but I do know that Dev-C++ uses the mingw compiler. Have a look here http://www.mingw.org/mingwfaq.shtml. There is a section there for creating a DLL for MSVC.
ironhoof
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 13th Dec 2002 23:25
Ah is DLLMain like the Main in C++? Remember now iim back from the day of DOS C++ Its easy to overlook something like that

-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Dec 2002 02:26
Here's a skeleton of DLL main striaght from VC++

BOOL APIENTRY DllMain( HANDLE Module, DWORD Reason, LPVOID Reserved )
{
switch(Reason) {
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}

I don't know whether just defining it will allow your DLL to work, or whether you will need to specifiy extra compiler or linker options.
ironhoof
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 15th Dec 2002 02:04
Well it compled with that and it compiled without that but still gives me that error in both DBPro and DB and in anyother language I triedto use the DLL in and the DLL is 32 bit like it should be I know how to use them and it should work. but it dosn't - Ahwell nobody needs any DLL's anyway im just going to give up on it it dosn't work

-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 15th Dec 2002 02:18
Any chance of letting us see the code ?

Good news everybody! I really am THAT good...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Dec 2002 19:37
Also, which version of Dev-C++ are you using? I can download whichever one you are using and try some stuff myself ( Broadband )
ironhoof
23
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 16th Dec 2002 06:33
SURE! Im using the LATEST version of DEV-C++

here is my first DLL code if you can figure it ou THAT would be marvelouse



-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 16th Dec 2002 11:05
And do you have a .DEF file/use externals for testing ?

Good news everybody! I really am THAT good...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Dec 2002 23:18
As mrTAToad said, you need to export your functions. I prefer the following way. I have tested and compiled under Dev-C++5(gcc2.95).



And here is the test code


Enjoy!

Login to post a reply

Server time is: 2026-07-06 20:50:22
Your offset time is: 2026-07-06 20:50:22