|
-
Apr 24th, 2002, 05:21 AM
#1
Thread Starter
Junior Member
converting VARIANT to ...
I need to know how to get a VARIANT data type into something more useful like a char array or a CString. I have tried the following.
void CTestmodulesDlg::OnCheckResponseOK(VARIANT FAR* Response)
{
COleVariant MyVar;
char mc [10];
CString MyCStr;
MyVar.Attach (*Response);
mc [0] = *MyVar.pbVal;
mc [1] = *(MyVar.pbVal+1);
mc [2] = *(MyVar.pbVal+2);
mc [3] = *(MyVar.pbVal+3);
mc [4] = *(MyVar.pbVal+4);
mc [5] = 0;
MyCStr = MyVar.pbVal;
}
But looking at the mc array and the CString it seems that each element has a terminating 0 after it. For example if Response is "Hello" then it is stored as 'H',0,'e',0,'l',0,'l',0,'o',0.
Any suggestions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|