Quote
Stephn Posey wrote:
>Actually the external directive usually goes in the
>implementation section.
Yes, I've tried that as well.
Quote
>I'm presuming your example is "simplified" as a void function
>taking no parameters would seem to be somewhat useless.
True; I stripped it down to that to be sure it wasn't just a problem
with type translation - I know C++ in particular refuses to recognise a
procedure name if you get one of the parameter types even slightly
wrong.
Having also seen Allessandro Allasio's earlier thread, I tried to mimic
his function as far as possible by adding to the C++[1]:
int FAR PASCAL _export intproc(int param)
{
return(param);
}
and in the Delphi form I have :
implementation
function intproc(param: integer) : integer; external 'params.dll';
plus an invocation of it lower down as follows:
Val := intproc(1);
No better; it still reports it can't find intproc.
I did wonder if it was finding another params.dll elsewhere, but
renaming the actuall .dll caused it to complain that it wasn't there, so
it can't be that.
The DLL in question is definitely 32 bit, but in turn uses another which
is 16bit. I don't see why this should be a problem though - at least not
at the stage of trying to find the exported routines.
I'd like to have a look at what's in the DLL, but at the moment all
I can think of is passing it through a 'strings' utility, which at least
demonstrates that the 'intproc' is there in some form. Are there any
tools which tell you what is in a DLL?
Anyway, at the moment I'm stuck - there are probably other ways round it
(such as doing the whole thing in C++), but I'm not that happy about
leaving it without at least an idea of what I'm doing wrong - these
unresolved questions have a habit of reappearing at even less
favourable times.
So - any ideas?
[1] The '++' is irrelevant here, but there is a class in there which
I was hoping to use later - probbaly that will bring its own
problems....