If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Can't intialize C++ Struct with CString in it??

Originally Posted by ADSOFT

GCDEF,

No it doesn't work. did you try to compile it, or is this something you made up?

What does your compilier tell you?

My compiler told me your first two worked, but the second two it couldn't convert a CString* to a CString. When I removed the &, it compiled cleanly. You may want to dump the attitude. Sheesh. This compiled cleanly.

Re: Can't intialize C++ Struct with CString in it??

Originally Posted by ADSOFT

Compiler doesn't specifically state which var in the struct is the problem, but it seems to be the CString, tried different ways to intialize it, all of which are defined in the CString constructor definitions get same compiler error for each structure member.

This data("test") must be either explicit calling constructor data::data(char*), or calling function int data(char*) defined somewhere in the scope. The same thing happens to temp("TEST"). This is definitely not what you intended to do.

Re: Can't intialize C++ Struct with CString in it??

Igor and Victor,

It's starting to look like the compiler V6.0 , lol. Or maybe the constructor definitions of CString got updated.

The compiler error message seems to imply that there might be "Ambigous intialization" when attempting to initialize a struct in the V6.0 definition. I couldn't see on when I looked at the constructor defs: http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx maybe you guys can see it?

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.