Karl Blessing
Programmer
I am trying to figure out how to pass out a Byte Array to visual basic I know the contructor for a COleVariant can take a byte array but it doesnt seem to be working and I dont know how to look at the debug information to see if it has received the information into it, this is the following sample code I am using.<br><br>VARIANT CSaFXCtrl::ByteS() <br>{<br> VARIANT vaResult;<br> VariantInit(&vaResult);<br> char s[15];<br> for ( int j=0; j<13; j++)<br> s[j] = 'A';<br> s[13] = 'B';<br> s[14] = '\0';<br><br> CByteArray MyB;<br> for (int i=0; i<15; i++)<br> MyB.Add((byte)s<i>);<br><br> COleVariant newV(MyB);<br> newV.ChangeType(VT_ARRAY ¦ VT_UI1);<br> VariantCopy(&vaResult, &newV);<br> return vaResult;<br>}<br><br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)