F
frank
Hi
I've got aplication, which one is written in unmanaged c++ with stl,
i've made for it gui in managed c++.
Problem becomes when I'm starting to filling up for example datagrids,
when I'm adding row to datagrid , some varibles (vectors etc) in
unmanaged class are cleared or filled with null.
I want mention also when i compile only unmanaged class for console
project (without .net gui) problem never happends, everything works fine.
I've done all like in msdn example
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vclang/html/f072ddcc-e1ec-408a-8ce1-326ddb60e4a4.htm
my program structure looks like that
main.cpp
// gui.cpp : main project file.
#pragma managed(push, off)
#include "source\main.h"
....
#include "source\nfile.h"
#include "source\fun08.h"
....
static SCA Sca; //< --- thats my unmanaged class
#pragma managed(pop)
#include "source\guiTabPageFUN.h"
#include "source\guiTabPageN.h"
....
#include "Form1.h"
using namespace GuiNameSpace;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew Form1(&Sca));
return 0;
}
//nfile.h:some unmanaged file
#pragma managed(push, off)
class N
{
.....int z;
}
#pragma managed(pop)
//nfile.cpp:some unmanaged file
#pragma managed(push, off)
...some functions body..
N::N()
{
int z=0;
}
#pragma managed(pop)
Is there any way to fix the problem ?
Regards
frank
I've got aplication, which one is written in unmanaged c++ with stl,
i've made for it gui in managed c++.
Problem becomes when I'm starting to filling up for example datagrids,
when I'm adding row to datagrid , some varibles (vectors etc) in
unmanaged class are cleared or filled with null.
I want mention also when i compile only unmanaged class for console
project (without .net gui) problem never happends, everything works fine.
I've done all like in msdn example
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vclang/html/f072ddcc-e1ec-408a-8ce1-326ddb60e4a4.htm
my program structure looks like that
main.cpp
// gui.cpp : main project file.
#pragma managed(push, off)
#include "source\main.h"
....
#include "source\nfile.h"
#include "source\fun08.h"
....
static SCA Sca; //< --- thats my unmanaged class
#pragma managed(pop)
#include "source\guiTabPageFUN.h"
#include "source\guiTabPageN.h"
....
#include "Form1.h"
using namespace GuiNameSpace;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew Form1(&Sca));
return 0;
}
//nfile.h:some unmanaged file
#pragma managed(push, off)
class N
{
.....int z;
}
#pragma managed(pop)
//nfile.cpp:some unmanaged file
#pragma managed(push, off)
...some functions body..
N::N()
{
int z=0;
}
#pragma managed(pop)
Is there any way to fix the problem ?
Regards
frank