2008/12/10 Ireneusz Wygl?da?a :
Show quoted text 5 lines
So. I should use defines {IFDEF ... and two different methods for both OS?
I had hopes that exist one universal way to use mailto: ?
OK. I do it.
Thanks a lot.
What I have done, is to abstract that those calls, so my application doesn't need to contain the IFDEF's. I have one "utilities" unit that contains any IFDEF and *no* other place.
Something like the following
-------[ MyCoolUtilitiesUnit.pas ]--------------
uses
{ifdef windows}
MyWindowsUtilities,
{endif}
{ifdef unix}
MyUnixUtilities,
{endif}
SysUtils;
functions SendEmai(....): integer;
begin
{ifdef windows}
WindowsSendEmail(...); // <--- located in MyWindowsUtilities unit
{endif}
{ifdef unix}
UnixSendEmail(...); // <--- located in MyUnixUtilities unit
{endif}
end
So now anywhere in your application you can simply include the 'MyCoolUtilitiesUnit' in the uses clause and call SendEmail() - without IFDEF. :-)
One can't always avoid ifdef's but you can limit them to a single unit in your application.
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/