Below is a snippet from the VCTerm example for VC++.
How can I get null characters into a variant and to transmit out the comm port using this control (example char* Test = "Te\0st\0Te\0st1"
. I need to be able to do this for a special application interface to DDC controllers. It is really easy with VB but has proven next to impossible with VC++. Can anyone offer a helping hand and possibly an example?
CString ch(nChar);
VARIANT var;
char* Test = "Te\0st\0Te\0st1";
CCommCtrl* pCommCtrl = ((CMainFrame*)
AfxGetMainWnd ())->GetCommCtrl();
if (pCommCtrl->GetPortOpen())
{
var.vt = VT_BSTR;
var.bstrVal = ch.AllocSysString();
pCommCtrl->SetOutput(var);
VariantClear(&var);
Thanks,
Greg K.
York International Corp
How can I get null characters into a variant and to transmit out the comm port using this control (example char* Test = "Te\0st\0Te\0st1"
CString ch(nChar);
VARIANT var;
char* Test = "Te\0st\0Te\0st1";
CCommCtrl* pCommCtrl = ((CMainFrame*)
AfxGetMainWnd ())->GetCommCtrl();
if (pCommCtrl->GetPortOpen())
{
var.vt = VT_BSTR;
var.bstrVal = ch.AllocSysString();
pCommCtrl->SetOutput(var);
VariantClear(&var);
Thanks,
Greg K.
York International Corp