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 / DLL tutorials

Author
Message
NoteJam
19
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 19th Apr 2005 02:39
I am a beginner at dll calls in dark basic pro.
If you know of any tutorials on how to make dll calls, please post where they are at or email me at notejam@aol.com

The dll that I want to use is winmm.dll I am having trouble on getting varible types set correctly, and or how does one make the call.

The command of interest to me is midiOutShortMsg, as this command will allow a user to play the musical instruments that are present on almost all sound cards.
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 24th Apr 2005 12:57


also use
variable as word
variable as dword
ect ect

also i have a midi dll with stringtables in process if u want it(free/opensource also)

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
NoteJam
19
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 25th Apr 2005 14:35
Yes,
I would love to have it.
Where is it at?
I know the winmm dll uses 4 bytes for each varible, and the first 4 bytes varible has a handle to the the dll, then theres a string in there, and a port, and un used byte.

Thats kind of what has me confused. I am left wondering how I get one bye of a varible to be a string and another to be a number.

the others used unsigned long, which I guess in darkbasic is long long?

Saw that I think in the help file of darkbasic, on dll or varible types.


Can you also send me darkbasic code on how to call this dll and do the command?

Thanks much!
NoteJam
19
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 26th Apr 2005 02:57
Ok here is my code I am trying so far.
The dll call exists and returns 1 for both loading the dll and calling the dll so thats working.
My type command is failing to define the varibles as long.
I am also failing to get any pointer returned in A$ (I think, since it is zero)
I need to get a pointer, and then the next dll call with midiOutShortMsg will do the note on/note off message.

How do I declare the types of varibles? If I use A$ as ptr,b as long etc., in the dll call I get an error message.

please re-write my code and get this part working and then I think i can solve the rest of it.
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 26th Apr 2005 05:36 Edited at: 26th Apr 2005 05:38
Instead of using a string, it'd be easier to use DBpro's MAKE MEMORY() function.
Example:



Play Nice! Play Basic! Version 1.06
NoteJam
19
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 26th Apr 2005 14:22
Thanks much,
Do not know your name, user I guess.

It works, so I am very happy right now. Just got to figure out how to do some more things with it.

Here is how my code reads now. Scroll down and to right and click this messages button to view attached code.

Now I need to know how to do something like this:

Dim A(6)
A(0)=60
A(1)=30
A(2)=15

R=rnd(3)
Rythem=A(R)

and then at my wait 60 statement, have it be wait rythem

How do I set up these list elements in dark basic pro?
Its arrays seem quite strange compared to basics I have used.

Now try my windchime midi dark basic program
NoteJam
19
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 26th Apr 2005 17:33
Never mind, I have made a dumb newbie mistake. Think I must of had a typo in my varible name and did not catch it or something. This array list method works ok, so please excuse my last dumb question.

And much thanks for your help.
empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 26th Apr 2005 18:17
Quote: "Do not know your name, user I guess."

Well it says that my forum name "empty". That's my handle since many years.


Play Nice! Play Basic! Version 1.06

Login to post a reply

Server time is: 2024-04-23 09:33:46
Your offset time is: 2024-04-23 09:33:46