.net - Visual C++ GUI app stuck in MTA mode -


I have a C ++ GUI project that displays some strange behavior on my machine, compiles the code and just fine Runs. However, on any other machine, the code is compiled but the MTA ends in some way. Obviously, being in the MTA causes all types of runtime problems for GUIs. Here's my main:

  [STAThreadAttribute] int main (array> system :: string ^> args) {application :: enabled visual style (); Application :: SetCompatibleTextRenderingDefault (wrong); Application :: Run (GCN Form 1 ()); Return 0; }  

I can put a breakpoint on the first line of the main line to check the status of the apartment, and on the machines that are properly constructed / executed, STA ". However, on problematic machines, it will be "MTA". Without impact, I can also try to change the apartment mode to STA.

I have tried to remove debug / release diras and tried to clean the project before compiling it, which is running without any debugger, all have no advantage. I can not determine any pattern in which the machines work and which do not. If I compile the XE on a working machine and take it to the problematic machine, it will be executed properly, so I suspect that this is somehow a build environment problem. Running Windows XP with Visual Studio 2008 Standard in all the included machines. Any ideas?

Understand that our project was calling for a DLL from OpenCV, and that DLL has been using several sources Was compiled for. Visual Studio paid attention to this and compiled the app for several sources as well. DLL was responsible for the irregularity of the problem of different versions of a machine.


Comments