Igor and Victor:

I copied Igor's code to V6.0 compiler in a Console "Hello world app" which doesn't supply mfc support for CString so I added "#include <afx.h>" to the stdafx.h file.

When I compiled Igor's program I got the following message:


error C2440: 'initializing' : cannot convert from 'const int' to 'struct print'
No constructor could take the source type, or constructor overload resolution was ambiguous
Here is code section of the program:


#include "stdafx.h"

#define COUNTOF(x) (sizeof(x)/sizeof(x[0]))

struct print
{
int x; //row
int y; //col
int fid;
CString sData;

char *chData;
};

CString temp("Address");

struct print form [] =
{
{ 30, 40, 1,CString("Name"), "N/A" },
{ 30, 42, 1, temp , "N/A" },
{ 30, 44, 1, temp, "N/A" },
{ 30, 50, 1, temp, "N/A" },

};


int main()
{
for (int idx = 0; idx < COUNTOF(form); idx++)
{
printf(TEXT("[%d] x:%d y:%d sData:%s chData:%s\n"),
idx, form[idx].x, form[idx].y, form[idx].sData, form[idx].chData);
}
return 0;
}