Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Unmanaged C++ calls managed c++ : it crashes on windows xp

$
0
0

Hi,

if I call a c++ function in a managed DLL from an unmanaged dll or exe, it crashes on Windows xp, but it runs fine on Windows 7.

On Windows XP I get an error message:

Die Anwendung konnte nicht richtig initialisiert werden (0xc0000135).

The Code is very simple. The Header file:

#pragma once


#ifdef _CLR_DLL_
#define _EXPORT_ __declspec( dllexport )
#else
#define _EXPORT_ __declspec( dllimport )
#endifextern"C"
{int _EXPORT_ func(int i);
}

The c++ file:

#include "stdafx.h"

#include "ClrDll.h"int func(int i)
{return i;
}

It is compiled with the /clr switch.

The caller is a simple C++ program, it calls this function.

I use Visual Studio 2010, and .NET framework 4.0

It works fine on windows 7.

It is very important for me this project to run on Windows XP.

I can send a whole project, it is very small.

Is there a wrong setting in VIsual Studio, or it is a bug in Windows XP? Can I make a workaround?


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>