D3 ActiveForm's in C++Builder

Here's the problem:

I've made a few ActiveForm's in Delphi 3.  I've registered them and added them to the component palette in C++Builder.
I've even dragged these ActiveForm's onto a C++Builder form, compiled and executed the resulting program with no problems.   I have full intereaction with the ActiveForm from within my C++Builder app.  This all works fine.

Here's the catch...we don't want to use these ActiveForm's at design time.  We have to load them at run-time (because there will be many of them) and the user will decide which sub-module he/she wantsto work with.

So here's what I have done so far:

I took a TOleContainer and dropped it on my C++Builder form.  I then loaded the ActiveForm with the following statement:

 oc->CreateObject("OCXSubModule.Tier2SubModule", false);

This appears to work fine.  The ActiveForm is loaded into the TOleContainer.  Unfortuantely, you only get to look at the ActiveForm, you don't get to interact with it.

So, I'm beginning to wonder if TOleContainr is what I should be using.  This is my first foray into ActiveX and unfortunately my requirements are kind of unusual.

I need to know how to load in an ActiveForm at run-time given only the name of the OCX and the name of the class within (i.e. OCXSubModule.Tier2SubModule).

I need a solution in Delphi2 or C++Builder.  Delphi 2 and and C++Builder are very similar.  If you give me a D3 example, please make sure it will work as is in D2.

Thank you.  If need by, I can bump the points for this question up by about 100 more.
LVL 3
mheacockAsked:
Who is Participating?
 
JimBob091197Connect With a Mentor Commented:
The answer is "oc.DoVerb(ovShow);".
JB
0
 
mheacockAuthor Commented:
Adjusted points to 300
0
 
JimBob091197Commented:
Hi again

Try "oc.DoVerb(ovShow);"  after "oc.CreateObject('...', false);".
I must be honest, I have only tried this in Delphi 3...  ;-)

JB
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
mheacockAuthor Commented:
I shall try it.
Any pointer or tip is better than no pointer or tip.
0
 
mheacockAuthor Commented:
That worked like a charm.  Thanks.  Post as question for your A grade.
0
 
JimBob091197Commented:
Hehe...  As this was a continuation of our previous discussion, I reckon I owe you this one for free!!  So, if u want to, reject this answer and delete the question...

JB
0
 
mheacockAuthor Commented:
I can't reject it now...answer it again.  I'll grade.

You can owe me one of a future question if I ever have one.

Thanks again for the offer and the question.
0
All Courses

From novice to tech pro — start learning today.