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 / VB DLL's in dbpro?

Author
Message
seppie
22
Years of Service
User Offline
Joined: 5th Sep 2003
Location:
Posted: 5th Sep 2003 18:36
Hey everybody,

Just started with darkbasic so still a lot of questions!
First of all, I'm a systems administrator but have been programming VB6 and VB.Net for some years now.
For my work I made a systems administration tool and as a first project to learn dbpro i thought about making a 3D version of it, SysAdmin3D .

It'll show servers in 3D and you can zoom in at servers, look at CPU load, check services, event based alarms, create users/mailboxes, check active directory replication, etc etc etc. when a server fails, it'll explode in pieces or something like that, still pondering on exploding or just a loud siren lol

For my "2D" version I already use a DLL that has all my functions to do all these checks and operations..(using WMI, ADSI, etc).
But it's created in VB.Net.
I've been looking all over the forum (search function would be nice) and the only examples and situations I stumble accross deal with VC++ or DEV-C++ and string tables...

So my question: Can DBPro handle VB6/VB.Net dll's? and if so, HOW?
Example would be nice.

Thanx in Advance!!
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Sep 2003 18:51
I've been wondering about dll's too. I program in VB6 and .NET and all I see is dbp can't use vb dll's because they are active x - I am not sure I am buying that though. If db can't use vb dll's then surely there is a way they could be implemented via a patch.

maybe just wishful thinking

-RUST-
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 5th Sep 2003 19:05
Quote: "If db can't use vb dll's then surely there is a way they could be implemented via a patch"


ActiveX is a complete bastard to program, I'm not sure that it is worth the time and effort involved in getting them to work.

OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Sep 2003 19:32
On the other site is a description on how to use ActiveX things - might be of some help.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
seppie
22
Years of Service
User Offline
Joined: 5th Sep 2003
Location:
Posted: 5th Sep 2003 22:47
what other site if I may ask?

And why is ActiveX a complete bastard to program? In what way do you mean that? I think it's not that hard for the dbpro team to implement that...
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 5th Sep 2003 22:59 Edited at: 5th Sep 2003 23:01
ActiveX is useful because once you have a control anything that supports it can use it (ie. web pages)

However I wish dbp did have activex functionality... then again I can only dream

Quote: "I've been looking all over the forum (search function would be nice)"


look at bottom of page.......

Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Sep 2003 23:18
yeah, what other site?

-RUST-
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 6th Sep 2003 00:26
The soon-to-be-ex-RGT site


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 6th Sep 2003 00:33
Quote: "And why is ActiveX a complete bastard to program? In what way do you mean that? I think it's not that hard for the dbpro team to implement that... "


Its hard to learn and understand. Lee probably could add ActiveX support, but it would take quite a bit of work unless he has some libs he can use to make life easier. As you have never programmed with ActiveX in C, you aren't really in a position to comment on whether or not it is difficult for the DBP team to add it.

CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Sep 2003 00:42
Rob K,

Any progress with my post in Bug Reports. It's been there 3 days and I just want to know if it's being looked into - that's all.
Thanks

(Sorry to go Off Topic)

-RUST-
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Sep 2003 00:48
Well actually it's only a tad more difficult (or time consuming) than late binding (or runtime binding) 'conventional' DLLs as it's done with TPCs or with CallDLL. However, I don't know if it's worth it.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
Kangaroo2 BETA2
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: Somerset / UK
Posted: 6th Sep 2003 00:51
At the moent VB dlls will not work within DBPro. If you have visual studio why not try and learn VC++ ? It's not that scary, especially if you are already familar with (real not clicked together) programming in VB

Quikly Studio Pro. Soon. Honest.
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Sep 2003 01:08
C# would be my path into the land of C-based languages as I already program in VB.NET (and vb6) .NET langs are similar in structure and syntax - I may give it a look!

