Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Naming the control in varient Environment....

Posted on 2002-05-01
8
148 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
ID: 6985497
Use

  MyButton01.Create();

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

Expert Comment

by:DanRollins
ID: 6985543
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
ID: 6990898
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:raqadi
ID: 6990901
sorry, i create it using MFC ActiveX ControlWizard
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
ID: 6991952
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
ID: 6993129
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
ID: 6998709
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
ID: 6999486
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 94
Macro to save highlighted rows as a separate file 5 45
substring method in java 1 129
isEverywhere  challenge 19 82
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

808 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