Trying to understand calls to an external .dll

PJRoyle

Member
Joined
Jun 7, 2004
Messages
11
Location
Uckfield, East Sussex, UK
Programming Experience
10+
I have a 3rd-party product (as a .dll) for which I declare the functions in a similar way to the way it is done for the Windows API, eg "declare function Function_name lib "lib_name" (....)

For string variables, it seems to need them passed ByVal - if they are passed ByRef, it causes an error.

I thought if a variable was passed ByVal, the original copy of the variable was not accessible to the called function, so how on earth can it return a value in the variable?

It clearly is doing, because it works, but I cannot understand how it can work.

Can anyone explain this to me, please?

TIA,
Peter Royle
 
Back
Top