.Net and OCX

E

Emrah Budur

Hi, is there a way to create an OCX output with C# project or any other .Net
project?
 
M

Michael Nemtsev [MVP]

Hello Emrah,

What exactly u wanna get?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


EB> Hi, is there a way to create an OCX output with C# project or any
EB> other .Net project?
EB>
 
E

Emrah Budur

Hello Michael,
I am supposed to provide an OCX for a platform that accept only embedding OCX.
And I am supoosed to provide an image viewer that is build in .Net DLL.
I want to develop an wrapper interface of this DLL as an OCX.
I thought two different ways might be a solution.

1) Creating a .Net that outputs OCX.
2) Creating an OCX project that references .Net DLL.

The former one would be the prettiest if possible while I found no way for
the latter option to import managed .Net DLL into MFC ActiveX C++ project.

That's exactly the problem I need to find a solution for.

Thanks in advance for your support

Emrah
 
W

Willy Denoyette [MVP]

Emrah Budur said:
Hello Michael,
I am supposed to provide an OCX for a platform that accept only embedding
OCX.
And I am supoosed to provide an image viewer that is build in .Net DLL.
I want to develop an wrapper interface of this DLL as an OCX.
I thought two different ways might be a solution.

1) Creating a .Net that outputs OCX.
2) Creating an OCX project that references .Net DLL.

The former one would be the prettiest if possible while I found no way for
the latter option to import managed .Net DLL into MFC ActiveX C++ project.

That's exactly the problem I need to find a solution for.

Thanks in advance for your support

Emrah


Michael Nemtsev said:
Hello Emrah,

What exactly u wanna get?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and
we
miss it, but that it is too low and we reach it" (c) Michelangelo


EB> Hi, is there a way to create an OCX output with C# project or any
EB> other .Net project?
EB>



Your only option is to build the OCX (ActiveX control) in an unmanaged
language (like Delphi, VB6 or C++ using MFC or ATL). There is no way to
build ActiveX controls in managed code.
What scares me a bit is this: "... for a platform that accept only
embedding OCX" - Are you aware that wrapping a managed code assembly in a
native code AX control implies COM interop, this requires .NET to be
installed at runtime, don't expect this to run on a system that doesn't have
the Framework installed.

Willy.
 
E

Emrah Budur

Hello Willy,
Thanks for your suggestion. I mean by the platform is the development
environment. The final runtime is Windows XP Pro and there is no problem
with running .Net Framework.


Willy Denoyette said:
Emrah Budur said:
Hello Michael,
I am supposed to provide an OCX for a platform that accept only embedding
OCX.
And I am supoosed to provide an image viewer that is build in .Net DLL.
I want to develop an wrapper interface of this DLL as an OCX.
I thought two different ways might be a solution.

1) Creating a .Net that outputs OCX.
2) Creating an OCX project that references .Net DLL.

The former one would be the prettiest if possible while I found no way for
the latter option to import managed .Net DLL into MFC ActiveX C++ project.

That's exactly the problem I need to find a solution for.

Thanks in advance for your support

Emrah


Michael Nemtsev said:
Hello Emrah,

What exactly u wanna get?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and
we
miss it, but that it is too low and we reach it" (c) Michelangelo


EB> Hi, is there a way to create an OCX output with C# project or any
EB> other .Net project?
EB>



Your only option is to build the OCX (ActiveX control) in an unmanaged
language (like Delphi, VB6 or C++ using MFC or ATL). There is no way to
build ActiveX controls in managed code.
What scares me a bit is this: "... for a platform that accept only
embedding OCX" - Are you aware that wrapping a managed code assembly in a
native code AX control implies COM interop, this requires .NET to be
installed at runtime, don't expect this to run on a system that doesn't have
the Framework installed.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top