|
From: Paul G. <pga...@te...> - 2000-12-09 01:50:43
|
Hi folks, On 8 Dec 2000, at 9:10, the Illustrious niceguy wrote: > Yes, I am trying to combine all the items in the subject in a > single project. :) > The problem: > > When I start the JUnit application and attempt to run tests, I > get a spectacular crash from the MS C++ runtime. After much > fiddling and debugging, I have determined that the crash only > happens when a thread other than the the main thread of the Java > application makes a call to the COM interface of the CAD > application. If I start the JUnit program and pass in the name > of a test to run, the test completes successfully. If I select > the test from a list in the GUI and try to run it, the crash > occurs, because the code is running in the Java event dispatch > thread. If I create a new thread from inside the main thread and > run tests, the crash occurs. So it is definitely thread-related. > This problem essentially means that no Java application with a > GUI can be used to interact with the CAD application, which is a > restriction I would rather not have, for obvious reasons. > > The question: > > Are there any specific issues related to COM and threads in the > context of a DLL compiled with Mingw? Is there anything special > I should be doing when compiling and/or linking? Hmm...will give this a shot by itemizing a few things to check - - Bear in mind that this is mostly speculation and deduction based on your post. a) verify that your mingw app is being compiled with -mthreads (this provides a level of thread safety that doesn't exist when - mthreads is not used) b) verify that your mingw app also has the -fvtable-thunks enabled (this is to insure that the COM stuff is being initialized properly) c) verify that you have -fnative-structs defined d) If the CAD program was generated using msvc/c++, verify that you are using an MS type of .dll as opposed to a mingw type of .dll. They are different. -fnative-structs works to help minimize the conflicts between the mingw .dll and the MS .dlls. Hope this helps. Peace, Paul G. > > Any/All assistance appreciated, > > Jim S. > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options at: > http://lists.sourceforge.net/mailman/listinfo/mingw-users > Nothing real can be threatened. Nothing unreal exists. |