473,412 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Creating an OCX with .NET

Hi, is possible to create an OCX with .NET?
I need to use a control (user control) in Visual Fox Pro, but the old fox
doesn't accept usercontrols.
Any help are welcome
Nov 16 '05 #1
6 22904
smeagol wrote:
Hi, is possible to create an OCX with .NET?
I need to use a control (user control) in Visual Fox Pro, but the old fox
doesn't accept usercontrols.
Any help are welcome


There should be only a nasty way to perform that in .NET - it's just not suited for that,
but why don't you want to use something more "ActiveX-friendly", like VC++ 6.0 or VB or even Delphi?
Nov 16 '05 #2
I had my code made in C# and is very large.. :(

"Andrey" <le*******@yahoo.com> escribió en el mensaje
news:J1t2d.313750$8_6.85375@attbi_s04...
smeagol wrote:
Hi, is possible to create an OCX with .NET?
I need to use a control (user control) in Visual Fox Pro, but the old fox doesn't accept usercontrols.
Any help are welcome

There should be only a nasty way to perform that in .NET - it's just not

suited for that, but why don't you want to use something more "ActiveX-friendly", like VC++ 6.0 or VB or even Delphi?

Nov 16 '05 #3
AFAIK There is no way to write an ocx in c# or vb. However you can easily
"expose" your managed usercontrols or libraries as com components to be used
by com enabled environments. To use this feature of .net please see the
documentation of tools "Regasm.exe" and "Tlbexp.exe" and also read "strong
named" assemblies in .net. Its all nicely documented in msdn and you shouldnt
have any difficulty in doing this after reading the docs.

Hope that helps.

Abubakar.
http://joehacker.blogspot.com
"smeagol" wrote:
Hi, is possible to create an OCX with .NET?
I need to use a control (user control) in Visual Fox Pro, but the old fox
doesn't accept usercontrols.
Any help are welcome

Nov 16 '05 #4
Abubakar wrote:
AFAIK There is no way to write an ocx in c# or vb. However you can easily
"expose" your managed usercontrols or libraries as com components to be used
by com enabled environments. To use this feature of .net please see the
documentation of tools "Regasm.exe" and "Tlbexp.exe" and also read "strong
named" assemblies in .net. Its all nicely documented in msdn and you shouldnt
have any difficulty in doing this after reading the docs.

Actually i've read an article where they say this feature is not supported by Microsoft and an
assembly is not guaranteed to work this way, may or may not.

Hope that helps.

Abubakar.
http://joehacker.blogspot.com
"smeagol" wrote:

Hi, is possible to create an OCX with .NET?
I need to use a control (user control) in Visual Fox Pro, but the old fox
doesn't accept usercontrols.
Any help are welcome

Nov 16 '05 #5
But you will have to give it a try becuz there is no other way. The
probability of it not running is very low. I would say you give it a try, I
bet it'll work for you :-)

Abubakar.
http://joehacker.blogspot.com

"Andrey" wrote:
Abubakar wrote:
AFAIK There is no way to write an ocx in c# or vb. However you can easily
"expose" your managed usercontrols or libraries as com components to be used
by com enabled environments. To use this feature of .net please see the
documentation of tools "Regasm.exe" and "Tlbexp.exe" and also read "strong
named" assemblies in .net. Its all nicely documented in msdn and you shouldnt
have any difficulty in doing this after reading the docs.


Actually i've read an article where they say this feature is not supported by Microsoft and an
assembly is not guaranteed to work this way, may or may not.

Hope that helps.

Abubakar.
http://joehacker.blogspot.com
"smeagol" wrote:

Hi, is possible to create an OCX with .NET?
I need to use a control (user control) in Visual Fox Pro, but the old fox
doesn't accept usercontrols.
Any help are welcome

Nov 16 '05 #6
Hi everyone,

While you can do COM-visible components in .NET, you unfortunately cannot do
OCX (ActiveX) *controls*. OCX/ActiveX involves a little bit more than a
non-visual COM components, namely a set of pre-defined interfaces which
should be properly implemented by the control to cover the communication
between the control and its site. For example, you can take a look at
interfaces such as IOleClientSite and IOleWindow (the spelling might be not
100% correct, it's been more than a year ago I dealt with these).

From what I remember, in early versions of the framework, the
System.Windows.Forms.Control class used to implement these interfaces, but
at some point Microsoft decided not to support them anymore.
As a workaround, you can use a so-called "shim control". This is a small
ActiveX control written in C++ which should be available free of charge in
the "Files" section of the "vsnetaddin" Yahoo group. This shim control is
used by add-in developers to host .NET Windows Forms controls as ActiveX
controls inside IDE's tool windows.

If your C# code is not UI-related, you can indeed compile and register it as
a COM-visible assembly, and then to create the visual part in, say, Visual
Basic 6, and to reference the C#-written COM DLL from the VB6 project.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Abubakar" <Ab******@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
But you will have to give it a try becuz there is no other way. The
probability of it not running is very low. I would say you give it a try, I bet it'll work for you :-)

Abubakar.
http://joehacker.blogspot.com

"Andrey" wrote:
Abubakar wrote:
AFAIK There is no way to write an ocx in c# or vb. However you can easily "expose" your managed usercontrols or libraries as com components to be used by com enabled environments. To use this feature of .net please see the documentation of tools "Regasm.exe" and "Tlbexp.exe" and also read "strong named" assemblies in .net. Its all nicely documented in msdn and you shouldnt have any difficulty in doing this after reading the docs.


Actually i've read an article where they say this feature is not supported by Microsoft and an assembly is not guaranteed to work this way, may or may not.

Hope that helps.

Abubakar.
http://joehacker.blogspot.com
"smeagol" wrote:
>Hi, is possible to create an OCX with .NET?
>I need to use a control (user control) in Visual Fox Pro, but the old fox>doesn't accept usercontrols.
>Any help are welcome
>


Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rdsteph | last post by:
Python411 is a series of podcasts about Python, aimed at hobbyists and others who are learning Python. Each episode focuses on one aspect of learning Python, or one kind of Python programming, and...
6
by: owen | last post by:
Generally speaking, what does it mean when I see a "button" with red text showing this message instead of the control I've dragged onto the web form in Design View.? (But the page works fine at...
2
by: Pawan | last post by:
Hi Guys, I have this current assignment where I have to develop online forms for local municipal authorities. I have to use adobe acrobat to create online forms from PDFs (which I have never done...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
2
by: LIN | last post by:
Hello, Greetings. I am creating a web site which will contain lot of articles. I had been planning to create simple HTML page on the server everytime i posted a article (eg. article12.html )....
2
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
9
by: =?Utf-8?B?YmJn?= | last post by:
Hi all, I read somewhere "using kernel stuff in thread is not good.." if ManualResetEvent object is created in thread but not actually used, will it affect performance? Bob
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.