 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Daniel.Z Guest
|
Posted: Wed Jun 01, 2005 4:41 pm Post subject: How do I use MSComm32.ocx? |
|
|
Hi,
I am trying to use microsoft ActiveX Mscomm32.ocx to finish RS232
communication. I have a little problem by using OleVariant.
Here is my code,
OleVariant RxBuff;
char m_sInput[200];
RxBuff = MSComm->Input;
int num = RxBuff->ArrayHighBound(1); // invalid argument
for(int i=0; i < num; i++)
m_sInput[i] = RxBuff.GetElement(i); // invalid argument
it always tells me "invalid argument" at running time.
Can anyone help me out?
Thanks
|
|
| Back to top |
|
 |
Daniel.Z Guest
|
Posted: Wed Jun 01, 2005 5:54 pm Post subject: Re: How do I use MSComm32.ocx? I should ask how to convert O |
|
|
Daniel.Z wrote:
| Quote: | Hi,
I am trying to use microsoft ActiveX Mscomm32.ocx to finish RS232
communication. I have a little problem by using OleVariant.
Here is my code,
OleVariant RxBuff;
char m_sInput[200];
RxBuff = MSComm->Input;
int num = RxBuff->ArrayHighBound(1); // invalid argument
for(int i=0; i < num; i++)
m_sInput[i] = RxBuff.GetElement(i); // invalid argument
it always tells me "invalid argument" at running time.
Can anyone help me out?
Thanks
|
I already received data, because MSComm->InBufferCount > 0.
Now I just need to convert RxBuff to AnsiString or BSTR.
Thx
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|