Colin Smith
September 2nd, 1999, 11:55 AM
I am attempting to locate a control on a dialog window via it's ID name.
The difficulty is caused by the fact that the name is being generated
using the following function:
/*
* Get current component : returns a pointer to the image on the
* setup map currently being processed
*/
CStatic* CqcExpSetup::GetCurrentComponent(int x, int y)
{
char ControlName[10];
sprintf(ControlName, "IDC_SM%02d%02d", x, y);
return (CStatic*) ------------(ControlName);
} /^\
|
I can't find a function to do the job of the blanked out section. I have
tried GetDlgItem(nID), however this is expecting the int value for the
control. I need a function that takes the 10 character string calculated
from the x and y co-ordinates, finds a (CStatic) control of the same name
and returns it's id number for the GetDlgItem() function call.
Either that, or I need a function that can find the CStatic control with
the calculated name, and return a pointer to it.
Thanks for any assistance.
Colin Smith
The difficulty is caused by the fact that the name is being generated
using the following function:
/*
* Get current component : returns a pointer to the image on the
* setup map currently being processed
*/
CStatic* CqcExpSetup::GetCurrentComponent(int x, int y)
{
char ControlName[10];
sprintf(ControlName, "IDC_SM%02d%02d", x, y);
return (CStatic*) ------------(ControlName);
} /^\
|
I can't find a function to do the job of the blanked out section. I have
tried GetDlgItem(nID), however this is expecting the int value for the
control. I need a function that takes the 10 character string calculated
from the x and y co-ordinates, finds a (CStatic) control of the same name
and returns it's id number for the GetDlgItem() function call.
Either that, or I need a function that can find the CStatic control with
the calculated name, and return a pointer to it.
Thanks for any assistance.
Colin Smith