Solved

Adding ActiveX control

Posted on 2000-04-23
8
232 Views
Last Modified: 2010-04-02
Hi im new to c++ and im sure this question has been asked many times. I want to use Microsofts TabStrip control and when I add it to my dialog and run the program nothing shows up. The dialog wont even show up. I tried to register the control again and it seems to be registered I dont understand the problem. Am I supposed to instanciate the control myself in the dialog boxes OnInit method I thought VC++ does this. Help!!
0
Comment
Question by:GoofyJoe99
  • 3
  • 3
  • 2
8 Comments
 
LVL 3

Expert Comment

by:GlennDean
ID: 2742407
Hi:
  It's most likely a step you didn't do.  The way to add the TabStrip is
   1.  Go to your Project Menu, click Add to Project, then Registered ActiveX Controls.
   2.  Search for the Microsoft Tabstrip you want, double click on it.
   3.  Click OK to the dialog asking you do you want to insert it into your project
   4.  Click OK to the dialog informing you of the files that will be added to your project
   5.  Now you should notice the Tabstrip on your Toolbox.  Click on the Tabstrip, and then click on your dialog and that places the Tabstrip on your dialog.  IF you don't see it on the dialog as soon as you click on the dialog then you did something wrong.
   6.  Compile the project and it works.

   Glenn
0
 

Author Comment

by:GoofyJoe99
ID: 2746216
Yeah i thinnk i did all that. I compile the program with the tabstrip on the dialog and it compiles fine. Then I click to run the exe and it just ends immedeately and the doalog doesnt even show up I dont get it
0
 

Expert Comment

by:degarn
ID: 2747131
Is your application dialog based and if yes, did you set the ActiveX on the main dialog of your project ?

If not you've got to instanciate your new dialog !!

Give me more details about the way you implemented your project !
0
 

Expert Comment

by:degarn
ID: 2747174
Well, I've just done the same test you did in a new project, and this works perfectly ! (using Microsoft TabStrip v6.0 in VC++6)

Your problem can come from many things :

1) In AppWizzard,did you check the ActiveX control check box in the second step ? This point gives your apllictaion a support for ActX !

2)Do you use default properties in the ActiveX, or have you personnalised them ? If personnalised , try to use default properties and see what happens !

Btw, if other, you can give me your e-mail adress,and I'll post you the code of the little project I made to test TabStrip ActX ...
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 3

Expert Comment

by:GlennDean
ID: 2747489
The ActiveX control check box is checked by default so he doesn't need to do that.
0
 

Expert Comment

by:degarn
ID: 2747879
Hi Glenn,
I agree, I should have said " I hope you have not unchecked the 'ActiveX controls' option in the second step" !
Well, sorry for that.

Btw, I don't understand Goofy's problem! As I explained, I've did all the steps he tells us he had done (your first answer that was rejected, indeed) and everything works fine !
That's why I think the problem comes from somewhere else in his code !

The point I find intrresting in his latest comment is :
>>the doalog doesnt even show up

That's why I'd like him to give us more details about the project in which h wants to insert the ActiveX...
0
 
LVL 3

Accepted Solution

by:
GlennDean earned 50 total points
ID: 2748702
Hi degarn:
   I agree.  Typically when one has problems like that it's something simple like forgetting to Initialize COM (in this case though AppWizard generates that call to AfxEnableControlContainer() so it's good to go - yank out that line and of course everything goes wacko).  
   GoofyJoe99: I would also try using the debugger and set a breakpoint in your app's InitInstance() function.  Step thru the code line by line and see which line causes the gag.  See if its AfxEnableControlContainer or the line
 int response = dlg.DoModal();

   Glenn
0
 

Author Comment

by:GoofyJoe99
ID: 2750492
Thanks to both of you I forgot to instanciate it and  didnt know how but now i do and it works thanks :)
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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

863 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

22 Experts available now in Live!

Get 1:1 Help Now