Einzelnen Beitrag anzeigen

gmc616

Registriert seit: 25. Jun 2004
Ort: Jena
627 Beiträge
 
Delphi 10.3 Rio
 
#3

AW: OLE Anbindung mi David3

  Alt 23. Sep 2021, 19:49
... weil ich grad über diesen Thread stolpere , auf der Suche nach einem ähnlichen Thema.
Meine "Fast-Connect-Methode":
Delphi-Quellcode:
var
  goApp: IApplication;
  goAccount : Account = nil;
  g_hr : HResult;
  g_v : OleVariant;

function fktDV_FastConnect () : boolean;
var
  bRet : boolean;
begin

  if goAccount = nil then
  begin
    bRet := false;

    g_hr := CLSIDFromString('DVOBJAPILib.DvISEAPI', gDVAPP_clsid);
    if not FAILED(g_hr) then
    begin
      g_hr := CoCreateInstance(gDVAPP_clsid, Nil, CLSCTX_INPROC_SERVER,IID_IApplication, goApp);
      if not FAILED(g_hr) then
      begin
        VariantInit(g_v);
        OleCheck( g_hr );

        try
          goAccount:=goApp.Logon (g_v, g_v, g_v, g_v, g_v, 'AUTH');
          bRet := True;
        except
          bRet := false;
        end;

      end;
    end;
  end;
  result := bRet;
end;
... funktioniert seit David-7 bis David-13.

Hoffe es hilft.
  Mit Zitat antworten Zitat