473,760 Members | 9,717 Online
Bytes | Software Development & Data Engineering Community
+ 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 1275

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

Similar topics

1
2849
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 think I need to put this application in the Start-up group and have the application handle A&A using the Integrated Security. My question is how do I accomplish using Windows Integrated Security for A&A into a Windows Forms application? The OS is...
3
16375
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 not find anything helpful.
2
699
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 idea, it's my first program, if you are so kind and could explain me in detail. Sorry for my english. Regards.
2
9569
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 error, my handler does not get hit - I get the standard ugly run time error. The strange thing is, I tried the exact same code in a new, windows forms application, and when I trigger an unhandled exception, the code works fine (the JIT compiler...
0
1227
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 adding images in my imagelist below. imageList1->Images->Add(Image::FromFile("C:\\ar1.jpg"); like that only i want to add my movie files(first frame) to my imagelist. 2)imagetransition:in imagetrancistion i want to use transition filter like...
4
1457
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 is the way out or is there a better method to launch another application from my Windows Forms Application?
15
22567
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. In the web you have session state and you can add variables or objects to it. They remain in existance until the session ends. How could I do that for a windows forms application? For example: a modal form is launched to log in, I do a...
2
6760
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. Here is my question: The only way to easily communicate for a Pocket PC is the Web Service. Is it possible to host a web service in a Windows Forms Application ?
22
6285
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 client (MS Access vs ..NET Windows Forms) would be preferred over the other. While I have some good arguments on both sides, I would appreciate your points of view on the topic.
0
9521
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9945
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9765
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8768
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7324
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6599
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3863
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 we have to send another system
3
3442
muto222
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.