PDA

View Full Version : Call DLL Function (STRING return value)



Gwo Tang
07-17-2015, 06:17 PM
Declare Function CharUpper Lib "user32" Alias "CharUpperA" (ByVal lpsz As String) As String

How do I get this return value?

Because %_SB_RETURN% only return DWORD return value.

linder
07-18-2015, 03:47 AM
Hello,

Please see the attached screenshot. It converts a character string or a single character to uppercase.

Friedrich

Gwo Tang
07-23-2015, 05:53 PM
Hello,

Common.dll (It only provides a UserName function.)

Declare Function UserName Lib "Common.dll" (ByVal sUserName As String) As String

Use VB6,

Sub Main()

MsgBox UserName("Jeff")

End Sub

3860

Use SetupBuilder,

3861

How do I get this return value?

TestDll src.zip :

https://www.dropbox.com/s/yf041j66l4xyhb2/TestDll%20src.zip?dl=0

linder
07-24-2015, 03:09 AM
Hello,

I tried to call your DLL from a simple Visual C application and it caused a stack corruption immediately. Then I tried it from another language (Clarion) and it also crashed.

And even Windows Rundll32 results in an exception (see attached screenshot, XP and Win7, also tested on Win81 and Win10, same results).

Friedrich