473,473 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mixed mode exe (forms application)

I have created a .NET C++ forms application. I would like to call some
functions in an unmanged class that provides access to some underlying API
functions. The underlying class needs access to ATL (for example the CString
class). I created the app, added an unmanaged C++ class, changed the
compiler from /clr:pure to /clr. I added includes in stdafx.h . The system
compiles but fails during runtime (an assert fires on
_CrtIsValidHeapPointer ) apparently due to the fact that the ATL statics
are not initialized. According to
http://msdn2.microsoft.com/en-us/library/ms173267.aspx, I no longer need to
deal with _vcclrit.h or its idosynchrocises to make this work. However it
does not appear to work correctly.

Interestingly, if I create a Win32 project, and add a managed form to it,
all appears fine..

Any and all insight, pointers or help is appreciated

-Robert
Jul 5 '06 #1
3 1506
Hi Robert!
I have created a .NET C++ forms application. I would like to call some
functions in an unmanged class that provides access to some underlying API
functions. The underlying class needs access to ATL (for example the CString
class). I created the app, added an unmanaged C++ class, changed the
compiler from /clr:pure to /clr. I added includes in stdafx.h . The system
compiles but fails during runtime (an assert fires on
_CrtIsValidHeapPointer ) apparently due to the fact that the ATL statics
are not initialized. According to
http://msdn2.microsoft.com/en-us/library/ms173267.aspx, I no longer need to
deal with _vcclrit.h or its idosynchrocises to make this work. However it
does not appear to work correctly.
Does the following help you?
http://msdn2.microsoft.com/ms235211

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Jul 5 '06 #2
No, that link focuses on adding CLR support to unmanaged applications. Which
I am successfully able to do. What I want to do is the reverse, I want to
add an unmanaged class, with access to ATL, to a .NET forms application.

"Jochen Kalmbach [MVP]" <no********************@holzma.dewrote in message
news:Oe*************@TK2MSFTNGP04.phx.gbl...
Hi Robert!
>I have created a .NET C++ forms application. I would like to call some
functions in an unmanged class that provides access to some underlying
API functions. The underlying class needs access to ATL (for example the
CString class). I created the app, added an unmanaged C++ class, changed
the compiler from /clr:pure to /clr. I added includes in stdafx.h . The
system compiles but fails during runtime (an assert fires on
_CrtIsValidHeapPointer ) apparently due to the fact that the ATL statics
are not initialized. According to
http://msdn2.microsoft.com/en-us/library/ms173267.aspx, I no longer need
to deal with _vcclrit.h or its idosynchrocises to make this work. However
it does not appear to work correctly.

Does the following help you?
http://msdn2.microsoft.com/ms235211

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Jul 6 '06 #3
Hi Robert!
No, that link focuses on adding CLR support to unmanaged applications. Which
I am successfully able to do. What I want to do is the reverse, I want to
add an unmanaged class, with access to ATL, to a .NET forms application.
It should be the same settings, regardless in which direction you "move"...

Do you have a small project which can be used to repor this problem?

Greetings
Jochen
Jul 6 '06 #4

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

Similar topics

3
by: Nadav | last post by:
Hi, I am writing a mixed mode application, I have a mixed mode Assembly manipulating a managed byte array, to access this array in unmanaged code I '__pin' the array, As I understand, pining an...
2
by: Craig Klementowski | last post by:
Pardon the cross post, but I'm not sure where exactly to post this question. We have MFC application using many MFC extention DLL's. We started using a new MFC extention DLL that is mixed mode so...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
8
by: Nadav | last post by:
Hi, I am writing a performence critical application, this require me to stick to unmanaged C++ as performance is much better using unmanaged C++ ( about 33% better ), Still, I am trying to avoid...
7
by: Staale L. Hansen | last post by:
We have an application which uses some mixed-mode code to expose a .NET 1.1 managed API. Only the necessary files are compiled with /clr. We want to be able to load the application without .NET...
2
by: Doug Belkofer | last post by:
We have created a fairly complex mixed-mode DLL that we want to use from VB.NET. The mixed-mode DLL is written in C++, and does use the standard C runtime libraries. An unusual thing is happening...
0
by: Doug Belkofer | last post by:
We have created a fairly complex mixed-mode DLL that we want to use from VB.NET. The mixed-mode DLL is written in C++, and does use the standard C runtime libraries. An unusual thing is happening...
10
by: ajtaylor | last post by:
Hello, I have a load of native C++ code that I want to use in a CLR class library. My "logic" being that I create a C++/CLI managed class that acts as an interface to the unmanged code. I...
0
by: emu | last post by:
Hi All, I have an unmanaged C++ application that references a mixed mode image DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the dll (the mixed mode dll) by running the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.