N
Norm Cook
Hope there are some mixed language programmers here. Trying to write a c++
dll for my VB6 program. To help me with my understanding, I just want to
pass it
a VB long (c++ int) & have it return that number of characters as a string,
any character. I know about the def file, using stdcall etc. I envision it
as
something like
LPCSTR _stdcall ReturnAString(int NumChars)
but not sure about LPCSTR
and the VB Declare would be something like
Private Declare Function ReturnAString Lib "MyDLL" (ByVal NumChars As Long)
As String
In VB,
Dim A As String
A = ReturnAString(10) & get A = "AAAAAAAAAA"
I suspect the c++ function has to allocate the string with one of
the SysAlloc family of calls. Any ideas?
dll for my VB6 program. To help me with my understanding, I just want to
pass it
a VB long (c++ int) & have it return that number of characters as a string,
any character. I know about the def file, using stdcall etc. I envision it
as
something like
LPCSTR _stdcall ReturnAString(int NumChars)
but not sure about LPCSTR
and the VB Declare would be something like
Private Declare Function ReturnAString Lib "MyDLL" (ByVal NumChars As Long)
As String
In VB,
Dim A As String
A = ReturnAString(10) & get A = "AAAAAAAAAA"
I suspect the c++ function has to allocate the string with one of
the SysAlloc family of calls. Any ideas?