Re: Merging ActiveX Control



The only option that I can think of which might be a better solution is
to use registration-free COM, which would prevent the need for registering
the component. The following article shows how to do it:

http://msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/default.aspx

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:uoaNaUaVGHA.6084@xxxxxxxxxxxxxxxxxxxxxxx
Not sure what kind of component you are talking about, but an OCX is an
ActiveX control type, that means it's instantiated with it's control
container (a Windows Form?), that means that it must be registered before
you can (successfully) create an instance of the control container. That
would mean that you need to check the registry (query the CLSID or ProgID)
for the component and register it when not found, registering can be done
by
calling Process.Start and shell-out Regsvr32.exe, just make sure that you
need to specify the full path of the ocx file.
I must say that I hate this whole idea though, you should never install
application components without providing an installer/uninstaller.

Willy.



"Khaled Hussein" <khaled.hussein@xxxxxxxxx> wrote in message
news:uvERUcXVGHA.5288@xxxxxxxxxxxxxxxxxxxxxxx
| Willy,
| First, Thanks for your concern..
| Second, OK, if I can't hide it inside my dll, then I would have another
| question .. is there any way to Register this COM programatically from
my
| application? (I don't mean deployment stuff) .. but I would need a
function
| for example to register this COM object, and then these other functions
| start using it..
|
| Is it possible to do it?
| Thanks
| Khaled Hussein
|
| "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
| news:uHW90TXVGHA.5592@xxxxxxxxxxxxxxxxxxxxxxx
| >
| >
| > "Khaled Hussein" <khaled.hussein@xxxxxxxxx> wrote in message
| > news:OFgzG5WVGHA.4248@xxxxxxxxxxxxxxxxxxxxxxx
| > | Hi Every body,
| > | I am currently working in aproject where I am stuck in merging an
| > | ActiveX control (*.ocx) file into a managed Class Library (*.dll). I
| > want
| > to
| > | hide the ActiveX Control in this managed Dll, so that even when
things
| > are
| > | deployed I don't wanna see two files, but only 1 file which is the
dll,
| > and
| > | it would contain within it, the other ocx file.
| > |
| > | Is this possible? If yes, then how can I do something like this, I
tried
| > to
| > | use ILMerge, but it sounds that it doesn't do what I wanted to
have..
| > |
| > | Thanks
| > | Khaled Hussein
| > |
| > |
| >
| > No, activeX control libraries (DLL's or OCX) locations are registered
in
| > the
| > COM DB (the component regisry) such that they can be loaded by the COM
| > infrastructure, COM is not designed to load them from anything else.
| > I don't see why you need this,really.
| >
| > Willy.
| >
| >
|
|




.



Relevant Pages

  • Re: User Control Problem
    ... non-Extension DLL; both are reasonable depending on what you trying to accomplish. ... One solution works in the app - the other in the ... I placed the custom control on the dialog. ... // to register the class, ...
    (microsoft.public.vc.mfc)
  • Re: User Control Problem
    ... I placed the custom control on the dialog. ... Everything works if I use the control only in the DLL. ... // to register the class, ...
    (microsoft.public.vc.mfc)
  • Re: User Control Problem
    ... I'm now using the "extension DLL" way. ... I placed the custom control on the dialog. ... // to register the class, ...
    (microsoft.public.vc.mfc)
  • Re: User Control Problem
    ... I placed the custom control on the dialog. ... Everything works if I use the control only in the DLL. ... Every time I use the control, I try to register the class. ...
    (microsoft.public.vc.mfc)
  • Re: Switching from dialog based app to SDI
    ... all communication comes from the document. ... write/read register values of that device ... I'm supposed to write similar programs now to control other devices. ... displaying the received values as bin,hex,dec strings or converting the ...
    (microsoft.public.vc.mfc)