PaulWilson
Technical User
How would I go about retrieving the text for and edit box in dialog 2 when the box is on dialog 1?
I've tried everything I can think of but nothing works. The edit box is called m_edit1_dlg1 and is "public" but I can't figure out how to access the text at all
This led me to use the registry but I'm having problems there too. All the form values (I have several edit boxes) are being correctly inserted into the registry but when retrieving them to fill up the form after clicking a button, a few fields never fill....the missing fields vary from time to time. I thought it was a problem with buffering but I'm new to this and really have no idea...this is a code sample to retrieve from the registry:
HKEY key;
DWORD size, type;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,APPLICATION_KEY,0,KEY_QUERY_VALUE,&key) == ERROR_SUCCESS)
{
// Read
size = 128;
type = REG_SZ;
// Field 1
LPCSTR psz1 = m_edit1_dlg1.GetBuffer(size);
RegQueryValueEx(key, "CGI Path", 0, &type, (LPBYTE)psz1, &size);
m_edit1_dlg1.ReleaseBuffer();
// Loads more retrievals like above.
}
Then I use:
GetDlgItem( FIELD_NAME )->SetWindowText(m_field_dlg);
....where m_field_dlg is obviously the correct field.
Thanks for any help anyone can give.
I've tried everything I can think of but nothing works. The edit box is called m_edit1_dlg1 and is "public" but I can't figure out how to access the text at all
This led me to use the registry but I'm having problems there too. All the form values (I have several edit boxes) are being correctly inserted into the registry but when retrieving them to fill up the form after clicking a button, a few fields never fill....the missing fields vary from time to time. I thought it was a problem with buffering but I'm new to this and really have no idea...this is a code sample to retrieve from the registry:
HKEY key;
DWORD size, type;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,APPLICATION_KEY,0,KEY_QUERY_VALUE,&key) == ERROR_SUCCESS)
{
// Read
size = 128;
type = REG_SZ;
// Field 1
LPCSTR psz1 = m_edit1_dlg1.GetBuffer(size);
RegQueryValueEx(key, "CGI Path", 0, &type, (LPBYTE)psz1, &size);
m_edit1_dlg1.ReleaseBuffer();
// Loads more retrievals like above.
}
Then I use:
GetDlgItem( FIELD_NAME )->SetWindowText(m_field_dlg);
....where m_field_dlg is obviously the correct field.
Thanks for any help anyone can give.