| View previous topic :: View next topic |
| Author |
Message |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Thu Aug 13, 2009 3:25 pm Post subject: API returning a pointer |
|
|
Hi
I've found a 3rd party MIDI API which might do everything I need? The only trouble is some of the functions return pointers to strings of info I need. I've got the function to work but how do I dereference the pointer in VDS?
Here's an example of one of the function I've got working...
| Code: |
LPCSTR MidiGetDeviceName(bool b_midiIn, DWORD dw_deviceNum); |
I get an integer which must point to the string containing the device name, how do I get to the string?
Thanks
David... |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Aug 13, 2009 3:32 pm Post subject: |
|
|
David,
Have you tried this.
| Code: |
%A = @lib(mididllname,MidiGetDeviceName,STR:,BOOL:%%b_midiIn,INT:%%dw_deviceNum)
|
In the future if you could send a VDS example/attempt it would help. At the very least the name of the DLL your using. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Thu Aug 13, 2009 9:27 pm Post subject: |
|
|
Thanks, your the man! Worked first time. The function names are a bit strange as they are "decorated". I have no idea what that means but I used http://www.dependencywalker.com/ to find the real function names.
Here's the test code
| Code: |
loadlib e:\midictrl\midictrl.dll
%a = @lib(midictrl.dll,@chr(63)MidiGetNumDevices@chr(64)@chr(64)YAK@chr(95)N@chr(64)Z,INT:,BOOL:TRUE)
%b = @lib(midictrl.dll,@chr(63)MidiGetDeviceName@chr(64)@chr(64)YAPBD@chr(95)NK@chr(64)Z,STR:,BOOL:TRUE,INT:0)
freelib e:\midictrl\midictrl.dll
exit
|
Thanks
David..
P.S. Did you ever write "The art of API programming with VDS 5". I would like to read it if you did. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|