Thanks ByStorm. You saved my life. Been searching for this for weeks.
RockyMu
Posts
-
calling String ^ * from C# -
Wrong assembly copied during buildWhenever I do a build, say a Release build, the wrong referenced assemblies (the Debug versions instead of the Release versions) get copied to the target directory. In fact, the Debug versions of the DLLs will get copied to the target directory in both Release and Debug configurations - usually. I can get Visual Studio to reverse this behavior by removing the DLL project refrences and re-adding them while in Release build configuration. Now the Release versions of the dll assemblies will be copied to the target directories during both Release and Debug builds. Does anyone have any idea what is going on here??? Note that, in spite of this weird behavior, when I view the properties for a particular assembly referenced in any given project, the file location is always correct; that is, it will be in the /Debug folder in Debug configuration and in the \Release folder in Release configuration.
-
MFC CCmdTarget Assert on App Exit After Calling Windows Form?Thanks, Anon. I was not deleting 'f' thinking that it would just get garbage-collected, but I can see the problem with that. Since deleting 'f' requires a destructor, I have added the 'delete f;' code to the MFC object and a destructor '~FormX(){}' to the form's code. When I compile the MFC code, I get an C3841 error on the delete statement which says "C3841: illegal delete expression: managed type 'ClassLibrary1::FormX' does not have a destructor defined." I am still missing something? Paul
-
MFC CCmdTarget Assert on App Exit After Calling Windows Form?I have a Visual Studio solution that contains an MFC executable project and a .NET C# class library project with a Windows Form. When I instantiate a simple C# Windows form from the MFC program, then, on closing out the form and exiting the MFC app, I receive an assert in the CCmdTarget destructor (line 48 cmdtarg.cpp) because m_dwRef is > 1. I have recreated this with the simplest MFC and C# windows from that I can make. I still get this assert. Other than the assert on close-out, everything else works fine. The form is instantiated from an MFC CDocument class object using the following code: FormX *f = new FormX(); f->ShowDialog(); What's my problem??