Solved

Naming the control in varient Environment....

Posted on 2002-05-01
8
145 Views
Last Modified: 2013-11-20
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 ??
0
Comment
Question by:raqadi
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:job_s
Comment Utility
Use

  MyButton01.Create();

  MyButton01.SetWindowText( "Caption");
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
 

Author Comment

by:raqadi
Comment Utility
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
 

Author Comment

by:raqadi
Comment Utility
sorry, i create it using MFC ActiveX ControlWizard
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
Comment Utility
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
 

Author Comment

by:raqadi
Comment Utility
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
 

Author Comment

by:raqadi
Comment Utility
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
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now