Pb with VC7 with CString and VARIANT... 
Author Message
 Pb with VC7 with CString and VARIANT...

Hi !
I have a problem with VC7 projects with this code :

void Cxxx::Method(COleVariant v)
{
    ASSERT(v.vt == VT_BSTR);
    CString str = v.bstrVal;

Quote:
}

This code is compiled by VC7 on converted VC6 projects, but not on new VC7
projects !
I think it's a project settings, but I can't find the differences between
the 2 projects settings...
Now, I must type :
    CString str = CString(v.bstrVal);

Any explanations ?
Thanks

--
Emmanuel Derriey
WinLog SA : http://www.*-*-*.com/



Sat, 02 Jul 2005 19:21:53 GMT  
 Pb with VC7 with CString and VARIANT...
Hi !
I found ! It's the new '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS' define in
stdafx.h which causes my troubles !!!
After removing this define, everything works like before.

--
Emmanuel Derriey
WinLog SA : http://www.winlog.com



Quote:
> Hi !
> I have a problem with VC7 projects with this code :

> void Cxxx::Method(COleVariant v)
> {
>     ASSERT(v.vt == VT_BSTR);
>     CString str = v.bstrVal;
> }

> This code is compiled by VC7 on converted VC6 projects, but not on new VC7
> projects !
> I think it's a project settings, but I can't find the differences between
> the 2 projects settings...
> Now, I must type :
>     CString str = CString(v.bstrVal);

> Any explanations ?
> Thanks

> --
> Emmanuel Derriey
> WinLog SA : http://www.winlog.com



Sat, 02 Jul 2005 19:38:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ENORMOUS Pb with VC7 linker optimisation !

2. VARIANT'S parray points to junk value when build in VC7.0

3. ASSERT in CString::Mid() when porting from VC6 to VC7

4. access violation due to bad CString copy ctor when porting from VC6 to VC7 (VC++.NET)

5. vc7 CString.Replace will not compile (error: C2466)

6. dllimport CString problem from VC7 to VC6

7. ASSERT in CString::Mid() when porting from VC6 to VC7

8. how to convert a CString into a VARIANT ??

9. CString to Variant

10. Conversion problem between Variant with Datetime from Database an d CString

11. Howto: CString into const VARIANT&

12. variant to cstring

 

 
Powered by phpBB® Forum Software