473,394 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,394 software developers and data experts.

How to add a VB ocx to a .NET VC++ project?

Is it possible to add a VB ocx to a .NET VC++ project?
If yes, how do I do it?

Jul 15 '07 #1
3 4049
Kueishiong Tu wrote:
Is it possible to add a VB ocx to a .NET VC++ project?
If yes, how do I do it?
I'm assuming that by ".NET VC++ project" you mean that you have a managed
C++ (or C++/CLI) project. For these project types, use tlbimp.exe (from the
..NET framework SDK, also included with Visual Studio) to generate an
interop assembly that exposes the OCX as a .NET type.

You can also simply #import "path-to-your-ocx" to generate native wrappers
for the OCX, which you can then call from native or managed C++, but you
won't be able to get a verifiable managed image using this approach - if
that matters to you.

-cd
Jul 16 '07 #2

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Kueishiong Tu wrote:
>Is it possible to add a VB ocx to a .NET VC++ project?
If yes, how do I do it?

I'm assuming that by ".NET VC++ project" you mean that you have a managed
C++ (or C++/CLI) project. For these project types, use tlbimp.exe (from
the .NET framework SDK, also included with Visual Studio) to generate an
interop assembly that exposes the OCX as a .NET type.

You can also simply #import "path-to-your-ocx" to generate native wrappers
for the OCX, which you can then call from native or managed C++, but you
won't be able to get a verifiable managed image using this approach - if
that matters to you.
An OCX is a "control", not simply a COM class library, and I don't think the
#import option lets you host it in a Form. Or has someone found a way to do
that?
>
-cd


Jul 24 '07 #3
Ben Voigt [C++ MVP] wrote:
"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospamwr ote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Kueishiong Tu wrote:
>>Is it possible to add a VB ocx to a .NET VC++ project?
If yes, how do I do it?

I'm assuming that by ".NET VC++ project" you mean that you have a
managed C++ (or C++/CLI) project. For these project types, use
tlbimp.exe (from the .NET framework SDK, also included with Visual
Studio) to generate an interop assembly that exposes the OCX as a
.NET type. You can also simply #import "path-to-your-ocx" to generate
native
wrappers for the OCX, which you can then call from native or managed
C++, but you won't be able to get a verifiable managed image using
this approach - if that matters to you.

An OCX is a "control", not simply a COM class library, and I don't
think the #import option lets you host it in a Form. Or has someone
found a way to do that?
My understanding is that technically, an OCX is nothing more than a AX
control with embedded TLB, while an AX control is a self-registering COM
object. But you're right, it's very likely that the OCX in question is
probably a GUI control.

No, #import won't let you host it in a form, that's for sure, but I think
that Winforms can host OCX controls already via tlbimp. I could well be
wrong about that - I've never done VB6 developmemnt and don't have any OCXs
lying about to experiment with.

-cd
Jul 25 '07 #4

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

Similar topics

3
by: Kanaiya | last post by:
how to use c# dll into visual c++ project. With regards, Gangani Kanaiya.
8
by: Paul | last post by:
Hi all may I know how to use C# DLL inside my VC++ Project ? Thanks in advance.
2
by: Paolo | last post by:
I imported a VC++6.0 project into VC++7.1. The conversion operation makes a mess with Preprocessor Definitions, adding a "$(NoInherit)" for each file. For example: I had a DLL project in VC++6.0...
2
by: kalyan. | last post by:
hello, i am working on WMA SDK. i got the SDK from Microsoft under source development agreement . The SDK has the project of WMA 9.1 built in VC 7.1 As i dont have VC 7 i found a tool to convert...
11
by: Dr. Zharkov | last post by:
We want to export myArrayVB (2000, 2) of VB .NET 2003 in myArrayVó of VC++ .NET 2003 on scheme "component - client". But there is an error. For development of a component in VB .NET 2003 we...
0
by: parekh | last post by:
Hi All , I am facing a problem wherein my VB project is not recognizing a change in the argument list of a method ( the method itself being declared and defined in another VC++ project and it...
4
by: nmrcarl | last post by:
I'm trying to upgrade a large project from VS 6.0 to VS 2005. After fixing a lot of things that changed (mostly sloppy coding in the original project that VS2005 didn't allow), I got the release...
6
by: =?Utf-8?B?S3VlaXNoaW9uZyBUdQ==?= | last post by:
Is there a way to convert a VC++ MFC project into a VC++ .NET project? If yes, how do I do it?
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
2
by: NvrBst | last post by:
I'm not too much of a C++ programmer but I have a bunch of C programs (they compile with GNU) and want to get them to compile in VC++ 2008. In Unix I go "./configure" and it makes a "Makefile". ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.