-
July 23rd, 2009, 10:34 AM
#1
call native c++ function or class
hi i would use and call native c++ function or class member present in a .h or .cpp file in the resource of a window form c++ clr project...
i would that in form1.h file, after a button click i would call a function present in a .h file developed in native c++.
it is possible?
-
July 24th, 2009, 12:45 AM
#2
Re: call native c++ function or class
Yes, this is possible. Native functions and classes are called from C++/CLI exactly like from C++. Include h-file with function prototype or class definition, and call them.
-
July 25th, 2009, 02:28 AM
#3
Re: call native c++ function or class
mmm but i include .cpp or .h file in file of main function and in form.h after a mouse click event i try to create a new class or call a function of cpp or h file and it give me an error...
it tell not inizialized function
-
July 25th, 2009, 03:02 AM
#4
Re: call native c++ function or class
(1) Add the cpp to the project.
(2) Add #include <header file> to the top of Form1.h
Then you can use the definitions in the header file in your class.
I still think you're trying to run before you can walk here. You are lacking a basic understanding of how C++ works - so should learn the fundamentals first before trying to write C++/CLI code.
At this rate you might learn C++/CLI before the next century... it really would be quicker if you bought a native C++ book and went through it. Or go through a native C++ online tutorial.
Darwen.
-
July 25th, 2009, 04:02 AM
#5
Re: call native c++ function or class
It is also a good idea to post some code which is not compiled, with compiler error messages. Finally, it is all about code
-
July 25th, 2009, 05:01 AM
#6
Re: call native c++ function or class
ok i'll try to do this.
i've studied c++ native code to develop win32 console application...now i'm studing cli language.
i'm trying to integrate native cpp files with function and class yet developed for c++ native console application to window form project..
later i'll post same code
tnx to everyone
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|