请教高手:为什么dll里面的值传不到主程序?在线等待.急!!!!!!!!!!
casio 2003-03-13 05:25:27 我是初学者,请教高手:
明明下面dll函数中的char * cc值发生了变化,为什么vb调用函数部分[ Call RSWR(1, st) ]中的st却没有任何改动?我究竟错在哪里?
跟贴有分。多谢解惑。
/////////////////////////////////////////////////////
dll函数:
extern "C" short APIENTRY RSWR(int num,char *cc) //Read
{
cc=m_ComPort[num].ReadComm();
AfxMessageBox(cc); //此处cc的值已经发生了改动
}
/////////////////////////////////////////////////////////
VB声明:
Declare Function RSWR Lib "magcard.dll" (ByVal i As Integer, ByRef str As String) As Integer
///////////////////////////////////////////////////////////
VB调用函数:
Private Sub Command2_Click()
Dim st As String
Call RSWR(1, st) 'read
MsgBox st //为何这里st的值没有任何改动?
End Sub
我究竟错在那里?