Autor Beitrag
peeage
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50



BeitragVerfasst: So 17.08.08 17:11 
Hallo Zusammen..

Habe hier eine C++ DLL welche ich in meinem Programm nutzen möchte. Diese DLL beinhaltet eine Funktion mit folgendem Aufruf:

ausblenden C#-Quelltext
1:
SWIrecFuncResult SWIrecInit ( const wchar_t *path );					



Ich habe das in Delphi folgender Maßen umgesetzt:

ausblenden Delphi-Quelltext
1:
function SWIrecInit( const pPath: PWideChar ) : Integer; CDECLExternal 'SWIrec.dll';					



... laut Herstellerdoku kann man als pPath auch NULL ( in Delphi NIL ) übergeben. Wenn ich die Funktion nun folgendermaßen aufrufe:

ausblenden Delphi-Quelltext
1:
SWIrecInit( nil );					


... bekomm ich die Fehlermeldung: EZeroDevide (Gleitkommadivision durch Null ).

Der Debugger hängt auf folgender Zeile fest:

fstp dword ptr [esi+eax*4]




Hat irgendeiner Ahnung ob ich etwas falsch mache?


Gruß, Martin


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am So 17.08.2008 um 23:01
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Sa 30.08.08 15:09 
ohne quelltext der Bibliothek ein recht aussichtloses unterfangen.
Es sei denn, du kennst dich mit einem (dis-)assembler aus.
Msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
Mario1988
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Fr 02.09.11 16:40 
perhaps it is late for you, but my answer could be useful for somebody else facing the same problem.

To day I had the divide by zero exception, invoking method SWIrecInit belonging to the dll SWIrec.dll (ver. 9.0.3.7353) with Borland C++ builder 6.

Using Microsoft VC++ 6 the problem does not appear but simply because Microsoft compiler suppresses the exception

The only way I had to make it work with Borland was to suppress the exception in the following way.

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
_control87(MCW_EM, MCW_EM);
}

don't forget to include float.h

regards

Moderiert von user profile iconNarses: C#-Tags hinzugefügt