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 / tpcs are being annoying

Author
Message
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 25th May 2006 02:33
ive been trying to create a c tpc. I can make a normal dll that would be in dbc,but so far i cannot create a plug-in. I try,but darkbasic pro says the function cannot be found. Its a problem in the string table,but i dont know where. Here is the string table and the functions:



So why doesnt darkbasic pro recognize that?

all ben needs is his band,his guitar,and his computer
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 25th May 2006 04:34 Edited at: 26th May 2006 01:43
String table is referencing the wrong function name.

Since you're not using an export table, you'll need to view what the generated function name is in the DLL. You can use Notepad or something like ExeScope for example.

Just a little extra, but the function name you're using atm is apparently for the function: int Add(void)
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 26th May 2006 01:17
how is it for int Add(void)?

all ben needs is his band,his guitar,and his computer
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 26th May 2006 01:51
When a function is exported from a DLL, it's, by default, exported in it's decorated form.

It's looks to me like you've copied a portion of the string table from one of the examples, which has a different syntax to the function you've exported.

The decorated version of the function depends on function name, return type, and parameter types, and as such means you can't just copy the declaration of one function and rename it unless they share the same definition.

For example, a function defined as

int GetValue(void)

would produce the same decorated form (apart from name) as

int ReadValue(void).

The correct decorated form for your add function should be

?Add@@YAHHH@Z

As I said, this can be viewed using something like Notepad, or a tool that displays exported functions in a DLL. Or you could use an export table, and then you don't have to mess around with decorated function names.
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 26th May 2006 01:53
how do i use export tables?

also, if im using functions like Setup(),Update(),and Destroy(), how do i use a variable from all of those? Im using a variable for irrlicht for the device, but i can only access that from inside that one function. So how do i make that variable accessible from all functions?

all ben needs is his band,his guitar,and his computer
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 26th May 2006 02:01 Edited at: 26th May 2006 02:02
For export tables take a look at the second example supplied with DBP.

And for global variable access declare it outside of the functions. So rather than having

(Pseudo)

void Setup()
{
IrrlichtDevice *device = createDevice( ... );
}

You'd declare the device outside of the setup function

// Declare the device - This variable will be accessible to all functions
IrrlichtDevice* device = 0;

void Setup()
{
// Create the device
device = createDevice( ... );
}
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 26th May 2006 02:19
alright. New question.

a) i got a working irrlicht dll going,it can only print on the screen,but i need the irrlicht world to render with the dbp world. How would i do this?

all ben needs is his band,his guitar,and his computer
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 26th May 2006 03:11
Not possible, or atleast, not to my knowledge.
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 26th May 2006 03:33
alright. Well,im just making a wrapper with irrlicht with newton or ode.cant decide which one. I'll find which one is easier...

all ben needs is his band,his guitar,and his computer

Login to post a reply

Server time is: 2024-11-22 06:26:04
Your offset time is: 2024-11-22 06:26:04