|
-
March 7th, 2011, 11:55 AM
#1
Going around in circles building ActiveX control
Greetings!
I am trying to create an ActiveX control that will contain a third-party ActiveX control and will be compatible with an application written in C++ using Visual Studio 2008.
If I create an MFC ActiveX control, I get no drawing surface for the control. In a similar project I did a couple of years ago using VC++ 6, I created a dialog in the control project, dropped the third-party control onto that, and then in the control's OnCreate event handler, I created the dialog box, fitted it to the control's window, and drew it. This seems like a really strange way of doing things, although it worked nicely. From what I see in VS2008, that approach is still possible.
But why can't I get a surface to drop controls on?
I tried creating an ATL project, and then adding an ATL control to the project. This seemed to work nicely at first. I specified that the new control would be a composite control (an option not available in the MFC version of this), and I got a drawing surface. I dropped my third-party control onto it. But then I tried to add a variable to reference that control. First I had to add a class, and I had to pick a base class. How do I know what base class to use? I used CDialog because that was what I did in the VC6 project, and because the Automation radio button was enabled with it. But when I clicked on my third-party control and clicked Add Variable, the Control Variable checkbox was disabled and all I could add was plain objects like ints and doubles. I tried creating a new control and dropped a plaiin ordinary button onto it, and I couldn't create a member variable for it either!
What am I doing wrong?
Thank you very much!
RobR
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|