bubbleT 0 Newbie Poster

Hi
currently working on a vb program to access a LPTSTR data in a VC coded function.
My vb program cannot get the string data
my sample code

Declare Function GetMainWork Lib "LibDWM.dll" (ByVal lpszWNo As String) As Long 

'I've tried
'Declare Function GetMainWork Lib "LibDWM.dll" (ByRef lpszWNo As String) As Long ->doesn't work

Private Sub cmdClick()
    Dim lret As Long
    Dim sdat As String
    Dim ss As String
    sdat = ""
    ss = StrPtr(sdat)
   
        'lret = GetMainWork(StrPtr(ss))->doesn't work

        lret = GetMainWork(sdat) 
...
End Sub

Some information on the VC function

int GetMainWork(LPTSTR lpszWNo);
int GetMainWork(LPTSTR lpszWNo)
{
	int retval = 0;
	...
	sprintf(lpszWNo, "%s",lpMemDat->wnam) ; 
	...

	return retval;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.