472,794 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 software developers and data experts.

About Non-Managed Code and Managed Code.

I have a problem about non-managed code and managed code.Could you like to
give me some suggestion?

In a non-managed MFC application project, I add some managed codes and
these files are setted into /clr:oldSyntax. But the problem is that when the
debug exits, the non-managed object CApplicationApp(maybe all the global and
static objects)'s ~ctor is called twice.

In fact the managed code only is a function without any statement and is
never called.

I have been investigating for sereval days but haven't found any cause
or solution.

Could you help me? Thanks.

Good Luck.

Kevin Sun.
Sep 7 '06 #1
2 1368
"Kevin Sun" <js****@hotmai.comwrote in message
news:OJ**************@TK2MSFTNGP05.phx.gbl...
>I have a problem about non-managed code and managed code.Could you like to
give me some suggestion?

In a non-managed MFC application project, I add some managed codes and
these files are setted into /clr:oldSyntax. But the problem is that when
the debug exits, the non-managed object CApplicationApp(maybe all the
global and static objects)'s ~ctor is called twice.
Can't help, but I'm seeing something which may be related. I have multiple
C++/CLI assemblies loaded into a C# application. When the application
exits, it crashes, saying the CRT has been initialized multiple times.
Sep 8 '06 #2
Your problem maybe is the same as mine.
My MFC project in which there managed c++ code loads managed c++ DLL. When
the application exits, it crashed. I only see the CApplicationApp's ctor()
is called once, but the ~ctor() is called twice.
But if the MFC project doesn't load managed c++ DLL, or there is not managed
project in the MFC project, the application works well.

"Ben Voigt" <rb*@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
"Kevin Sun" <js****@hotmai.comwrote in message
news:OJ**************@TK2MSFTNGP05.phx.gbl...
>>I have a problem about non-managed code and managed code.Could you like to
give me some suggestion?

In a non-managed MFC application project, I add some managed codes and
these files are setted into /clr:oldSyntax. But the problem is that when
the debug exits, the non-managed object CApplicationApp(maybe all the
global and static objects)'s ~ctor is called twice.
Can't help, but I'm seeing something which may be related. I have
multiple C++/CLI assemblies loaded into a C# application. When the
application exits, it crashes, saying the CRT has been initialized
multiple times.

Sep 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
by: Shi Mu | last post by:
Got confused by the following code: >>> a >>> b >>> c {1: , ], 2: ]} >>> c.append(b.sort()) >>> c {1: , ], 2: , None]}
33
by: Lalatendu Das | last post by:
Dear friends, I am getting a problem in the code while interacting with a nested Do-while loop It is skipping a scanf () function which it should not. I have written the whole code below. Please...
36
by: utab | last post by:
Dear, I have experince in C( numerical projects, like engineering problems, scientific applications) I have the basic notion of C++ also, I have read Accelerated C++ until Chapter 7, however it...
11
by: Bob Nelson | last post by:
I don't remember seeing the term ``doubt'' used much in c.l.c. back in the 90's. When did this word become nearly synonymous with ``question'' or ``query'' and does it have static duration?
24
by: Anthony Irwin | last post by:
Hi all, I have been going through the k&r2 book and all the examples are done with main() instead of int main(void) and k&r2 in the start of chapter 1 does not return 0 so I haven't yet either....
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.