Writing a String to the serial Port is no problem.
I typed:
COleVariant vTest;
vTest = "Testoutput";
m_MSComm.SetOutput(vTest);
It worked!
But then I wanted to write a Byte to the serial Port:
COleVariant vTest2;
vTest2 = 0x05;
m_MSComm.SetOutput(vTest2);
I got a Compiler-Error;
Operator = is ambiguous (Operator = ist mehrdeutig).
I tried to use a cast operator:
COleVariant vTest3;
vTest3 = (BYTE) 0x05;
m_MSComm.SetOutput(vTest3);
There is no compiler-error.
But at Runtime i got the Message from
MSComm "wrong Propertyvalue"
(falscher Eigenschaftswert);
I have also tried to use the original VARIANT
Datatype, but without positive result.
VARIANT vTest4;
vTest4.vt = VT_UI1;
vTest4.bVal = 0x05;
m_MSComm.SetOutput(vTest4);
I got the same Runtime Error as the one
with vTest3.
Is there someone who can help me please?
It looks like you're new here. If you want to get involved, click one of these buttons!