Solved

How do I display an Active X control

Posted on 1998-08-07
13
194 Views
Last Modified: 2013-11-25
Iam writting an Active X control, which uses another Active X control.
When I put the child Ole control in a dialog box, the dialog box is nolonger invoked and the child Ole control fails to initialize.

Could someone tell me how I
1. initialize the child Ole control?
2. display the dialog box?

Thanks in advance
Ian Robertson
0
Comment
Question by:yakky
  • 4
  • 3
  • 3
  • +1
13 Comments
 
LVL 23

Expert Comment

by:chensu
Comment Utility
The ActiveX control you are using should be registered properly.
0
 
LVL 7

Expert Comment

by:psdavis
Comment Utility
1) Make sure your control is registered by using the following command line from your \windows\system directory.

regsvr32 control.ocx

If you get an error (385 or so) then you're missing a dll that you're relying on.

If the control is not registered correctly, then when you call your DoModal, then it will just return and do nothing.  Very annoying.

Also make sure that the control is added properly to your project.  Do a 'Project - Add to project - ActiveX components' EVERY time you add a new method or a new property.  Otherwise, you get 'Bad number of parameters'.

Phillip
0
 

Author Comment

by:yakky
Comment Utility
Ok let me explain a bit more. Both controls are properly registered.
Try the following for your self. Use visual C++'s ActiveX wizard
to create an active X control. Add a dialog box and then in the ctrl's function which invokes the Aboutbox place a call to invoke the new dialog box.
compile it then run it in the test container. What happens is that first the dialog box is displayed followed by the About box.

Now insert the Calendar control into the dialog box. recompile. What happens is that the dialog box doesnt display, only the about box. Also the Calendar control fails to initialize so none of its methods/property's can be used.

PS the Calendar control does work since Ive tried the same thing as an executable.
0
 
LVL 7

Expert Comment

by:psdavis
Comment Utility
So, do you want a different ActiveX control (calendar) in your current ActiveX's about dialog box, correct?  I've run into this problem before, I'll try to remember.  If I'm incorrect in the assumption, please clarify.

Phillip
0
 

Author Comment

by:yakky
Comment Utility
yep correct.
0
 
LVL 7

Expert Comment

by:psdavis
Comment Utility
yakky,

Go ahead and reject my answer to open it up to other users if you wish.  

The problem that I was encountering was when I added an ActiveX control to a property sheet in an application, not to a dialog box.  I'm afraid I'm not going to be able to help you with this one at this time.  Too busy.

Phillip
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:yakky
Comment Utility
see above
0
 

Author Comment

by:yakky
Comment Utility
Adjusted points to 300
0
 
LVL 2

Accepted Solution

by:
graber earned 300 total points
Comment Utility
This isn't a direct answer but it will get you there.  What you are attempting to do may not be possible.  At any rate this will get you the answer.  Jump out to microsofts support site http://support.microsoft.com/support/webresponse.asp.  You will have to create an account for yourself.  Once you have done this open a ticket.  The web site will ask you to give you a discription of the problem.  I recommend that you are as concise as possible.  The use several layers of support attempting to aleveate(sp) the obvious.  If the 1st and second level techs have there questions addressed, such as did you register the controls, then they will shoot you to the engineers.  I took a couple of days but they were very good about addressing the answer in theory and practice.  Be careful you only get two freebees anything beyond this and it will cost you...and it aint cheap buster.  Even on the freebees I have had the enginneers call and confirm that the problem was resolved, everything was working ok, and asked what I thought of the program....Will say it is good if you have the cash.
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
>Now insert the Calendar control into the dialog box.

Is the dialog box an ActiveX control container? Did you call AfxEnableControlContainer?
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
Just curious, have you solved the problem? If so, how?
0
 
LVL 2

Expert Comment

by:graber
Comment Utility
Ian
  I did some looking into the pricing.  $99.00 per incident...that isn't cheap
Gregg
0
 
LVL 2

Expert Comment

by:graber
Comment Utility
Ian
  I did some looking into the pricing.  $99.00 per incident...that isn't cheap.  BTW when you get an answer give me a hollar at
garaber@fedex.com and let me know what microsoft has to say.
Gregg
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

728 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

10 Experts available now in Live!

Get 1:1 Help Now