(oh no - not another language

-RUST-
MushroomHead
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Sep 2003 01:17 Edited at: 6th Sep 2003 01:42
You can use early binding to make activex dlls fast, PowerBasic uses this technique ... late binding is another way, though not recommended for time critical loops. Nevertheless, even WITH early binding, I have noticed speed loss in large activex subroutines/functions so I guess you'd probably want to use it for fancy GUI effects or other general stuff, but not inside your main game loop.

Here is an example done using PowerBasic's COM model. Basically, the idea is to load the activex dll in a language that supports activex (Delphi, PowerBasic etc), then create a DLL project to wrap round the activex calls. Both the activex dll, wrapper dll (which exports functions called by DBP) and vb runtimes must be distributed with your setup (importantly, activex dll MUST also be registered using regsvr32 or else nothing will happen when the activex dll is called!).

http://www.realgametools.net/forums/index.php?board=14;action=display;threadid=8247;start=0

Here's another vb demonstration done by AM :-

http://www.realgametools.net/forums/index.php?board=16;action=display;threadid=5262

As for VB.NET dlls, I am not too sure about that, I have just asked about this on the PowerBasic forums because I want to know this too ... I can't seem to find anything on Google regarding compatibility between VB6 dlls and managed dlls produced by NET. Anyways, hope this helps.

- Rav.
Mattman
23
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 6th Sep 2003 01:25
I atarted to learn VB6, hate it,hate it,hate it,hate it!!!!!!!

Got a knack for finding secrets??? Jingot Racing --- A new brand of Racing --- Only from Nightwatch Studios

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 01:53
Yes, you are right, but Lee has to understand this well enough to implement at the machine code level to allow it to be integrated into DBPro.

I think most people underestimate how hard this stuff can be. For example, does anyone know the binary format and usage of a variant? Or how to get the entry point of a function you know nothing about? Not me

The wrapper technique is Ok for on-off type implementations, but Lee can't write a new wrapper for everybody who has a new DLL they want to use.
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Sep 2003 01:53 Edited at: 6th Sep 2003 01:56
mattman - shush!

shroomhead - I meant .net dll's written in c# may be possible.
I just tried an Interop-Wrapped COM dll I wrote (vb6 dll) and dbpro see's the dll but blows up in the parameters during the call.

also doesn't work on dll itself (non-wrapped)

-RUST-
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Sep 2003 01:56
I hear ya Ian

-RUST-
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 02:00
If you want to use a .NET dll you have to write a wrapper for that too
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Sep 2003 02:07
Quote: "You can use early binding to make activex dlls fast, PowerBasic uses this technique ... late binding is another way, though not recommended for time critical loops."

Yes early binding activex dlls is way faster. However to support it natively DBpro would require a linker that is able to create import tables depending on the dlls used.


Quote: "Or how to get the entry point of a function you know nothing about?"

Well if you know the function name you can use GetProcAddress in kernel32.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 02:38
Yes, I know that one ... I did put together the C++ to DBPro interface library after all (check out my site )

The majority of ActiveX DLLs and OCXs only export the Register/Unregister/CanUnload entry points and one or two others. They don't export their classes.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Sep 2003 03:17 Edited at: 6th Sep 2003 03:20
Quote: "The majority of ActiveX DLLs and OCXs only export the Register/Unregister/CanUnload entry points [...]"

Yes and GetClassObject.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 03:40
... which doesn't accept class/interface names. It needs the class id (available by name from the registry) and iterface id (where from?) for the object you want. Even then you don't know what class members are available.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Sep 2003 03:48
Correct, you need to know the id and class members. And what parameters the functions take. But if don't know the the parameters and return type of a standard DLL it's useless as well.
We are assuming that the ActiveX DLL is custom made, right?

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
swdave
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United States
Posted: 6th Sep 2003 11:54
I consider ActiveX DLL (or maybe its OCX) Useless........

Thats why you know who made them.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 12:34
They're not totally useless ...

See the problem is that for the compiler to allow you to use ActiveX dlls it has to know the structure of the classes/objects that you are accessing, otherwise how can it access them for you.

I suppose that it may be possible to create a wrapper generator of some kind ...
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Sep 2003 13:22
I don't see that as a problem. But as I stated before the question is, is it worth the effort especially since (as pointed out by MushroomHead) late binding DLLs isn't the best/fastest way to do it. And I think the current compiler setup doesn't allow early binding.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 6th Sep 2003 14:11
^ I think this has just proved my earlier point. It isn't a case of Lee checking a few boxes in VC++ or using a different LoadDLL command.

CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Sep 2003 16:42
you guys do realize that an ocx and a dll are two different things, right?

-RUST-
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 6th Sep 2003 17:43 Edited at: 6th Sep 2003 17:44
huh? Basically they're both PE files- just like Win32 executables.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
Drac X
22
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 10th Sep 2003 08:57
However hard it would be, it wouldn't be as hard a digging a ditch. It would be an excellent addition to dark basic. I mean, we can listen to c programmers talk trash about whatever language they feel is inferior to their own all day. But a lot of people code in vb. A lot of people who use db are using it because they don't want to learn c. There are certainly alternatives to db if you know c++. And some of them are free.

It's gettin' funny listening to the bashers now. VB has gotten so good that the only thing left to complain(?) about is the fact that it's a microsoft product.

Drac - X
_________________
Excerpt from 'A Day in the Life of Some Guy' ©2003
MicroMan
22
Years of Service
User Offline
Joined: 19th Aug 2003
Location: Stockholm, Sweden
Posted: 10th Sep 2003 10:47
I agree with Dark X. I don't by any stretch of my imagination imagine myself to be anything else than a hobbyist when it comes to programming. My interest isn't coding per se, but what you can do with it.

The goal with programming is to make 3d art, one might say. I don't care what lets me do that. The easier it is, the better. I don't really _want_ to know C/C++/C# or whatever. I do know C++, but I'm in no way experienced in WinAPI programming, or that kind of thing.

VB does give me a nice shell for me to do my little tools and stuff. Now DB takes me a good step closer to be able to to the artwork I want to make. I.e. the games. That's all I, and I suppose many people with me, ask.

-----
They SAID that given enough time a million monkeys with typewriters could recreate the collected works of William Shakespeare... Internet sure proved them wrong.
-----
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 10th Sep 2003 14:23
But you don't need to use C, C++ or Pascal to make DLLs for DBpro.
There is PowerBasic and there is PureBasic. Both of them are able to create standard DLLs.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"

Login to post a reply

Server time is: 2026-07-25 08:12:33
Your offset time is: 2026-07-25 08:12:33