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 Discussion / Exported Variable?

Author
Message
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Jul 2009 20:57
is it possible to access exported variables in a dll from dbc?

New Site! Check it out \/
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Jul 2009 21:49
It matters how and where the DLL saves the variables... Can you give some more info?

TheComet


Make the path of your enemies easier with Waypoint Pro!
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Jul 2009 22:40
if you know anything about c++ and dll's then here is how you export a function



i know it is possible to export a variable in a dll like this:



but i don't know how to access it from dbc.

New Site! Check it out \/
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Jul 2009 22:45 Edited at: 27th Jul 2009 22:46
You can't. Only exported functions are supported.

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Jul 2009 22:47 Edited at: 27th Jul 2009 22:48
If it's a dll call, assign it to a variable in DBC by returning the variable from the dll function:

c/c++



DBC



Or maybe I don't understand the question.

Enjoy your day.
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Jul 2009 23:00 Edited at: 27th Jul 2009 23:02
Well, some languages like C(++) allow you to export variables.
So a call to GetProcAdress returns the pointers to these variables.

Unfortunately there's not a lot you can do with these pointers in DBC.

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Jul 2009 23:10
Quote: "If it's a dll call, assign it to a variable in DBC by returning the variable from the dll function:
"


Ya i got the exported function part lol. but thanks

Quote: "
Well, some languages like C(++) allow you to export variables.
So a call to GetProcAdress returns the pointers to these variables.

Unfortunately there's not a lot you can do with these pointers in DBC. "


Ok! thats what i needed to know thanks!

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Jul 2009 23:24
Oh, ok. So why not just setup the type of variable pointer you need and swap the values with a memblock pointer? Or is it not the same goal?



Enjoy your day.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 28th Jul 2009 00:20
Ya that would work. it was more like a random question just seeing if it was possible.

thanks for all your help.

apperantly theres more c++ code on this thread then dbc code (no dbc code actually lol)

New Site! Check it out \/
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 28th Jul 2009 13:09
Quote: "no dbc code actually lol"




Now there is.

TheComet


Make the path of your enemies easier with Waypoint Pro!
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 28th Jul 2009 23:09
lol thanks now it has something dbc in it lol

New Site! Check it out \/
Bluestar4
18
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 30th Jul 2009 17:02
Quote: "is it possible to access exported variables in a dll from dbc"

hello caleb, Yes , its totally possible if the function in the dll returns something.

code for dll :


sample code for db:


for your convienance I have uploaded a small file that you can keep for a reference

bluestar4~
---Missle Might - Hero Battles - Zillipede --- which do you like the best ?

Attachments

Login to view attachments
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 30th Jul 2009 17:19
I think you missed the point a bit...
This is about exported VARIABLES not about exported functions.

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 30th Jul 2009 22:40
Ha Ya i geuss i wasn't too Clear


I know how to access exported FUNCTIONS.

i am trying to figure out if i can access exported VARIABLES

but the question has already been awnsered. thankyou for your time and help.

New Site! Check it out \/

Login to post a reply

Server time is: 2024-05-20 07:20:08
Your offset time is: 2024-05-20 07:20:08