Jump to content

Mixed Mode Assemblies (0xc000007b) Failed to Initialize Error

- - - - -

  • Please log in to reply
12 replies to this topic

#1
Shahid@programming

Shahid@programming

    Newbie

  • Members
  • Pip
  • 8 posts
Hello every one!

My problem is very confusing.

When I mix managed and unmanaged C++ code together and build an assembly using /clr or /clr: pure modes, it works fine I mean run fine for a while and when I run it again it eventually stops working and gives this error message...

The application failed to initialize properly (0xc000007b). Pleasae click OK to terminate.

This problem is not only with my mixed mode assemblies but also with SDK .NET tools such as Resource Locater. This problem is not with /clr:safe mode assemblies and also not with VB.NET and C# IL assemblies.

Can some body please help me to fix this error.

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Why are you mixing managed and unmanaged C++ code?
sudo rm -rf /

#3
Shahid@programming

Shahid@programming

    Newbie

  • Members
  • Pip
  • 8 posts
Did you not hear about C++ Interop?
I am mixing native and managed code and this is called C++ Interop.

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Okay, but to me it seems like bad practice, as it can introduce a lot of errors. Is there any particular reason why you have to mix the two?
sudo rm -rf /

#5
Shahid@programming

Shahid@programming

    Newbie

  • Members
  • Pip
  • 8 posts
Suppose I have a great work in native C++ code, and now I want to bring most of that effort to .NET platform but I does not want to do this hard work again for .NET framework, there is only option left, to compile native C++ source code using /clr: pure or /clr compilation modes. This will save great time and enable native code execution via CLR.

#6
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Okay, that makes sense. Error 0xc000007b means that the executable is corrupt. Can you show us all the options you're passing to the compiler and linker?
sudo rm -rf /

#7
Shahid@programming

Shahid@programming

    Newbie

  • Members
  • Pip
  • 8 posts
I have an x86 machine, WindowsXP SP3. I compile the code passing this information...

cl.exe /clr MyProgram.cpp
or
cl.exe /clr:pure MyProgram.cpp

When my source code file contains both native and managed code.

#8
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Hm. Are you compiling it by hand? Visual Studio passes a lot more arguments than that that it doesn't tell you about. It might be one of those that you're missing that's causing the problem.
sudo rm -rf /

#9
Shahid@programming

Shahid@programming

    Newbie

  • Members
  • Pip
  • 8 posts

dargueta said:

Hm. Are you compiling it by hand? Visual Studio passes a lot more arguments than that that it doesn't tell you about. It might be one of those that you're missing that's causing the problem.

This problem exists when I compile on the command line and when I compile via the Visual Studio too. Remember that when I run the compiled program once it runs fine means without any error message. This error happens on the second or 3rd try.

#10
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Weird...maybe it's a registry key getting set?
sudo rm -rf /

#11
Shahid@programming

Shahid@programming

    Newbie

  • Members
  • Pip
  • 8 posts

dargueta said:

Weird...maybe it's a registry key getting set?
I use express editions of Visual Studio. There is a publish wizard for publishing projects, in VC# Express but not for VC++ Express. Can you point out how can I publish my projects in VC++ Express 2008 SP1. Because setup program can set the registry key for my application. What you think about it...

#12
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Why don't you use MSVS Express 2010? Here's a tutorial on how to publish. I'm not 100% sure if it holds for 2008 as well.
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users