Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo Hace 1 Semana
wilcg wilcg is offline
Miembro
 
Registrado: abr 2014
Posts: 91
Poder: 5
wilcg Va por buen camino
Uso de .DLL c# en delphi

Buen día amigos,
Les comento tengo una .dll c# de la cual quiero usar unos procedimientos de ella, pero he tenido complicaciones al momento de implimentarla en delphi.
he importado la .dll pero no encuentro la forma de usar el procedimiento, soy nuevo en este tipo de implementación y necesito su ayuda.
Código Delphi [-]
unit FXML_TLB;

// ************************************************************************ //
// WARNING                                                                    
// -------                                                                    
// The types declared in this file were generated from data read from a       
// Type Library. If this type library is explicitly or indirectly (via        
// another type library referring to this type library) re-imported, or the   
// 'Refresh' command of the Type Library Editor activated while editing the   
// Type Library, the contents of this file will be regenerated and all        
// manual modifications will be lost.                                         
// ************************************************************************ //

// $Rev: 52393 $
// File generated on 14/03/2019 03:11:39 p. m. from Type Library described below.

// ************************************************************************  //
// Type Lib: E:\PROYECTOS-Software\App\C#\Librerias\FXML\FXML\FXML\bin\Debug\FXML.tlb (1)
// LIBID: {BDAD580F-3986-4941-B00F-BED3DAABE135}
// LCID: 0
// Helpfile: 
// HelpString: 
// DepndLst: 
//   (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb)
//   (2) v2.4 mscorlib, (C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb)
// SYS_KIND: SYS_WIN32
// Errors:
//   Error creating palette bitmap of (TCFXML) : Server mscoree.dll contains no icons
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
{$ALIGN 4}

interface

uses Winapi.Windows, mscorlib_TLB, System.Classes, System.Variants, System.Win.StdVCL, Vcl.Graphics, Vcl.OleServer, Winapi.ActiveX;
  


// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:        
//   Type Libraries     : LIBID_xxxx                                      
//   CoClasses          : CLASS_xxxx                                      
//   DISPInterfaces     : DIID_xxxx                                       
//   Non-DISP interfaces: IID_xxxx                                        
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  FXMLMajorVersion = 1;
  FXMLMinorVersion = 0;

  LIBID_FXML: TGUID = '{BDAD580F-3986-4941-B00F-BED3DAABE135}';

  IID__CFXML: TGUID = '{F363CEDB-6C8C-393B-B124-5B785E445D2A}';
  IID_IFXML: TGUID = '{143763CA-C3D3-4F93-863F-63DD2CA1228C}';
  CLASS_CFXML: TGUID = '{B00E8B03-B374-42C7-A76A-4D51545027E0}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
  _CFXML = interface;
  _CFXMLDisp = dispinterface;
  IFXML = interface;
  IFXMLDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                       
// (NOTE: Here we map each CoClass to its Default Interface)              
// *********************************************************************//
  CFXML = _CFXML;


// *********************************************************************//
// Interface: _CFXML
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {F363CEDB-6C8C-393B-B124-5B785E445D2A}
// *********************************************************************//
  _CFXML = interface(IDispatch)
    ['{F363CEDB-6C8C-393B-B124-5B785E445D2A}']
    function Get_ToString: WideString; safecall;
    function Equals(obj: OleVariant): WordBool; safecall;
    function GetHashCode: Integer; safecall;
    function GetType: _Type; safecall;
    property ToString: WideString read Get_ToString;
  end;

// *********************************************************************//
// DispIntf:  _CFXMLDisp
// Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
// GUID:      {F363CEDB-6C8C-393B-B124-5B785E445D2A}
// *********************************************************************//
  _CFXMLDisp = dispinterface
    ['{F363CEDB-6C8C-393B-B124-5B785E445D2A}']
    property ToString: WideString readonly dispid 0;
    function Equals(obj: OleVariant): WordBool; dispid 1610743809;
    function GetHashCode: Integer; dispid 1610743810;
    function GetType: _Type; dispid 1610743811;
  end;

