PC Review


Reply
Thread Tools Rate Thread

Slow startup of .Net COM server application.

 
 
clintp@gmail.com
Guest
Posts: n/a
 
      23rd May 2005
I have a C++ program that's calling a .Net DLL that's been set up as a
COM server. From C++ I call:

INoteTaker *cpi = NULL;
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_NoteTaker,
NULL, CLSCTX_INPROC_SERVER,
IID_INoteTaker, reinterpret_cast<void**>(&cpi));

And in the C# I've got a simple constructor:

namespace SpecialistNoteTaker
{
[Guid("C6AC0ADE-2616-48cf-B57F-354A566E8D02")]
public class NoteTaker : INoteTaker
{
public NoteTaker()
{
Console.WriteLine("Constructor called.");
}
}
}

The problem is that it takes a long, long time (8 seconds) for the
constructor to get called and the CoCreateInstance to return. The
hangup seems to be when loading DLL's for the Framework:


'SNTTest.exe': Loaded
'C:\projects\pr1\COMInterop\SpecialistNoteTaker\bin\Debug\SpecialistNoteTaker.dll',
No native symbols in symbol file. 'SNTTest.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorjit.dll', No symbols
loaded.
[Up to here, loads quickly then a loooong pause]
'SNTTest.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\diasymreader.dll', No
symbols loaded.
[And then everthing else loads quickly]

I need a way to start this COM application very quickly and avoid this
long pause. It's not so important that the COM be started fast, but I
can't have the C++ waiting around for the framework to get itself
bootstrapped.

Starting the application directly from the debugger (not through COM)
is very fast.

The C++ is most definately not thread-safe. There's a mix of C++ and C
in the body of the code and I don't want to go that route.

Suggestions?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow Startup/Shutdown and Slow Application Load Times =?Utf-8?B?Um9i?= Windows XP Performance 2 10th Feb 2007 08:26 PM
Slow application startup Roland Wolters Microsoft C# .NET 4 27th Jul 2005 10:34 PM
Slow application startup Bill Murphy Microsoft Access Form Coding 0 18th Jul 2004 12:56 AM
Access application - very slow startup JF Microsoft Access 3 26th Feb 2004 12:28 AM
Slow Application Startup lukas Microsoft Word New Users 0 24th Oct 2003 04:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:59 PM.