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.

DLL Talk / C / C++ DLLs

Author
Message
Gamefreak
19
Years of Service
User Offline
Joined: 20th Jun 2004
Location: Cyberspace
Posted: 16th Jun 2005 10:03
Can DBPro use C or C++ DLLs, or both?
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 16th Jun 2005 12:34
it can use basically any dll which of course includes C and C++ by using load dll and call dll ,please check help files for syntax of those, but if u want to just be able to say myfunction() then u would need to add stringtables or for a dll that u cant edit the source to u would have ot make a wrapper

AndLabs
19
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 14th Jul 2005 06:14
For an example, both of the following would work and would do the same thing:

In C:


In C++:


GCC uses different rules for getch() as you may be used to (if you know C or C++), so compile these examples in Dev-C++ (http://www.bloodshed.net/dev/) as DLLs, and call them as you normally do in DarkBASIC. So:

For the C version (if it was named waitC.dll):


For the C++ version (if it was called waitCPP.dll):


Note that the C++ version of waitForThisKey() returns a boolean value, so it is best to save it in a boolean variable. The C version will return it as an integer.

Hope that helps! If you have any problems, just ask!

For the Software You Want, AMPERSAND LABORATORIES is the place! [URL=http://www.andlabs.com/]
[/URL]
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 15th Jul 2005 01:41
Offset of reality Posted: 16th Jun 2005 04:34

is it just me or was that a while ago

n00bs will be shot on spot...
It only gets more logical from here(sigh)
ThomasFN
19
Years of Service
User Offline
Joined: 26th Aug 2004
Location:
Posted: 25th Jul 2005 22:21
I think techinally DBPro can load any dll that isn't an active X dll. VB can only create active x - therfore DBPro cannot load it. C and C++ and C sharp and that lot can create non-active-x dlls - therefore DBPro can load it. Simple enough...

IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 25th Jul 2005 23:31
stop right there

c and c++ can make dbpro loadable dlls but c# and vb.net won't - they use the .net framework which isn't compatiable with dbpro, if you want to use .net code then you have to write a wrapper for it

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon xp 2600+, 1280mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 26th Jul 2005 01:22
Quote: "if you want to use .net code then you have to write a wrapper for it"


You can also use inverse pinvoke or a program that automates the process such as my dll tool

Login to post a reply

Server time is: 2024-04-20 08:39:23
Your offset time is: 2024-04-20 08:39:23