Subject: TRACE very slow in /clr enabled MFC projects

W

WJ

I have enabled the /clr options in some legacy MFC projects (because I needed
to use the .NET features). The TRACE macro are running VERY slow comparing
the the old versions (that have no /clr turned on).

Is there a work around for this? Thanks.

WJ
 
B

Ben Voigt [C++ MVP]

WJ said:
I have enabled the /clr options in some legacy MFC projects (because
I needed to use the .NET features). The TRACE macro are running VERY
slow comparing the the old versions (that have no /clr turned on).

Is there a work around for this? Thanks.

Use TRACE in the unmanaged code, System::Diagnostics::Trace::WriteLine in
the managed code, and #pragma managed to make sure you know where the
managed/unmanaged transitions are.

Otherwise every use of TRACE would force at least one managed/unmanaged
transition, maybe more.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top