BigInch
Petroleum
- Jun 21, 2006
- 15,161
I've beem trying for a week to access a dll function while running Excel/VBA. This function is contained in a 3rd party dll (not a MS product). The name of this old DLL is "sai.dll" I believe it was written in C around 1998-2000. After trying all the calling options using almost all the longs and pointers and StrPtr() and VarPtr() values I can permutate, I get error messages ranging from "Cannot find cdr entry point in the dll" to a total shutdown of Excel.
LIBRARY "Sai"
The Library export list shows only
cdr_ @1
The only description of the function in the documentation is,
void cdr(const char *case, int *ier)
The Arguments,
*case In VBA this will be a string representing an analysis case name, such as "SAramcoThermal" or similar
*ier An error value, as returned by cdr(), supposedly 0, -1, etc.
In the documented descriptions, the function is referred to as "cdr", yet in the export list and a disassembler view it shows us as "cdr_", note the trailing underscore, which confuses me. What's that about?
And my real question is, does anybody have any ideas on how I should declare this function in VBA/Excel, and perhaps make a class wrapper or do something that will give Excel that returned value?
In any case, thanks for having a look.
Independent events are seldomly independent.
LIBRARY "Sai"
The Library export list shows only
cdr_ @1
The only description of the function in the documentation is,
void cdr(const char *case, int *ier)
The Arguments,
*case In VBA this will be a string representing an analysis case name, such as "SAramcoThermal" or similar
*ier An error value, as returned by cdr(), supposedly 0, -1, etc.
In the documented descriptions, the function is referred to as "cdr", yet in the export list and a disassembler view it shows us as "cdr_", note the trailing underscore, which confuses me. What's that about?
And my real question is, does anybody have any ideas on how I should declare this function in VBA/Excel, and perhaps make a class wrapper or do something that will give Excel that returned value?
In any case, thanks for having a look.
Independent events are seldomly independent.