Looking_4_Answers
asked on
Delivering Delphi Component that works Design Time Only ?
Delphi 2010
I am writing a simple component for someone. I want to deliver it to them for testing purposes, but i want it to work in Design Time Only
How do i do this?
Please describe the steps please
thanks
I am writing a simple component for someone. I want to deliver it to them for testing purposes, but i want it to work in Design Time Only
How do i do this?
Please describe the steps please
thanks
The first test will tell you that Delphi is loaded, but not that your application is running from Delphi.
That is where the check of DebugHook global variable comes into play, that Delphi sets when integrated debugging is activated and you launch the application from Delphi.
If Delphi integrated debugging is deactivated, then there is no difference between your application launched from Delphi and from explorer while delphi is already loaded.
That is where the check of DebugHook global variable comes into play, that Delphi sets when integrated debugging is activated and you launch the application from Delphi.
If Delphi integrated debugging is deactivated, then there is no difference between your application launched from Delphi and from explorer while delphi is already loaded.
ASKER
"That is where the check of DebugHook global variable comes into play, that Delphi sets when integrated debugging is activated and you launch the application from Delphi.
If Delphi integrated debugging is deactivated, then there is no difference between your application launched from Delphi and from explorer while delphi is already loaded."
Please Elaborate......maybe with code?
If Delphi integrated debugging is deactivated, then there is no difference between your application launched from Delphi and from explorer while delphi is already loaded."
Please Elaborate......maybe with code?
ewangoya posted a code without explanation, I posted an explanation without code : both work together.
FindWindow('TAppBuilder', nil) >0 => Delphi is loaded somewhere
(DebugHook <> 0) => that application is running under a debugger.
Both condition at the same time => most certainly that application has been launched from delphi and is being debugged
FindWindow('TAppBuilder', nil) >0 => Delphi is loaded somewhere
(DebugHook <> 0) => that application is running under a debugger.
Both condition at the same time => most certainly that application has been launched from delphi and is being debugged
ASKER
Ok, ill try that part of it....but, I do not want to delliver the code for the compoenent. How do i deliever just the compiled stuff. Package, DCU's, etc
I have read sometime back that the Register procedure is only called in design mode. You can define a flag in your module and have your register procedure set that flag. If that flag is clear in your constructor then you are not in design mode.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you want the absolute certain way :
within your component you could find if you have access to the IDE
basically you can query the IDE with IOTA (Open Tools Api) interfaces from within your component
uses ToolsApi;
function CheckInIde: Boolean;
begin
Result := BorlandIdeServices <> nil;
end;
I think you need to add DesignEditors to your uses packages of your component
Don't have access to delphi here, i could test on monday
If you are looking for more such info, look for IOTA Delphi in google :)
within your component you could find if you have access to the IDE
basically you can query the IDE with IOTA (Open Tools Api) interfaces from within your component
uses ToolsApi;
function CheckInIde: Boolean;
begin
Result := BorlandIdeServices <> nil;
end;
I think you need to add DesignEditors to your uses packages of your component
Don't have access to delphi here, i could test on monday
If you are looking for more such info, look for IOTA Delphi in google :)
here is a simple wizard by Allen:
http://edn.embarcadero.com/article/20419
you even get access to the debugger ...
you could even post a message to the debugger window using IOTADebuggerServices;
http://edn.embarcadero.com/article/20419
you even get access to the debugger ...
you could even post a message to the debugger window using IOTADebuggerServices;
uses
Windows;
function IsInIDE: Boolean;
begin
Result := (FindWindow('TAppBuilder',
end;
in the initialization section
initialization
if not IsInIDE then
begin
MessageBox(0, 'Can only run in Delphi', 'Error', MB_OK);
Application.Terminate; //Halt
end;