Solved

Naming the control in varient Environment....

Posted on 2002-05-01
8
146 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
 

Author Comment

by:raqadi
ID: 6990901
sorry, i create it using MFC ActiveX ControlWizard
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
string initialization in java 11 109
MaxSpan challenge 9 79
Fibonacci challenge 11 108
"Black Box" Testing of Control System Software 2 17
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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.

929 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

9 Experts available now in Live!

Get 1:1 Help Now