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 ??
raqadiAsked:
Who is Participating?
 
DanRollinsConnect With a Mentor Commented:
When I used the MFC ActiveX Control wizard, my default ID was based upon the name that I chose for the project.

There is an [Edit Names] button in the wizard.  Perhaps you deleted the default name there.

You can also look in the file named MyButton.ODL  Also look in the Resource View tab and examine the String Resources.

-- Dan
0
 
job_sCommented:
Use

  MyButton01.Create();

  MyButton01.SetWindowText( "Caption");
0
 
DanRollinsCommented:
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


0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
raqadiAuthor Commented:
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)
0
 
raqadiAuthor Commented:
sorry, i create it using MFC ActiveX ControlWizard
0
 
raqadiAuthor Commented:
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++ !!!
0
 
raqadiAuthor Commented:
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
0
 
DanRollinsCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.