p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB.NET 2002/2003 Basics (http://p2p.wrox.com/forumdisplay.php?f=76)
-   -   How do I use an ActiveX Control? (http://p2p.wrox.com/showthread.php?t=18445)

ArtDecade September 15th, 2004 03:25 PM

How do I use an ActiveX Control?
 
I am working with a reference library that includes an ActiveX control. Do I need to reference another library (Microsoft Shell Controls and Automation, perhaps?) in order to get that control to work? And, if so, how do I work that into my code?

I am working in the VB editor under Excel 2003. The control I want shows up in the Object Browser, but no matter how I include that control in my procedure - and by now I have played with all different permutations of DIM, SET, DIM as NEW, SET as NEW that I can think of - nothing happens.

(Fwiw, I am trying to program with the Microsoft Office Document Imaging 11.0 Library. The Microsoft Document Imaging Control, MiDocView, is the item I cannot for the life of me get to fire up.)


ArtDecade

planoie September 16th, 2004 02:04 PM

If using Visual Studio
    Have you created a project reference to the ActiveX/COM object?
Else
    Have you created a runtime callable wrapper using the tlbimp utility?

ArtDecade September 16th, 2004 07:46 PM

I am using the VBA that is attached to MSFT Excel 2003.

I am not 100% sure what you mean by creating a "project reference". The ActiveX object is part of the MODI library, which I have checked off under Tools/References. The ActiveX object then shows up within the Object Browser.

As for creating a "runtime callable wrapper"........ uh, being a beginner, I have not the slightest idea what any of those three words mean.

ArtDecade

ArtDecade September 16th, 2004 07:49 PM

I am working in the VBA attachment in Excel 2003. I am not entirely sure what you mean by creating a program reference to the ActiveX object. Howerer, the ActiveX object is contained within the MODI library, and I have that library checked off within Tools/References. Further, all of the MODI objects - including the ActiveX object - show up within the Object Browser.

As for creating a "runtime callable wrapper"..... I am a beginner and have virtually no idea what that means :(

ArtDecade

planoie September 17th, 2004 09:12 AM

What development environment are you using?


A runtime callable wrapper or RCW is a .NET assembly that contains "stub" classes that expose all the public classes and methods of a COM component. There is a tool that is used to generate this assembly. Then your .NET project reference that assembly.

wuzhj September 18th, 2004 03:23 AM

Hi Mr.planoie:
   I'm a green hand in Visual C++, I hope I will get a lot of advice from you about how to do first when I want to make a great improvment in Visual C++.
   Thanks in advance!
      wuzhjun

wuzhjun


All times are GMT -4. The time now is 12:05 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.