Einzelnen Beitrag anzeigen

tony.huerlimann

Registriert seit: 15. Dez 2010
6 Beiträge
 
Delphi 2010 Enterprise
 
#4

AW: load a dll at run-time

  Alt 28. Nov 2013, 08:19
problem resolved
Ed Rothberg from Gurobi gave me the answer that I can post here. He wrote:

The answer is contained in this Stack Overflow post...
http://stackoverflow.com/questions/1...nd-twebbrowser

The
quick summary: 1.0/0.0 gives a +Inf result in nearly every language.
In Delphi, it gives an exception. There's something in your input data
that is causing a divide-by-zero within the Gurobi library.
If
you send us 'ALUAM.mps', we can look at where the divide-by-zero is
coming from. The simple fix is to turn off divide-by-zero exceptions in
Delphi (SetExceptionMask(GetExceptionMask()+ [exZeroDivide]).
Ed
I checked it out. In the Delphi code above. I added the instruction before LoadLibrary() as follows. Add also "Math" in the uses list:


Delphi-Quellcode



begin
SetExceptionMask(GetExceptionMask() + [exZeroDivide]);
h:=LoadLibrary('C:/gurobi550/win64/bin/gurobi55.dll');
.....



Thank you Ed
Tony
  Mit Zitat antworten Zitat