visual studio 2010: error code -2146232576 (0x80131700) - c++

I have to convert a C++ project from visual studio 2008 running on Windows XP to 2010 running on Seven. Compilation seems to run perfectly but during the debugging I have an error: "The program 'App.exe : Native' has exited with code -2146232576 (0x80131700)."
After a few researches on the internet I found out that the issue is in relation with .NET.
I tried to update my windows with hidden updates, check what the .NET version target is 4 and a few more things that doesn't work...
Has anyone ever encountered this issue ?
Thanks a lot.
EDIT: it is a managed C++ project

It is a low-level .NET initialization error, the CLR cannot get loaded. That's pretty hard to explain since you can run VS2010 without a problem and it already uses .NET version 4. The only decent guess is that you are actually using a C++ project (not a C++/CLI one) and that it loads the CLR itself. And asks for and old version, like 1.1, one that isn't installed on the machine. Search the code for "CorBindToRuntime".

Have you installed all Windows updates lately? If not, do so - seems to be some general .NET related error - see:
http://social.msdn.microsoft.com/Forums/ta/wlgeneraldev/thread/8f9d610f-92b2-4262-8e1a-88cee8428aed

You are running native code I presume? Are you?
If that is a case this error is caused by something else.
If you are using managed C++ than you have a problem related to the .Net framework.
Remember that some error numbers returned may (and they do) indicate different causes, depending who return an error.
Giving more information about what is your application doing and what language it is written would definitely help isolation problem.

Related

Problems with running the application using OpenSSL

Good day, colleagues. I'm building an application using OpenSSL - the application crashes with an error code: 0xc0000142.
The standard application openssl.exe also crashes with this error code. What could be the trouble?
According to Microsoft Support in KB 2701373:
This issue is caused by an error in the
Microsoft.powershell.consolehost.dll file. When a Windows PowerShell
script calls the Console.Write method, or when you run an executable
file for an application from a Windows PowerShell session, values are
written into the PowerShell console. Additionally, a corresponding
console handle is created. When many console handles are created, the
console handles leak, and the issue that is described in the
"Symptoms" section occurs.
There's also a question in the Microsoft Communities, CMD.EXE error 0xc0000142, and the answer appear to be "reinstall your application".
I'm not sure how MinGW affects the problem. Since MinGW is abandoned, I'm guessing its the problem and you likely won't be able to fix it. Its probably providing an old, buggy version of something with ABI problems.
Maybe you can use Cygwin for Linux on Windows. Cygwin is still actively developed and maintained.

Deployed C++ AMP application stops responding

Im trying to deploy a C++ AMP application to another Windows 7 machine.
I have tried to include the vcamp110.dll in the same folder, and also compiled with /MT do get rid of dependency on msvcp110.dll and msvcr110.dll.
Also tried both x64 and win32 release of the application.
On the computers i have tried it on whitout VS11 installed, the program stops responding.
I tried to do a simple test with the hello world application and i have the same problems there.
The files can be downloaded from here http://www.2shared.com/file/IofZlrJs/amptest.html (source, binary and the dll).
Any suggestions to how this can be fixed?
Deployments like the one you tried are definitely supported – full details here:
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/03/12/deploying-apps-built-with-c-amp.aspx
There are a few things you can do to diagnose the issue you are facing yourself:
The bitness of vcamp110.dll has to match the bitness of your app, so 32bit for one means 32bit for the other.
Ensure that there are no other instances of vcamp110.dll in some central location (e.g. system32)
Attach a debugger and see what DLLs are loaded and what exception gets thrown.
Most important of all, for all your apps, surround your parallel_for_each call with try…catch to see what runtime_exception you are getting. More on C++ AMP exceptions can be found here: http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/01/c-amp-runtime-exceptions.aspx
For the specific repro you shared, we tried that under the debugger on a clean Windows 7 machine and indeed a rutime_exception is being thrown: “The binary for the parallel_for_each is incompatible with this version of runtime.”, which indicates a mismatched runtime version (either mixing bitness or mixing Developer Preview with Beta or something like that).

Problem with System.Runtime.Serialization.SerializationException

