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 / the workings of dlls?

Author
Message
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 20th Jul 2006 21:35 Edited at: 20th Jul 2006 21:35
well, i dont have that much experience with dlls, and im not at home(im on vacation, so i cant really test anything) and i have a question:

lets say you have this code as your DLL:


and this code in DBP:


i assume that this will cause DBP to print 0 then 1 then 2 ect...

is this correct? or is there something im doing wrong to produce that result? basically, i want the dll to be able to store information. is this possible, or does all data have to be stored within DBP?


Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Jul 2006 22:02
no you can store data in a dll, just make a global array/vairable and put stuff in it, I also thought this way when I first started on dlls so your not alone

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 20th Jul 2006 22:05 Edited at: 20th Jul 2006 22:06
wait, can you explain a little more plz? do you mean a global variable in the dll? or a global variable in DBP? you probably mean the dll, but im just making sure...

EDIT: actually, it should work, cause INT number; creates a global variable, right?


Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Jul 2006 23:42
yea in the dll

note though that just because its in the dll doesn't mean its in dbp

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Jul 2006 01:19
No, your code will not work.

The number variables value will be kept between calls, as it is outside of the function, but you can't call 'cout' like that.

If you need to print a variable within DBPro you have to call the PrintStringFunction function pointer from the globstruct, one of the print/printc functions from the core dll, or even the text function from the text dll.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 21st Jul 2006 17:00 Edited at: 21st Jul 2006 17:50
o really? does this go for everything put on the screen? how would i print the the DBP screen withOUT using built-in DBP commands?

EDIT: btw, to make the function undecorated, the code would look like this, right?




Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jul 2006 01:54
You can print to the display yourself if you want. Hunt around for the 3D text plugin source code.

You have the extern command in the wrong place. It should precede the function call, line your dllexport does. I use the following two lines for exporting, the first gives decorated names, the second gives undecorated.



For free Plug-ins and source code http://www.matrix1.demon.co.uk
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 22nd Jul 2006 02:01 Edited at: 22nd Jul 2006 02:57
k, thx

EDIT: i looked at the 3d text plugin source... its too confusing. i only know so much in C++, so i cant understand it. too many files too ill just use the DBP commands, so much easier...


Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*

Login to post a reply

Server time is: 2024-11-22 12:12:28
Your offset time is: 2024-11-22 12:12:28