Answer the question
In order to leave comments, you need to log in
How to integrate a pure C++ class into a C++/CLI form?
Already asked a question on this topic but did not receive an answer. Now I clarified a little with what exactly I contacted, but I did not find anything on the Internet on this issue during these days.
Source old:
public:
Form()
{
example = new myClass();
}
private:
myClass * example;
Answer the question
In order to leave comments, you need to log in
I also once faced with the need to use a static lib in managed c ++ , there
was a note, maybe it will help:
I figured out this error and found a solution that seems to work
. In my code, in a separate statically linked library (*.lib), there are static class fields
And when the program starts, they are initialized, like all other static and global variables
And when they are initialized at runtime, the program crashes on an assertion in one of the standard files
/*
* If this ASSERT fails, a baf pointer has been passed in. It may be
* totally bogus, or it may have been allocated from another heap.
* The pointer MUST come from the 'local' heap.
*/
_ASSERTE(_CrtIsValidHeapPointer(pUserData))
Found on the Internet that for the executable CLR project, you need to change the
Linker->Advanced entry point in the Linker properties
Entry Point: main
1) for x32, replace with:
[email protected]@[email protected]@@@Z
2) for x64, replace with:
[email protected]@[email protected]
@@@ Z it has a non-standard form:
int main(int argc, int** argv)
But this one:
int main(array ^args)
class myClass
{
};
public ref class Form : System::Windpows::Forms
{
public:
Form()
{
example = new myClass();
}
~Form()
{
delete example;
}
private:
myClass * example;
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question