Dll calling conventions

Deadman (jaguyer@nospam.socs.uts.edu.au)
Sat, 25 May 1996 23:23:17 +1000 (EST)

I'd appreciate any1 with some knowledge of calling c dll's from vb if
possible....
I have a dll compiled with no probs containing, among other things, a
function declared as:

LPSTR _export GetString(LPSTR Append)

and then i try to call this from vb, declareing it as:

Declare Function GetString Lib "F:\PROG\BCC\Win95\TestDLL\mydll.dll"
Alias "_GetString" (ByVal Append As String) As String

Calling it with:

Dim Extra as String
Extra="Append this bit"
Dummy = MsgBox(GetString(Extra))

Unfortunately, i get a 'bad dll calling convention every time i try to
run it. It works nicely if i do it without declaring or passing the
Append arg, it just falls down when i try to pass arguments.

Any ideas?

__________________________________________________
|================================================| ---
I---, |-=| Jon Guyer |=@nospam.=| jaguyer@nospam.socs.uts.edu.au |=-|
-----U ==| |================================================| ---
| :) U ==| | "Lo, thy dread empire Chaos is restor'd" | ---
-----'----U | |________________________________________________| ---
|)___() 'U |______====____ \________________________________| -----
[_/,-,\"--"----- // ,-, ,-,\\\ |/ //,-, ,-, ,-,\\ __# ---
( 0 )====#####// ( 0 )( 0 )''- o '( 0 )( 0 )( 0 )''
-----'-'--------------'-'--'-'-------------------'-'--'-'--'-'--------------