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.

DarkBASIC Professional Discussion / even more .dll questions

Author
Message
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 23rd Nov 2003 21:43
do you need to muck around with stringtables if using Call Dll??? what are the main differences? What are the main disadvantages of using Call Dll???
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 23rd Nov 2003 21:53
No, you dont need string tables for a Call Dll - its only if you want to create commands from your DLL that you do.

The main disadvantage of using Call Dll are :

A) DLL has to be loaded and deleted.
B) An extra file to distribute
C) File can be deleted by the user
D) User can modify the DLL and mess it up.
E) Cant return some value types (64bit numbers for example).


Mirrors are more fun than television. Well, that was fun, in a not-so-fun sort of way...
Kentaree
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 23rd Nov 2003 21:54 Edited at: 23rd Nov 2003 21:58
Nope, string tables are only necessary for plug-ins, so DBP recognises the function name how you want to call it.
DLLs in general dont need this, which is an advantage. The only disadvantage as far as I know is that with call dll, you first need to load the dll, and everytime you a function from it you have to use the unsightly call dll command, which makes your code harder to read.

[edit: Damn, you get there just before me :-(. Anyway, I agree with everything he said :-P]

I would be unstoppable if I could just get started...
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 23rd Nov 2003 22:10
Generally plugin DLLs and their functions are easier. Easier to distribute since they are appended to the exe and easier to include in the source code. Their only disadvantge is that the DBpro app takes more time to launch the more DLLs it needs to extract.

Quote: "C) File can be deleted by the user
D) User can modify the DLL and mess it up."

The user can do that with the plugin DLLs, too. Although it's more complicated and won't happen accidently.

Quote: "E) Cant return some value types (64bit numbers for example)."

It is possible to return 64 integers (although not the straight way).

Me, I'll sit and write this love song as I all too seldom do
build a little fire this midnight. It's good to be back home with you.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Nov 2003 22:28
One further difference is that without the plug-in type of DLL, it's a bit harder to access DBPro internal information (not impossible, just harder)

[shameless-plug]
- which also means that you don't get the chance to take advantage of the interface library on my site
[/shameless-plug]

Personally though, I think that it's better if you put the little extra effort in to make it a full-blown plug-in for all the reasons stated above
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 23rd Nov 2003 22:45
Ta everyone,

Food for thought. Just trying the easy way out as I plow through VC++
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 23rd Nov 2003 22:52
Quote: "The user can do that with the plugin DLLs, too. Although it's more complicated and won't happen accidently"

The plug-in code is added to the executable, so it would be very hard to modify the DLL section.


Mirrors are more fun than television. Well, that was fun, in a not-so-fun sort of way...
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 23rd Nov 2003 23:09 Edited at: 23rd Nov 2003 23:10
Quote: "The plug-in code is added to the executable, so it would be very hard to modify the DLL section."

Why? It's not that they are in a particular segment or something. They are just appended to the exe (name, size, dll). You can extract them, modifiy them, paste them in again, adjust the length dword et voila.

Me, I'll sit and write this love song as I all too seldom do
build a little fire this midnight. It's good to be back home with you.
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 23rd Nov 2003 23:18
But not as easily as if its in a seperate file.


Mirrors are more fun than television. Well, that was fun, in a not-so-fun sort of way...
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 23rd Nov 2003 23:21
Hmmm, that's probably why I wrote:
"Although it's more complicated and won't happen accidently."


Me, I'll sit and write this love song as I all too seldom do
build a little fire this midnight. It's good to be back home with you.
Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 24th Nov 2003 01:46
If you had several functions within a .dll and say the .dll was called "Tester.dll" and say one of the several functions was:-

PrintSpecial(Text$,Fontname$,x#,y#)

How would you go about calling that particular function within the .dll...

and why does the example with dbpro refer to CALL DLL 1, "?MyFunc@@YAXXZ"

ie. why the ? and then the @@YAXXZ - is that needed with all functions referred to or is it a decorated function or what?

the export table of the .dll???

someone pls enlighten me...

ta,
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 24th Nov 2003 10:22
Quote: "Hmmm, that's probably why I wrote..."

Indeed...

Quote: "and why does the example with dbpro refer to CALL DLL 1,"MyFunc@@YAXXZ"

Because its been defined a a non-C function (a mangled name).
The ? defines a function, MyFunc is the function name, @@ denotes some parameters are following and YAXXZ (or at least part of it) denotes the number of parameters and type.


Mirrors are more fun than television. Well, that was fun, in a not-so-fun sort of way...

Login to post a reply

Server time is: 2026-07-26 17:36:55
Your offset time is: 2026-07-26 17:36:55