Hi,
Iwant to make a function whose paraments are MFC. I want know how to how to make the function become a dll.
Thank you very much for anyone helps me.
Ps. English is my second language, so please explain easier, thank you!
Yang

The code of the function is below.
BYTE* Comm1(int iIndex,CMSComm mscomm,CListBox list)
{
int iLen;
int i;
BYTE *BReceive;
//!! BYTE BInstr[iIndex][] is the instruct;

//get the length of the instruction
iLen=sizeof(BInstr[iIndex]);

//@CInspect is used for inspect
CString CInspect;

//use a CByteArray to send BYTE to Variant
CByteArray Array;
//clean array
Array.RemoveAll();
//set the size of it
Array.SetSize(iLen);


//@output them on list2
CInspect.Format("%x,%x,%x,%x",BInstr[iIndex][0],BInstr[iIndex][1],BInstr[iIndex][2],BInstr[iIndex][3]);
list.AddString(CInspect);

//send BYTE to Array
for (i=0;i<iLen;i++)
{
Array.SetAt(i,BInstr[iIndex][i]);
}

//Send Message
m_mscomm.SetOutput(COleVariant(Array));
//Get information
Vdata=m_mscomm.GetInput();
//change Variant to byte
BReceive=(BYTE*)(unsigned char*)Vdata.parray->pvData;
//@output them on list2
CInspect.Format("%x,%x,%x,%x",BReceive[0],BReceive[1],BReceive[2],BReceive[3]);
list.AddString(CInspect);

return BReceive;

}







想 要 一 个 快 n 倍 的 免 费 邮 箱 吗 ?
126 专 业 电 子 邮 局 ―― 全 球 领 先 的 中 文 邮 箱 服 商 带 你 进 入 极 速 之 旅
_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to