Slow Startup of C# Dialogs in C++

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI

i've programmed to dialogs in C#. Each in one assembly. They have a COM/Interop Interface, so I could inetgrate them in an old C++ App. If the user calls a dialog for the first time, the startup time is very slow. After it is Disposed and the user calls it again or the other dialog, the startup time is much more faster for each of them

I guess, the cause of this big time diference is, that something of .NET (like CLR/Interop) is starting up the first time. Perhaps somebody has an explanation for that behaviour and a solution to initialize the the .NET-Part from C++ at the beginning of my C++-App, so the first startup of one C#-dialog need no extra time

Thanks and regard
Ralf
 
Hi
This would happen if you still use the two forms as managed objects. The
thing is that when you first call one of them JIT compiler compiles the
object and keep it in memory. The second time you call it, no recompilation
is done so the time span is much shorter.
Still this is not expected in your situation. How do you implement this
COM/Interop Interface? Do you use AsmRrg.exe?

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Hi Mohamoss

thanks for your answer
My implemantation follows this way
Building the assemblies and the typelibraries, which are implemented with #import in c++ (visual studio 6.0). The Assemblies are registered with regasm.exe, the typelibraries are produced with tlbexp.exe
It is very confusing that after one call of any dialog, the first call of the other dialog is fast. The two Dialogs are organized in two assemblies! So the code of the second call has also to be JIT-compiled. Very Confusing!
 
Back
Top