rakesh_mahajan
03-31-2006, 11:39 AM
I have created a win32 dll for pocket PC 2003.
I have written following function in the dll:
wchar_t* _stdcall testfunc (int i,int j,wchar_t* str)
{
int k = i;
k=j;
k=i+j;
wcscpy(str,_T("Some data"));
return str;
}
I am calling this dll from vb.net application
I am using following steps to call the function :
Public Declare Function testfunc Lib "test.dll" (ByVal a As
Integer, ByVal b As Integer, ByVal c As String) As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim bflag As Boolean
dim strret as string
databasefilename = "abc.txt"
strret = testfunc(2, 3, databasefilename)
End Sub
When i devbug my dll i am not able to get string value.
integer value is same what i am passing from function call.
What should be the problem?
I also tried using char* instead of wchar_t* but no luck.
I am stuck at this point.
Thanks,
Rakesh
I have written following function in the dll:
wchar_t* _stdcall testfunc (int i,int j,wchar_t* str)
{
int k = i;
k=j;
k=i+j;
wcscpy(str,_T("Some data"));
return str;
}
I am calling this dll from vb.net application
I am using following steps to call the function :
Public Declare Function testfunc Lib "test.dll" (ByVal a As
Integer, ByVal b As Integer, ByVal c As String) As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim bflag As Boolean
dim strret as string
databasefilename = "abc.txt"
strret = testfunc(2, 3, databasefilename)
End Sub
When i devbug my dll i am not able to get string value.
integer value is same what i am passing from function call.
What should be the problem?
I also tried using char* instead of wchar_t* but no luck.
I am stuck at this point.
Thanks,
Rakesh