Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > mixing unmanaged and managed c++ code

Reply
Thread Tools

mixing unmanaged and managed c++ code

 
 
frank
Guest
Posts: n/a
 
      01-22-2007
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
 
Reply With Quote
 
 
 
 
=?iso-8859-1?q?Erik_Wikstr=F6m?=
Guest
Posts: n/a
 
      01-22-2007
On Jan 22, 1:50 pm, frank <f...@niemamaila.com> wrote:
> 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

 
Reply With Quote
 
 
 
 
frank
Guest
Posts: n/a
 
      01-22-2007
Erik Wikström napisa³(a):
> On Jan 22, 1:50 pm, frank <f...@niemamaila.com> wrote:
>> 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
 
Reply With Quote
 
rossum
Guest
Posts: n/a
 
      01-22-2007
On Mon, 22 Jan 2007 13:50:45 +0100, frank <>
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How port unmanaged code to .NET development environment (managed)? Laurent Bugnion ASP .Net 0 12-06-2006 08:13 PM
Link aggregation between managed and unmanaged switch yash Cisco 0 05-17-2006 11:28 AM
managed C++ Webservice and unmanaged code Jürgen Tabert ASP .Net Web Services 0 06-03-2005 03:21 PM
Managed and Unmanaged Code Confusion =?Utf-8?B?U2FuZHk=?= ASP .Net 2 10-26-2004 01:25 PM
Security problem with Managed Code calling Unmanaged Code in a Web Page GAH ASP .Net Security 0 07-11-2003 06:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57