I am having a few troubles with a set of hosted code on an WS2K8 R2 box with IIS 7. I have another server running WS2008 that does not encounter the same issue. I have copied the application code from the old server so that it is identical.
The exception thrown in my server side logs is:
"ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain."
I also have an error being returned in VS2010 at the same time:
Unable to find assembly 'msvcm80, Version=8.0.50727.4927, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I have checked and the correct version of msvcm80 is on the server in the "C:\Windows\winsxs" folder. I have also installed Microsoft Visual C++ 2005 Redistributable (x64) and (x86).
I cannot see why the error might be thrown??
My debugging expierence is low so please bear with me.
I re-checked the version details. It appears that it was a requirement of the Microsoft Visual C++ 2005 Redistributible. I re-installed all versions of it on the server and applied the security hotfixes.
After a re-boot and testing in IIS the issue has now gone from my log files.
I did check the comparison between the two servers and wasnt that happy copying the files over. I felt it was best to try this method first.
Thanks for your help.
msvcm80 is a .NET Framework mixed assembly (microsoft visual c++ managed + unmanaged). You might try to find this file on the second server and place near your application on the first server machine.
Note: .Net Framework Runtime requires exact version of an assembly (8.0.50727.4927 in your case).

Using Cuda with a Forms based GUI in xp

Brand new at CUDA programming so please bear with me. I finally got cuda to work in console application using Visual studio 2008 on win xp (32 bit). But my main target is to port an existing program to port to cuda. This program is very computational intensive and is based on a complex gui. So, porting to cuda makes sense as it will cut down on my computational time significantly. I did some research and found no example where cuda is used with a forms based application. Its always been with a console application. But converting my gui into a console based application will be out of the question.
So, I tried doing a test (forms based gui) where I included the .cu file in my project. But on compile i get this linker error
fatal error LNK1313: ijw/native module detected; cannot link with pure modules
So I guess cuda doesn't play nice with managed code.
My question is: IS there anyway to use cuda with a form in visual studio 2008?
Another question: Has anyone even tried this as I have not seen any such example?
Please help....
Edit:--
Ok I changed the the properties->configuration->general->common language runtime support to /clr, and it compiled without any problem. But when I tried to run it i got a nasty popup dialog box with Debug Assertion failed error in file dbgheap.c, Expression _CRTisValidHeapPointer(pUserData).
So close but no cigar. Any Ideas?????
I've done this with a WPF application written in C# that used C++/CLI to interop with a mixed CLI/native assembly that in turn called CUDA code in a separate project. I've not tried WinForms but I don't see any reason why this shouldn't work. You end up writing quite a lot of plumbing code to handle the interop though.
I'd need more info about what your application was doing when __CRTisValidHeapPointer failed. Your heap has gotten corrupted somehow. It may or may not be related to CUDA code.
C# to C++ interop:
http://www.ademiller.com/blogs/tech/2009/09/c-optimization-revisited-part-3-the-native-option-c/
C++ and CUDA side-by-side:
http://www.ademiller.com/blogs/tech/2011/03/using-cuda-and-thrust-with-visual-studio-2010/
(Visual Studio 2010, CUDA 5.0) Try to set:
Linker->System->Subsystem: Not Set
Linker->Advanced->Entry Point: Empty

Checking if DWM/Aero is enabled, and having that code live in the same binary for 2000/XP/Vista/7

I know the title makes little sense, mostly because it's hard to explain in just one line. So here's the situation:
I have a program who's binary is targeted at Windows 2000 and newer. Now, I went ahead and added some code to check if the user is running under Vista/7, and if so then check if Aero/DWM is enabled. Based on this I'll disable some stuff that isn't relevant to that particular platform, and enable some other features. My main problem is that in order to call DwmIsCompositionEnabled from Visual C++ 2008 I have to add the dwmapi.lib file and compile against it. Running the binary in anything other than Vista or 7 gives the "Unable to locate component. The application failed to start because dwmapi.dll was not found" error. This, of course, is expected to happen since DWM is new and not available for older platforms.
My question is then: will it be possible for me to somehow manage to pull this off? One binary for all OS versions AND include that DWM check code? This program was written under Visual Studio 2008, Visual C++ using MFC.
Turns out I can just tell the linker to delayload the dwmapi.dll.
I'd like to thank ewanm89 because something he said sort of resonated and led me down the path to finding the actual answer.
The normal solution is to use LoadLibrary() and GetProcAddress(). Both can be done after your program started. But still +1 for the DelayLoad solution, which does the same for you behind the scenes.