AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein DLL einbinden Delphi7 vs Rad Studio 10.2
Thema durchsuchen
Ansicht
Themen-Optionen

DLL einbinden Delphi7 vs Rad Studio 10.2

Ein Thema von diso · begonnen am 9. Jun 2018 · letzter Beitrag vom 10. Jun 2018
 
diso

Registriert seit: 21. Sep 2007
6 Beiträge
 
#4

AW: DLL einbinden Delphi7 vs Rad Studio 10.2

  Alt 9. Jun 2018, 02:58
Sorry habe das bin Link geposted.. Sources: http://ngspice.sourceforge.net/ngspi..._src_delphi.7z

oder :
Code:
  ngspice_Init: function(ptrchar: Pointer; ptrstat: Pointer; ptrexit: Pointer;
                ptrdata: Pointer; ptrinitdata: Pointer; ptrnoruns: Pointer; userData: Pointer): integer; cdecl;
  ngspice_Com: function(ms: PChar): Integer; cdecl;
  ngspice_GetVec: function(ms: PChar): pVector_info; cdecl;
  ngspice_SendCirc: function(circarray: pcarray): Integer; cdecl;
  ngspice_GetCurPlot: function(): PChar; cdecl;
  ngspice_GetPlotNames: function(): ppansichararray; cdecl;
  ngspice_GetVecsFromPlot: function(plotname: PChar): ppansichararray; cdecl;
  ngspice_Running: function(): boolean; cdecl;
  ngspice_Init_Sync: function(ptrvsrcval: Pointer; ptrisrcval: Pointer; ptrsync: Pointer; ident: PInteger; userData: Pointer): integer; cdecl;
  ngspice_SetBkpt: function(simtime: double): boolean; cdecl;




// attach ngspice.dll and initialize ngspice
procedure TForm1.Button1Click(Sender: TObject);
var
   init_test: integer;
   ng_ident: integer;

begin
   // load dll
   Hdll := LoadLibrary(PChar(StartIni.ReadString('ngspice.dll', 'Path', '')));
   if (Hdll = 0) then
      // try local directory
      Hdll := LoadLibrary('ngspice.dll');
   if (Hdll <> 0) then
   begin
      @ngspice_Init := GetProcAddress(Hdll, 'ngSpice_Init');
      @ngspice_Com := GetProcAddress(Hdll, 'ngSpice_Command');
      @ngspice_GetVec := GetProcAddress(Hdll, 'ngGet_Vec_Info');
      @ngspice_SendCirc := GetProcAddress(Hdll, 'ngSpice_Circ');
      @ngspice_GetCurPlot := GetProcAddress(Hdll, 'ngSpice_CurPlot');
      @ngspice_GetPlotNames := GetProcAddress(Hdll, 'ngSpice_AllPlots');
      @ngspice_GetVecsFromPlot := GetProcAddress(Hdll, 'ngSpice_AllVecs');
      @ngspice_Running := GetProcAddress(Hdll, 'ngSpice_running');
      @ngspice_Init_Sync := GetProcAddress(Hdll, 'ngSpice_Init_Sync');
      @ngspice_SetBkpt := GetProcAddress(Hdll, 'ngSpice_SetBkpt');
      // call initialization
      // send addresses of callback functions, and address of sending object
      init_test := ngspice_Init(@ng_getchar, @ng_getstat, @ng_exit, @ng_data,
                                @ng_initdata, @ng_thread_runs, self);
//       init_test := ngspice_Init(@ng_getchar, nil, @ng_exit, @ng_data,
//                                @ng_initdata, @ng_thread_runs, self);
      if (init_test = 1) then
      begin
        detach(coquit);
      end;
      ng_ident := 5;
      init_test := ngspice_Init_Sync(@ng_sendvsrc, @ng_sendisrc,
                                     @ng_sync {nil} , @ng_ident, self);
      if (init_test = 1) then
      begin
        detach(coquit);
        is_attached := false;
      end;
      will_detach := False;
      is_attached := True;
   end
   else
   begin
     MessageDlg('ngspice.dll not found', mtError, [mbAbort], 0);
     Form1.Close;
   end;
end;
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:09 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz