Click here to Skip to main content
15,868,016 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: _variant_t to CString Pin
Stuart Dootson15-Sep-09 2:43
professionalStuart Dootson15-Sep-09 2:43 
GeneralRe: _variant_t to CString Pin
rdop15-Sep-09 0:33
rdop15-Sep-09 0:33 
QuestionRe: _variant_t to CString Pin
CPallini15-Sep-09 2:08
mveCPallini15-Sep-09 2:08 
AnswerRe: _variant_t to CString Pin
Stuart Dootson15-Sep-09 0:28
professionalStuart Dootson15-Sep-09 0:28 
GeneralRe: _variant_t to CString Pin
rdop15-Sep-09 1:09
rdop15-Sep-09 1:09 
GeneralRe: _variant_t to CString Pin
Stuart Dootson15-Sep-09 1:53
professionalStuart Dootson15-Sep-09 1:53 
GeneralRe: _variant_t to CString Pin
rdop15-Sep-09 2:07
rdop15-Sep-09 2:07 
GeneralRe: _variant_t to CString Pin
Stuart Dootson15-Sep-09 2:27
professionalStuart Dootson15-Sep-09 2:27 
As it's an array, VariantChangeType's not going to work. So, I'd suggest the code below.

I'm assuming you want to access the non-null characters of the array and make them into a string?

CComSafeArray<char, VT_UI1> sa(V_ARRAY(&v));
CString s;
for(int index=sa.GetLowerBound();index<=sa.GetUpperBound()&&sa[index];++index)
{
   s+=sa[index];
}


[edit] You'll also need to #include atlsafe.h and oleauto.h [/edit]

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: _variant_t to CString Pin
Randor 15-Sep-09 3:50
professional Randor 15-Sep-09 3:50 
GeneralRe: _variant_t to CString Pin
Stuart Dootson15-Sep-09 4:44
professionalStuart Dootson15-Sep-09 4:44 
GeneralRe: _variant_t to CString Pin
rdop15-Sep-09 18:07
rdop15-Sep-09 18:07 
AnswerRe: _variant_t to CString Pin
Randor 15-Sep-09 1:23
professional Randor 15-Sep-09 1:23 
Questionfwstsrv.obj : error LNK2019: unresolved external symbol "public: int Pin
Vetukuri Raju14-Sep-09 23:48
Vetukuri Raju14-Sep-09 23:48 
AnswerRe: fwstsrv.obj : error LNK2019: unresolved external symbol "public: int Pin
Stuart Dootson15-Sep-09 0:33
professionalStuart Dootson15-Sep-09 0:33 
GeneralRe: fwstsrv.obj : error LNK2019: unresolved external symbol "public: int [modified] Pin
Vetukuri Raju15-Sep-09 0:58
Vetukuri Raju15-Sep-09 0:58 
GeneralRe: fwstsrv.obj : error LNK2019: unresolved external symbol "public: int Pin
Stuart Dootson15-Sep-09 1:07
professionalStuart Dootson15-Sep-09 1:07 
GeneralRe: fwstsrv.obj : error LNK2019: unresolved external symbol "public: int Pin
Vetukuri Raju15-Sep-09 1:30
Vetukuri Raju15-Sep-09 1:30 
QuestionBasic Question : Displaying Alphabets Pin
UKM_Student14-Sep-09 23:39
UKM_Student14-Sep-09 23:39 
AnswerRe: Basic Question : Displaying Alphabets Pin
CPallini15-Sep-09 0:02
mveCPallini15-Sep-09 0:02 
GeneralRe: Basic Question : Displaying Alphabets Pin
UKM_Student15-Sep-09 0:13
UKM_Student15-Sep-09 0:13 
GeneralRe: Basic Question : Displaying Alphabets Pin
CPallini15-Sep-09 0:26
mveCPallini15-Sep-09 0:26 
GeneralRe: Basic Question : Displaying Alphabets Pin
UKM_Student15-Sep-09 0:32
UKM_Student15-Sep-09 0:32 
QuestionRe: Basic Question : Displaying Alphabets Pin
David Crow15-Sep-09 2:47
David Crow15-Sep-09 2:47 
AnswerRe: Basic Question : Displaying Alphabets Pin
UKM_Student15-Sep-09 6:05
UKM_Student15-Sep-09 6:05 
QuestionRe: Basic Question : Displaying Alphabets Pin
David Crow15-Sep-09 6:19
David Crow15-Sep-09 6:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.