// *********************************************************************//
// Interface: IFXML
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {143763CA-C3D3-4F93-863F-63DD2CA1228C}
// *********************************************************************//
  IFXML = interface(IDispatch)
    ['{143763CA-C3D3-4F93-863F-63DD2CA1228C}']
    procedure FirmaXML(const path_cert: WideString; const pass_cert: WideString; 
                       const path_xml: WideString; const path_guardar: WideString); safecall;
  end;

// *********************************************************************//
// DispIntf:  IFXMLDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {143763CA-C3D3-4F93-863F-63DD2CA1228C}
// *********************************************************************//
  IFXMLDisp = dispinterface
    ['{143763CA-C3D3-4F93-863F-63DD2CA1228C}']
    procedure FirmaXML(const path_cert: WideString; const pass_cert: WideString; 
                       const path_xml: WideString; const path_guardar: WideString); dispid 1610743808;
  end;

// *********************************************************************//
// The Class CoCFXML provides a Create and CreateRemote method to          
// create instances of the default interface _CFXML exposed by              
// the CoClass CFXML. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoCFXML = class
    class function Create: _CFXML;
    class function CreateRemote(const MachineName: string): _CFXML;

    class function Create: IFXML;
    class function CreateRemote(const MachineName: string): IFXML;
  end;


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TCFXML
// Help String      : 
// Default Interface: _CFXML
// Def. Intf. DISP? : No
// Event   Interface: 
// TypeFlags        : (2) CanCreate
// *********************************************************************//
  TCFXML = class(TOleServer)
  private
    FIntf: _CFXML;
    function GetDefaultInterface: _CFXML;
  protected
    procedure InitServerData; override;
    function Get_ToString: WideString;
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: _CFXML);
    procedure Disconnect; override;
    function Equals(obj: OleVariant): WordBool;
    function GetHashCode: Integer;
    function GetType: _Type;
    property DefaultInterface: _CFXML read GetDefaultInterface;
    property ToString: WideString read Get_ToString;
  published
  end;

procedure Register;

resourcestring
  dtlServerPage = 'ActiveX';

  dtlOcxPage = 'ActiveX';

implementation

uses System.Win.ComObj;

class function CoCFXML.Create: _CFXML;
begin
  Result := CreateComObject(CLASS_CFXML) as _CFXML;
end;

class function CoCFXML.CreateRemote(const MachineName: string): _CFXML;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_CFXML) as _CFXML;
end;

procedure TCFXML.InitServerData;
const
  CServerData: TServerData = (
    ClassID:   '{B00E8B03-B374-42C7-A76A-4D51545027E0}';
    IntfIID:   '{F363CEDB-6C8C-393B-B124-5B785E445D2A}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

procedure TCFXML.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    Fintf:= punk as _CFXML;
  end;
end;

procedure TCFXML.ConnectTo(svrIntf: _CFXML);
begin
  Disconnect;
  FIntf := svrIntf;
end;

procedure TCFXML.DisConnect;
begin
  if Fintf <> nil then
  begin
    FIntf := nil;
  end;
end;

function TCFXML.GetDefaultInterface: _CFXML;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
  Result := FIntf;
end;

constructor TCFXML.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;

destructor TCFXML.Destroy;
begin
  inherited Destroy;
end;

function TCFXML.Get_ToString: WideString;
begin
  Result := DefaultInterface.ToString;
end;

function TCFXML.Equals(obj: OleVariant): WordBool;
begin
  Result := DefaultInterface.Equals(obj);
end;

function TCFXML.GetHashCode: Integer;
begin
  Result := DefaultInterface.GetHashCode;
end;

function TCFXML.GetType: _Type;
begin
  Result := DefaultInterface.GetType;
end;

procedure Register;
begin
  RegisterComponents(dtlServerPage, [TCFXML]);
end;

end.
Este es el procedimiento que deseo usar
Código Delphi [-]
  IFXML = interface(IDispatch)
    ['{143763CA-C3D3-4F93-863F-63DD2CA1228C}']
    procedure FirmaXML(const path_cert: WideString; const pass_cert: WideString; 
                       const path_xml: WideString; const path_guardar: WideString); safecall;
  end;
Responder Con Cita
  #2  
Antiguo Hace 1 Semana
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 28.962
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
Mira estos hilos (1 y 2), creo que te pueden servir.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 13:51:29.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi