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 / class dll

Author
Message
Jay Bee
18
Years of Service
User Offline
Joined: 15th Jul 2006
Location: Ashford, Kent, England
Posted: 13th Sep 2006 03:30
Hey there,

I was wondering, are there any dlls or plugins which allow classes, or even structs for DBC, the types in pro are alright, but dont quite cut it really...

Cheers
-JB

Your signature has been erased by a mod - 404kb is a little large, don't you think? Nope not really, but heh, ur the boss
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 19th Sep 2006 06:16 Edited at: 20th Sep 2006 06:26
Interesting question, Jay Bee. I am going along the same lines. I just made my first dll for use in DBPro. I like it! I have some math routines to start...like the integer divide by power of 2 thing: it works nice, but the time across the interface is still a big factor in a routine that simply flips bits and shifts.

The standard VC++ appwizard-generated dll boilerplate code shows an example of how to export variables and classes from a dll. The odd thing is that DBPro does not make use of this mechanism...to my knowledge. They instead use a string table with the C++ decorated names of functions and variables. This is messy, and name-mangling is not at all standardized to my knowledge. It works well enough for functions, so...I am confident that I can add some of the functionality that I want in DBPro, BUT I AM ASKING MYSELF...what am I doing? I need DarkSDK if I want to do that. If you are using C++, I think it would be better to go with DarkSDK.

It will probably kill me here to say this, but...BASIC is not the language for too much OO coding. It falls down too quickly. Adding a DLL interface puts additional overhead into each call by its very nature. Also, you will need a mechanism to translate between types...most likely on the dll side for speed reasons. The introduction of DLL code into your app will necessitate inclusion of the dll into your app. (Maybe not a problem, I am only trying to relate why I feel that I should get DarkSDK.)

It seems to me that DBPro is moving in the right direction, but there are several waypoints to go...true indirection, casting, pass by reference, classes. Then you get into OO land with its messiness about inheritence, subclassing, etc. It is really a BIG leap.

You could conceivably write a dll that solved most of your woes with respect to UDTs, etc. It seems to me that it would grow into a bloated piece of code that was nearly impossible to debug effectively, and not really the OO plug-in that you are wanting.



Now, I hope that you realize what is going on, here...we are using C to wrap C++ for BASIC, which is hiding an API. Your interface from DBPro is not to the classes...it is to functions in C that you add like it says in the help topic "Third Party Commands". The C++ side is implemented by adding classes, their include files follow the include file for MYDBP. That exposes them to MYDBP, and to the C functions that you write in the cpp file above. It is interesting and fun. Now, you make it useful.

Login to post a reply

Server time is: 2025-05-17 06:05:41
Your offset time is: 2025-05-17 06:05:41