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 / How to call a TPC within another TPC DLL?

Author
Message
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 5th Nov 2004 09:29
I was wondering how do I call a TPC from another TPC DLL? For example, if I am writing a TPC DLL that uses some other TPC as well, how do I generate the linker symbols and function header of other TPC so that I can used in the TPC DLL that I am working on. Thanks!

Thomas Cheah (Technical Director)
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.
http://www.badnose.com/
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Nov 2004 16:05
Several ways :

A) If you've got the source code & headers, then you can compile them in as usual
B) If you've got the library file & headers, then you can attach the library file and compile as usual
C) If you've got neither of the above, then you would need to use the LoadLibrary command to load the DLL in, GetProcAddress to get the address of the functions you want, and then call the address.

Walk softly... and carry a big gun...
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 6th Nov 2004 22:03
simply open the other TPC dll and call a function from in like if you call a dbpro function .
I use that system to control my DBPro Extends DLL Package from X-Quad Editor and it work perfectly ( but I can only give you sample with purebasic as I'm not a c++ coder )

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 6th Nov 2004 22:25 Edited at: 6th Nov 2004 22:25
What we really need then is some automated tool which can take a TPC plugin with a stringtable, and produce a C++ Namespace from it.

There would need to be a command to load the plugin and get pointers to all the relevant functions, then you would call commands in by the namespace. This would also work for DBPro DLLs hopefully.

Eg:

bool loadedSuccessfully=MyTPC::load;
int result=MyTPC::tpcFunction(paramA,paramB,etc.);

I'm a wee bit busy at the moment, but if I get some free time I'll look into it.


BlueGUI:Windows UI Plugin - All the power of the windows interface in your DBPro games.

Login to post a reply

Server time is: 2024-11-23 09:58:31
Your offset time is: 2024-11-23 09:58:31