473,854 Members | 1,426 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 1279

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

Similar topics

1
2856
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
16379
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
9573
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
1230
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
1459
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
22595
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
6766
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
6305
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
9901
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
9751
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11024
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10679
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
9513
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...
0
7081
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
5941
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4159
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3186
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.