469,898 Members | 1,591 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

mixing unmanaged and managed c++ code

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(fal se);

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
Jan 22 '07 #1
3 1955
On Jan 22, 1:50 pm, frank <f...@niemamaila.comwrote:
Hi

I've got aplication, which one is written in unmanaged c++ with stl,
i've made for it gui in managed c++.
Sorry, but managed C++ and other extensions are off-topic in this
group, take a look at the following page for some suggestions where you
might better ask your question:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Erik Wikström

Jan 22 '07 #2
Erik Wikström napisa³(a):
On Jan 22, 1:50 pm, frank <f...@niemamaila.comwrote:
>Hi

I've got aplication, which one is written in unmanaged c++ with stl,
i've made for it gui in managed c++.

Sorry, but managed C++ and other extensions are off-topic in this
group, take a look at the following page for some suggestions where you
might better ask your question:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Erik Wikström
thx, now i found microsoft.public.dotnet.languages.vc i'll post it there
Jan 22 '07 #3
On Mon, 22 Jan 2007 13:50:45 +0100, frank <fr***@niemamaila.com>
wrote:
>I've got aplication, which one is written in unmanaged c++ with stl,
i've made for it gui in managed c++.
Managed C++ is not part of the standard. You will probably get a
better response from microsoft.public,dotnet.languages.vc where
managed C++ is on topic.

rossum

Jan 22 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by kaalus | last post: by
4 posts views Thread by Daniel Lidström | last post: by
1 post views Thread by Steve Marsden | last post: by
2 posts views Thread by quat | last post: by
3 posts views Thread by frank | last post: by
2 posts views Thread by jraul | last post: by
2 posts views Thread by Jon Slaughter | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.