Quote Originally Posted by ADSOFT View Post
Code:
struct print
    {
    int  x; //row
    int  y; //col
    int  fid;
    CString *data;
    char *format;
    };

   struct print form [] =
   {
	   { 30, 40, 1,"Name", "N/A" },
	   { 30, 42, 1,"Address", "N/A" },
	   { 30, 44, 1,"City State, Zipcode", "N/A" },
	   { 30, 50, 1,"Vehicle", "N/A" },
    };
The struct keyword is not necessary in C++ to define a variable of type 'print'.
What you are trying to do here is to convert a const char[] to a CString*. That's not possible, because these are unrelated types. A CString* must point to a CString. In your code you did not instantiate CString, so there is nothing to point to.
Quote Originally Posted by ADSOFT View Post
tried CSting data and that also doesn't work,
If I compile that, I get an error like
Code:
error C2440: 'initializing' : cannot convert from 'const char [5]' to 'CString'
        Constructor for class 'ATL::CStringT<BaseType,StringTraits>' is declared 'explicit'
That's pretty self-explanatory. The CString constructor that takes a const char* is declared explicit, so you cannot implicitly convert from a const char* to a CString. You need to explicitly create a CString in your initialization.
Code:
print form = { 30, 40, 1, CString("Name"), "N/A" };
Note that if you have a unicode build, you need to pass CString a const wchar_t*, which you can do by prefixing the string literal with L. I.e.
Code:
print form = { 30, 40, 1, CString(L"Name"), "N/A" };
If you need to support both unicode and MBCS builds, you can wrap the string literal with the _T() macro.