raqadi
asked on
Naming the control in varient Environment....
Hi,
i have developed a new ActiveX control, the control name is MyButtonCtrl, so when i open VB and add a new instance of my control its name will be (MyButton1), and its caption will be (MyButton1) also, but when i use my control in VC++ environment, the control ID will be (IDC_01) and its caption is (01).
so how i can make the control caption (MyButton1) or (MyButton01) in VC++ environment ??
i have developed a new ActiveX control, the control name is MyButtonCtrl, so when i open VB and add a new instance of my control its name will be (MyButton1), and its caption will be (MyButton1) also, but when i use my control in VC++ environment, the control ID will be (IDC_01) and its caption is (01).
so how i can make the control caption (MyButton1) or (MyButton01) in VC++ environment ??
How did you create the control?
When I use the VC++ ATL COM AppWizard to create an ActiveX control, then when I insert it into a dialogbox, it will be given a default ID that is based upon the name I used when I created it.
The default ID seems to be based upon twhatever gets typed into the "Prog ID" input in the ATL Object Wizard Properties box. You can edit this by looking in the file named YourCOntrol.rgs that the CW creates.
-- Dan
When I use the VC++ ATL COM AppWizard to create an ActiveX control, then when I insert it into a dialogbox, it will be given a default ID that is based upon the name I used when I created it.
The default ID seems to be based upon twhatever gets typed into the "Prog ID" input in the ATL Object Wizard Properties box. You can edit this by looking in the file named YourCOntrol.rgs that the CW creates.
-- Dan
ASKER
i create the control using VC++ MFC COM AppWizard, and i named my control (MyButton), the strange thing that it gives me the correct name and caption in VB environment (MyButton01). but in VC++ environment it gives me an id (IDC_01) and a caption (01)
ASKER
sorry, i create it using MFC ActiveX ControlWizard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i checked these two things before, and i didnt find anything unusual, and if there is anything wrong it will be reflected on any environment, not only on VC++ !!!
ASKER
thank you MR Dan, i spent 3 days in search for the deference in the my code and the standard code, and i found it, and the problem is solved :), thanx again
hi ragadi,
Thanks for accepting my comment as an answer.
In case somebody looks at this question later... can you describe exactly what part of your code caused the problem?
-- Dan
Thanks for accepting my comment as an answer.
In case somebody looks at this question later... can you describe exactly what part of your code caused the problem?
-- Dan
MyButton01.Create();
MyButton01.SetWindowText( "Caption");