473,406 Members | 2,345 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,406 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 4050
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
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?
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
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
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
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...
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...

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.