F
floydus
Return a CString to VB and use it in VB...
I badly need to send text string from VC++(Take note that the type of
my variable is CString !), I'm so disappointed, I tried like 4-5
approches, nothing works !
Please help me before I put that computer into garbage, it's been 2
weeks without having found.
Here is my VC++ function.
I'm able to call it, but the best I got is the first character only...
Anyway..
Have a look.
I cannot change the type from CString to something else, I have to use
CString (Supplied Api...)
VC++
///////////////////////////////////////////////////////////////////////
Should *CString* be the returned type ???????
CString _stdcall SearchLast(int chn)
{
(strTmp2 declared as CString outside)
strTmp2="Nothing";
.......some other code here........
:xSearchStart( m_hServer, &SearchInfo );
AfxMessageBox(strTmp2);
return strTmp2;
}
VB CODE is below...
////////////////////////////////////////////////////////////////////////
Private Declare Function SearchLast Lib "PelcoDLL.dll" (ByVal Channel
As Integer) As String
Private Sub Command2_Click()
Dim i As String
i = SearchLast(0)
MsgBox i
End Sub
I badly need to send text string from VC++(Take note that the type of
my variable is CString !), I'm so disappointed, I tried like 4-5
approches, nothing works !
Please help me before I put that computer into garbage, it's been 2
weeks without having found.
Here is my VC++ function.
I'm able to call it, but the best I got is the first character only...
Anyway..
Have a look.
I cannot change the type from CString to something else, I have to use
CString (Supplied Api...)
VC++
///////////////////////////////////////////////////////////////////////
Should *CString* be the returned type ???????
CString _stdcall SearchLast(int chn)
{
(strTmp2 declared as CString outside)
strTmp2="Nothing";
.......some other code here........
:xSearchStart( m_hServer, &SearchInfo );
AfxMessageBox(strTmp2);
return strTmp2;
}
VB CODE is below...
////////////////////////////////////////////////////////////////////////
Private Declare Function SearchLast Lib "PelcoDLL.dll" (ByVal Channel
As Integer) As String
Private Sub Command2_Click()
Dim i As String
i = SearchLast(0)
MsgBox i
End Sub