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.

Dark GDK / Loading and a DLL

Author
Message
Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 3rd Dec 2008 19:15
is there another way to call a DLL besides for using the dbLoadDLL and dbCallDLL ? Neither of the commands seem to be working even with the update.

http://ninjagms.wetpaint.com/
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 3rd Dec 2008 19:24
To be honest, this is one of those things that I scratch my head about when I'm using DGDK. I was looking over DGDKs command list and saw file i/o and thought "Say what!?!"

The C++ commands are much more effective at handling DLLs, use them instead.


Tux is my guildmaster.
Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 3rd Dec 2008 19:32
I'm not entirely sure about the c++ commands
after i load a DLL using

How would i call one of its functions ?

http://ninjagms.wetpaint.com/
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 3rd Dec 2008 19:44
They are there because DGDK is a copy of DBP. It would be stupid to remove the commands in DGDK.

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 4th Dec 2008 00:10
http://msdn.microsoft.com/en-us/library/ms682589(VS.85).aspx

There's the official documentation on DLLs, it has examples for loading and using functions from DLLs. There's a couple ways to use DLLs and some things you need to know, so I'd read through the material.

The reason I am against using DGDKs functions is a) you told me they don't work, and I trust you =P, b) it's best to use the native commands.

All DGDK is doing is wrapping them for easier use and, from what you've said, doing a very poor job of it! Learn the native commands, you'll be better off!

Quote: "They are there because DGDK is a copy of DBP. It would be stupid to remove the commands in DGDK."


Nonsense!

It's very reasonable to remove some of the supurfluous commands, and, indeed, they did! Some remained for reasons unknown. I suppose some of the file i/o remained because they are arguably easier to use, but all in all I think C style input, once I learned it, was much nicer than DGDK.

DGDK is a port of the BASIC commands that DBP uses. Since it is being ported to a different language rather than a stand alone BASIC, there are some commands which don't make much sense to have as the native language it's ported to, C++ in this case, does it better, more efficiently, though arguably more difficult.


Tux is my guildmaster.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Dec 2008 18:45 Edited at: 4th Dec 2008 18:45
Quote: "They are there because DGDK is a copy of DBP"

It's a copy, PLUS it's also a wrapper - all of the db prefixed functions are wrappers to the actual functions, and they deal with argument conversions (float to DWORD for example) and argument hiding (all of the 'oldstring' pointers for the functions that return strings).

So it was in fact extra work to port the file I/O commands from DBPro. The same is also true the DLL commands, but in this case you can forgive it as they are far easier to learn than the windows equivalent.

In the past I have written a wrapper for the DLL commands that would allow you to pass arguments of any 4-byte type and return any 4-byte values - it should still work if you can find it, although I'd advise putting the effort into learning the LoadLibrary/GetProcAddress/function pointer methods.

Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 5th Dec 2008 05:00
One more question.
after loading the DLL and calling its function i still get an error message.


Is this a problem with my code ? or with the DLL ?





http://ninjagms.wetpaint.com/
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Dec 2008 14:33
You're dereferencing a null pointer - and that's all that can be said about it at this point.

What does the PrintALL function look like?

Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 5th Dec 2008 14:45 Edited at: 5th Dec 2008 14:51
i don't have the source for it, but its just a basic function to print text.

The same error occurs with a different DLL


http://ninjagms.wetpaint.com/

Login to post a reply

Server time is: 2024-09-30 11:37:04
Your offset time is: 2024-09-30 11:37:04