By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,210 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,210 IT Pros & Developers. It's quick & easy.

Merging ActiveX Control

P: n/a
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
Apr 1 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a


"Khaled Hussein" <kh************@gmail.com> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
| 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.
Apr 1 '06 #2

P: n/a
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]" <wi*************@telenet.be> wrote in message
news:uH**************@TK2MSFTNGP09.phx.gbl...


"Khaled Hussein" <kh************@gmail.com> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
| 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.

Apr 1 '06 #3

P: n/a
hi
i need ur help khalid since u used ilmerge .

i have a problem i have one windows service which i am installing from
one other exe(in process.start simply using cmd.exe and installutil)
now i want to combine these both exes into one for deployment.
see tell me how i will use path for the windows service when i will
embedd it into the one whole exe(in cmd.exe installutil)
can i give path of the exe which i am itself merging into it .
i meam how ilmerge will merge both
shan

Apr 1 '06 #4

P: n/a
I don't know much about ILMerge, I was just looking for specific
functionality indeed. But I don't think this applies to webservices.

"shan" <sh*******@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
hi
i need ur help khalid since u used ilmerge .

i have a problem i have one windows service which i am installing from
one other exe(in process.start simply using cmd.exe and installutil)
now i want to combine these both exes into one for deployment.
see tell me how i will use path for the windows service when i will
embedd it into the one whole exe(in cmd.exe installutil)
can i give path of the exe which i am itself merging into it .
i meam how ilmerge will merge both
shan

Apr 1 '06 #5

P: n/a
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" <kh************@gmail.com> wrote in message
news:uv**************@TK2MSFTNGP14.phx.gbl...
| 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]" <wi*************@telenet.be> wrote in message
| news:uH**************@TK2MSFTNGP09.phx.gbl...
| >
| >
| > "Khaled Hussein" <kh************@gmail.com> wrote in message
| > news:OF**************@TK2MSFTNGP10.phx.gbl...
| > | 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.
| >
| >
|
|
Apr 1 '06 #6

P: n/a
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/is...M/default.aspx

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:uo**************@TK2MSFTNGP14.phx.gbl...
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" <kh************@gmail.com> wrote in message
news:uv**************@TK2MSFTNGP14.phx.gbl...
| 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]" <wi*************@telenet.be> wrote in message
| news:uH**************@TK2MSFTNGP09.phx.gbl...
| >
| >
| > "Khaled Hussein" <kh************@gmail.com> wrote in message
| > news:OF**************@TK2MSFTNGP10.phx.gbl...
| > | 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.
| >
| >
|
|

Apr 1 '06 #7

P: n/a
Could be an option, but there are a lot of restrictions, it's only available
on XP and higher, and it depends on the type of application, for instance if
the control is to be hosted in the Webbrowser control it won't work.

Willy.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uY****************@TK2MSFTNGP14.phx.gbl...
| 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/is...M/default.aspx
|
| Hope this helps.
|
| --
| - Nicholas Paldino [.NET/C# MVP]
| - mv*@spam.guard.caspershouse.com
|
| "Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
| news:uo**************@TK2MSFTNGP14.phx.gbl...
| > 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" <kh************@gmail.com> wrote in message
| > news:uv**************@TK2MSFTNGP14.phx.gbl...
| > | 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]" <wi*************@telenet.be> wrote in message
| > | news:uH**************@TK2MSFTNGP09.phx.gbl...
| > | >
| > | >
| > | > "Khaled Hussein" <kh************@gmail.com> wrote in message
| > | > news:OF**************@TK2MSFTNGP10.phx.gbl...
| > | > | 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.
| > | >
| > | >
| > |
| > |
| >
| >
|
|
Apr 1 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.