Thema: Delphi Indy compile problem

Einzelnen Beitrag anzeigen

th_bone

Registriert seit: 16. Jun 2004
172 Beiträge
 
Delphi 2005 Professional
 
#3

Re: Indy compile problem

  Alt 11. Aug 2007, 13:01
Hi,

danke - da wäre ich im Leben nicht darauf gekommen das ";" am ende zu machen - ausgehend von Deinem vorschlag konnte ich
jetzt alles compilieren.

Es sieht so aus, dass die Compilerdirectiven nicht genutzt werden

Delphi-Quellcode:
  {$IFDEF WidgetVCLLikeOrKylix} 
     TIdPropEdBindingEntry = TIdDsnPropEdBindingVCL; // das hier wird nicht beachtet
  {$ENDIF}
Da ich für VCL compiliere hab ich mir jetzt mal so beholfen (vielleicht hilfts ja noch jemanden der sich am snapshot verucht)

Nochmals danke

Ralf

Delphi-Quellcode:
unit IdDsnPropEdBinding;

interface
 {$I IdCompilerDefines.inc}

{$IFDEF WidgetWinForms}
{$R 'IdDsnPropEdBindingNET.TIdDsnPropEdBindingNET.resources' 'IdDsnPropEdBindingNET.resx'}
{$ENDIF}
uses
  Classes,
  IdSocketHandle
  {$IFDEF WidgetWinForms}
  ,IdDsnPropEdBindingNET
  {$ENDIF}
  //{$IFDEF WidgetVCLLikeOrKylix}
  ,IdDsnPropEdBindingVCL
  //{$ENDIF}
  ;

{
Design Note:  It turns out that in DotNET, there are no services file functions and IdPorts
does not work as expected in DotNET.  It is probably possible to read the services
file ourselves but that creates some portability problems as the placement is different
in every operating system.

e.g.

Linux and Unix-like systems - /etc
Windows 95, 98, and ME - c:\windows
Windows NT systems - c:\winnt\system32\drivers\etc

Thus, it will undercut whatever benefit we could get with DotNET.

About the best I could think of is to use an edit control because
we can't offer anything from the services file in DotNET.

TODO:  Maybe there might be a way to find the location in a more eligant
manner than what I described.
}


type
(*
  {$IFDEF WidgetWinForms}
  TIdPropEdBindingEntry = TIdDsnPropEdBindingNET;
  {$ENDIF}
  {$IFDEF WidgetVCLLikeOrKylix}
*)

  TIdPropEdBindingEntry = TIdDsnPropEdBindingVCL;
// {$ENDIF}

procedure FillHandleList(const AList: string; ADest: TIdSocketHandles);
function GetListValues(const ASocketHandles : TIdSocketHandles) : String;

implementation
(*
{$IFDEF WidgetWinForms}
procedure FillHandleList(const AList: string; ADest: TIdSocketHandles);
begin
  IdDsnPropEdBindingNET.FillHandleList(AList,ADest);
end;

function GetListValues(const ASocketHandles : TIdSocketHandles) : String;
begin
  Result := IdDsnPropEdBindingNET.GetListValues(ASocketHandles);
end;
{$ENDIF}
{$IFDEF WidgetVCLLikeOrKylix}
*)

procedure FillHandleList(const AList: string; ADest: TIdSocketHandles);
begin
   IdDsnPropEdBindingVCL.FillHandleList(AList,ADest);
end;

function GetListValues(const ASocketHandles : TIdSocketHandles) : String;
begin
   Result := IdDsnPropEdBindingVCL.GetListValues( ASocketHandles);
end;
// {$ENDIF}
end.
P.S. folgende unit musste ich auch noch nach demselben schema ändern, um Indy snapshot komplett zu installieren

Delphi-Quellcode:
unit IdDsnSASLListEditorForm;

interface

{$I IdCompilerDefines.inc}

uses
  {$IFDEF WidgetWinforms}
  Classes,
  IdDsnSASLListEditorFormNET;
  {$R 'IdDsnSASLListEditorFormNET.TfrmSASLListEditor.resources' 'IdDsnSASLListEditorFormNET.resx'}
  {$ENDIF}
  //{$IFDEF WidgetVCLLikeOrKylix}
  IdDsnSASLListEditorFormVCL;
  //{$ENDIF}

type
  {$IFDEF WidgetWinforms}
  //we make a create here because I'm not sure how the Visual Designer for WinForms
  //we behave in a package. I know it can act weird if something is renamed
  TfrmSASLListEditor = class(IdDsnSASLListEditorFormNET.TfrmSASLListEditor)
  public
    constructor Create(AOwner : TComponent);
  end;
  {$ENDIF}
  //{$IFDEF WidgetVCLLikeOrKylix}
  TfrmSASLListEditor = class(TfrmSASLListEditorVCL);
  //{$ENDIF}

implementation

{$IFDEF WidgetWinForms}
constructor TfrmSASLListEditor.Create(AOwner : TComponent);
begin
  inherited Create;
end;
{$ENDIF}
end.
  Mit Zitat antworten Zitat