Solved

Using an ActiveX DLL

Posted on 1998-12-22
6
280 Views
Last Modified: 2013-12-14
I have an ActiveX DLL written in Visual Basic.  How can I create a class from that DLL and use it in Visual C++?
0
Comment
Question by:redbaron082997
  • 3
  • 2
6 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1180861
Install the ActiveX control into your system. Go to the Component Gallery of the Visual C++, choose the Registered ActiveX Controls and select that control to insert it into your project. Thus, a wrapper class will be generated.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1180862
Goto project menu
choose add component
select your dll
select proxy.

Now you will get a wrapper class.

Other way is to use smart pointers.
Add #import "fdefdsf.tlb"
and now you have like a hidden wrapper class inside your code.

0
 
LVL 1

Author Comment

by:redbaron082997
ID: 1180863
will this allow me to create an object that was compiled in VBasic?  I will try this.  I was not sure if VC++ would recognize VBasic DLL's.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 23

Expert Comment

by:chensu
ID: 1180864
One of the advantages using ActiveX controls is language neutral. You may use any programming language to write it.
0
 
LVL 1

Author Comment

by:redbaron082997
ID: 1180865
The activex DLL that I am trying to implement is not an OCX or a control, but rather a CLASS that I create, and execute.  
In VB it would be included in the Reference section, and declared like this:  (ActiveX ProgID = RREG)
public cRReg as RREG.clsRegister
set cRREG = new RREG.clsregister
etc.

I can add controls that I have created, (vb *.ctl files that make the OCX files), but I can not properly reference the above.

Thanks
0
 
LVL 23

Expert Comment

by:chensu
ID: 1180866
So, don't use Component Gallery. Use Compiler COM Support that comes with Visual C++ 5.0 or later. By using the #import preprocessor directive, the compiler can read a type library and convert it into a C++ header file that describes the COM interfaces as classes. Look into the Visual C++ Programmer's Guide on Compiler COM Support. There are some Compiler COM Support Samples as well.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

746 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