Sorry Last Post very Muddled.
So made a small Pocket pc App
Selected simple program
Declared a struct immediately below globals
struct
{
wchar_t Location[40];
wchar_t Usize[30];
wchar_t MakeUp[20];
wchar_t GlassPattern[40];
wchar_t GlassType[25];
wchar_t SpacerColor[20];
wchar_t Coating[30];
wchar_t GlassEffects[60];
}unitsentered[10], emptyunitstruct,unit,defaultunitpart;
// Created this editbox in WM_CREATE and added IDC_TESTSTRUCT_EDITBOX to .h file
// CREATE AN EDIT BOX FOR LISTVIEW
HWND hEdit;
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"",
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_NOHIDESEL | ES_MULTILINE |
ES_READONLY,
5,
5,
200,
200, hwnd, (HMENU)IDC_TESTSTRUCT_EDITBOX, GetModuleHandle(NULL), NULL);
if(hEdit == NULL)
MessageBox(hwnd, L"Could not create edit box.", L"Error", MB_OK | MB_ICONERROR);
return TRUE;
//added 1 menu item Testruct and placed an instruction in WM_COMMAND to run
// FillStruct(hwnd) on menu selection
this results in that if either line 100 or 101 are left to compile
compiles ok but line 102 will not action
on the other hand if they are left out line 102 works???
see line nos below
static void FillStruct( HWND hwnd)
{
wcscpy (unit.Location,L"Bed 1");
wcscpy (unit.Usize ,L"111 x 222");
wcscpy (unit.MakeUp,L"4/16/4");
wcscpy (unit.GlassPattern,L"Cotswold");
wcscpy (unit.GlassType,L"Silver");
wcscpy (unit.Coating,L"Not Low E");
wcscpy (unit.GlassEffects,L"Georgian Fret");
wchar_t unitstring[150];
wcscpy (unitstring,L""); // set unitstring to null
swprintf(unitstring,L"%s\r\n%s \t %s\r\n%s\t%s\r\n%s\t%s\r\n%s\r\n __________________ \r\n",
unit.Location,
unit.Usize,unit.MakeUp,unit.GlassPattern,unit.GlassType,unit.SpacerColor,unit.Coating,unit.GlassE
ffects);
line 100
//memcpy(&unitsentered[1],&unit,sizeof(unitsentered[1])); // unitsentered[g_unitcount]=unit;
line 101 //unitsentered[1]=unit;
line 102 SetDlgItemText(hwnd, IDC_TESTSTRUCT_EDITBOX, unitstring);
}
Is it me or can i not assign structs in this fashion on a pocket pc
Big thanks for looking any help would be appreciated
gromit.