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 / Where can I download the TPC SDK

Author
Message
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 5th Jul 2003 20:08
Hi,

I was wondering where can I download the TPC SDK for DBpro. In the DBpro help about TPC, it mention about GlobStruct structure in globstruct.h header file, but I couldn't find it in the DBpro progrma directory. I read from the DBpro newsletter there is something called the TPC SDK. Does anyone know where can I get this to write TPC DLL?
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Jul 2003 20:22
You have it already : C:\Program Files\Dark Basic Software\Dark Basic Professional\Help\documents

You'll find examples in there under : Files\Third Party Commands
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 6th Jul 2003 06:29
Thanks IanM! I guess I must be blind.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Jul 2003 13:04
Which compiler are you using? If it's Visual C++, then I have some source available on my site free that you can learn from. If it's not VC++, them you might want to look anyway for the general techniques.
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 6th Jul 2003 14:50
Hehe... it's ok IanM. I came from C/C++ programming.

Just one quick question, what is the CreateDeleteString() of the globstruct for? I know it is used for allocating and deallocating string buffer from the DBpro core memory storage. But do I need to deallocate any string that pass from DBpro to the TPC function before returning from the function?

thanks!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Jul 2003 15:19
Heh, why not check out the Framework source on my site?

That answers almost any question about interfacing to DBPro you might ask, but stopping short of the DBPro command access.

Ok, I'll answer this one. The answer is 'no...but'.

When you are returning a string from your function, DBPro also passes the string value that you are replacing as the first argument of your function. So you should use CreateDeleteString to remove the old string, and CreateDeleteString to create a new one. Technically, you could re-use the storage of the old string if it was long enough, and pass that back without deleting/creating - but that's usually too much bother and the time saving is minimal.

Here's an extract from the assembly-code plugin I'm currently working on to give you the idea:



Any other strings that you pass to your function should be considered read-only. You should not change their contents or deallocate them.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Jul 2003 15:56
Can CreateDeleteString fail, do you know, when creating a length > 0 ?
At the moment, in mine, I'm assuming it can't fail, and dont check the returnString - probably wise to start adding that check in.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins and other exciting things - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Jul 2003 16:03
The obvious answer to that is yes, because you can always exhaust available memory/swap ... but with windows, if you're in that position, then it's already too late to do anything about it - wave bye-bye to windows
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Jul 2003 16:04
Time to add more error checks then, me thinks...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins and other exciting things - oh my, yes!

Login to post a reply

Server time is: 2026-07-19 06:17:47
Your offset time is: 2026-07-19 06:17:47