Shut CodeSite off

Have a CodeSite question that doesn't fit into any of the forums below? Post it here.

Shut CodeSite off

Postby MikevTaos » Mon Nov 07, 2011 10:15 am

I used CodeSite to help debug a problem, but now I cannot seem to get it disabled in the app. The LiveViewer starts up even when I start my Delphi XE app outside of the IDE.

I have stopped the dispatcher manually and set the project for "Release" instead of "Debug", and I have the following code in my project file:
uses
Forms,
CodeSiteLogging,
.
.
.

Application.Initialize;
{$IFDEF DEBUG}
CodeSite.Enabled := True;
CodeSite.Clear;
{$ELSE}
CodeSite.Enabled := False;
{$ENDIF}
Application.MainFormOnTaskbar := False;
Application.Title := 'g3';
Application.CreateForm(Tfrmg3Main, frmg3Main);
if not (frmg3Main.DoRunApplication) then
begin
application.terminate;
exit;
end;
Application.CreateForm(TDM1, DM1);
Application.Run;
// end of code maintained by Delphi
end

I would like to keep the Dispatcher from starting and keep the Viewer from appearing. What am I missing?
MikevTaos
 
Posts: 13
Joined:
Tue Nov 01, 2011 10:38 pm

Re: Shut CodeSite off

Postby Raize Support » Mon Nov 07, 2011 3:33 pm

You can definitely prevent the Dispatcher and Live Viewer from starting when you application is running. However, there are a couple of things to keep in mind. First, the first statement after the begin in the project source file is not the first line of code that is executed in your application. The initialization sections for any units that your program uses will be called. So, the first thing to do is to check to see if your are sending any CodeSite messages in the initialization sections of one or more units.

Also, CodeSite supports multiple loggers. That is, instances of the TCodeSiteLogger class. The CodeSite object is a global instance of the TCodeSiteLogger class that gets automatically created for you.

If you are using multiple loggers, then to turn them ALL off, set the CodeSiteManager.Enabled property to False. Setting CodeSite.Enabled to False just turns off the global CodeSite object.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 453
Joined:
Fri Mar 25, 2011 9:04 pm

Re: Shut CodeSite off

Postby MikevTaos » Mon Nov 07, 2011 7:10 pm

My bad. I had failed to activate the Release build-configuration, so DEBUG was defined. D'oh!
MikevTaos
 
Posts: 13
Joined:
Tue Nov 01, 2011 10:38 pm


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron