473,472 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Integrate Windows Forms Application (.NET) with C++

I have 2 projects that can run independently. One is built using
Windows Forms Application (.NET) and the other is built on pure C++.

Both project runs fine, but when I try to integrate them, problems
arise. I create new Empty Project, and add the 2 existing project. As
for C++ project, most of the includes and coding is in .CPP file
whereas .H file only contain class definition. As for the form, it is
generated and most of the coding involves event handler is in .H file.
The CPP file contain only _tWinMain function which serves as starting
point of form.

Now, I added a global variable in the Form1.cpp

#include "...CCpp.h"
CCpp *obj;

I then insert this line into the _tWinMain function to create object

obj = new CCpp();

I compile and everything is fine. Now I add a button in Form1.h and
generate a button_click event handler. In the event handler, I try to
use the global pointer obj to call the method in CCpp class

obj->method1();

When I compile again, it gives error 2065 ('obj' undeclared
identifier) and also error C2227 left of '->method1' must point to
class/struct/union.

The bottom line is, I just want to call C++ function from Windows Form
and vice versa (call Windows Form function from C++) but it seems that
integrating the 2 projects doesn't work well.

Please help me. Thank you.
Nov 17 '05 #1
0 1244

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

Similar topics

1
by: Greg Busby | last post by:
I have a client who wants to use Windows Integrated Security for authentication and authorization to use this application. They also want this application to run as soon as Windows comes up. So, I...
3
by: Job Lot | last post by:
Can some please provide some tips, links whatever possible on creating Graphs in WINDOWS FORMS application (not web forms), using DataSet, DataTable etc etc… anything. I am totally lost and cud...
2
by: Ángel Cabrera | last post by:
I'm using Visual Studio .NET 2003. I get a "Form1.h(242): error C2065: 'PlaySound' : undeclared identifier" error all the time, I've been looking in MSDN for a couple of hours with no luck, no...
2
by: Steph | last post by:
I am working on a Windows Forms App. I have attached a standard UnhandledExceptionEventHandler to the current domain to catch unexpected errors. In my application, when I trigger an unhandled...
5
0
by: Sanjeeva Reddy | last post by:
1)how to get the preview of movie file to add in imagelist(i mean the first frame of movie file. )(in .net frame work,windows Forms application) in a listview control. here i am giving code for...
4
by: VB User | last post by:
What is the best way in launching an imaging application from within the VB.Net application. I tried ShellExecute API and System.Diagnostics.ProcessStartInfo. VB.NET complains of security. What...
15
by: Sandy | last post by:
My background is web based. I am attempting to write a Windows application and I am finding some simple things difficult. Currently I am trying to find out how to store information session wide....
2
by: Ludovic DE FREITAS | last post by:
Hello, I am making a prototype system with a Pocket PC that must connect to a Server Application. Unfortunately, the server cannot be a Web Server, but a simple Windows Forms Application. ...
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
10
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
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
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
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...
15
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.