View Full Version : creating (activex) dll in Visual Basic 6 and then call it from ThinBasic
Does somebody has experience with creating a simple .dll in VB6? I never done this before. I'm trying to make a simple DLL for 3 days now and call it in ThinBasic (with declare) but no succes. I think I do something wrong with creating the dll.
Would be great if somebody can tell me step by step how to do this. Ofcourse I googled on this but still it doesn't work correctly :(
ErosOlmi
12-06-2009, 10:39
Martin,
thinBasic can use any standard WIN32 dlls.
But I'm not sure if VB6 can create standard WIN32 dlls.
Instead it creates ActiveX dll that are something completely different and thinBasic is not able to use them.
Check this page, maybe it can help: http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html?page=1
To create standard DLLs I suggest to use languages like C, PowerBasic, FreeBasic or other languages able o work with standard DLLs.
Ciao
Eros
Hello Eros,
Ah i see! I am glad that you're telling me that I am wasting my time with VB.
In that case I will keep my other (slower) solution: using os_shell that runs an .exe (with parameters from commandline)
ErosOlmi
12-06-2009, 11:26
Martin,
if you can tell more about what your dll need to do, I will be happy to try to help. I can create a base DLL using FreeBasic and post here source code so you can go on with it. Of course if you like the idea.
The above also considering that if you create EXE or DLL in VB6 and distribute them, you should also be sure that your users have VB runtime installed in their computer otherwise they will not be able to use you programs (EXE and/or DLL).
Ciao
Eros
ErosOlmi
12-06-2009, 11:32
This is a possible official url where to find VB6 runtime: http://support.microsoft.com/kb/290887
Hi Eros,
Thanks for your offer! Ofcourse I'll take it :) (i HATE vb runtime files). But maybe this is also something you could directly build into the module TBASS. What I need is a function that can calculate the BPM of a song. In thinbasic there's already TBASS. But for calculating tempo (Beats Per Minute) you'll need the BASS_FX library.
I already made an EXE with VB that can do the job. But each time when I run this exe with OS_SHELL in ThinBasic the script slow down because it have to load the exe into memory (i guess). Or maybe I should use %OS_SHELL_ASYNC. But not sure how I should change my script then.
Greetings,
Martin
ErosOlmi
12-06-2009, 11:51
Ok, I see.
If you need to calculate BPM very often during the game, shelling an EXE is absolutely not the way to go.
Yes, I can try to make BPM in TBASS. If you can give me some info on how to do or some few lines of code, it would simplify my job. In any case I will have a look.
We can also create a wrapper thinBasic native module for FMOD library, I saw you use it in your games.
I will let you know. I think I will have some spare time during the weekend.
Ciao
Eros
Cool!! I will send you a private email with more information and also my unfinished script.
ps: I never made any game so I think you're confused with someone else. I also find FMOD a little bit complicated. BASS is easier to learn
ErosOlmi
12-06-2009, 12:08
I never made any game so I think you're confused with someone else.
:oops: sorry, you are right. I was confusing with another user.
Yes, send me a mail to:
support at thinbasic dot com
and I will have a look in the weekend
ErosOlmi
12-06-2009, 13:01
Mail got thanks.
I will let you know.
ErosOlmi
13-06-2009, 19:59
I started to have a look at BASS_FX and a bit of coding optimization in TBASS module.
I think in the next thinBasic version I will be able to to remove BASS.DLL dependency.
Library will be stored as a resource and loaded from memory.
Petr Schreiber
13-06-2009, 21:37
Smart idea with embedding it to resource!
great! the possibilities with sound will be endless then :lol: :lol: :music: