Hello,
I'm writing a Dll file that a customer needs for his Pascal
program. I'm fairly new to Dll file creation, and would appreciate
any assistance here. The customer would like to be able to write
his Pascal header/include file in the same standard format he's
accustomed to. There will be several simple functions in the PowerBasic
Dll that look like this:
Small arrays similar to this will be global to and operated on mostly from
within my Dll, as this is for a high speed physical simulation and it's
necessary to avoid as many function calls on his end as possible. Currently,
his Pascal declaration for a function like this appears as:
However, since a capitalized function declaration is unusual in his
work, he would like to declare it as follows:
The PowerBasic test version of the declaration (.Inc file) works fine and
looks like:
He suggested changing the function itself inside my DLL to include an
ALIAS as follows:
He hoped that the above change to my Dll function would enable
him to use mixed/lowercase letters in his Pascal declaration, i.e.:
However, when changing the Dll function to include the ALIAS, the
function does not appear to get called at all by my PowerBasic EXE test
program. If it is possible, how can I change the Dll function itself to
allow him to use the mixed case (Set_Array_Value) declaration on his end?
Thank you, and I hope you all had a wonderful holiday season and a
great New Year's Eve!!
Todd Wasson
Performance Simulations
Drag Racing and Top Speed
Prediction Software http://PerformanceSimulations.Com
P.S. I just tried the following Dll change and it worked through the PowerBasic test
EXE:
It seems that setting an ALIAS that exactly matches the function
name itself is pointless, and does not work. Would the customer's
following Pascal declaration work with the above Dll change?
------------------
[This message has been edited by Todd Wasson (edited December 31, 2000).]
I'm writing a Dll file that a customer needs for his Pascal
program. I'm fairly new to Dll file creation, and would appreciate
any assistance here. The customer would like to be able to write
his Pascal header/include file in the same standard format he's
accustomed to. There will be several simple functions in the PowerBasic
Dll that look like this:
Code:
FUNCTION Set_Array_Value (BYVAL Array_Index AS LONG,BYVAL Value AS SINGLE) EXPORT AS LONG Array_Value(Array_Index)= Value END FUNCTION
within my Dll, as this is for a high speed physical simulation and it's
necessary to avoid as many function calls on his end as possible. Currently,
his Pascal declaration for a function like this appears as:
Code:
function SET_ARRAY_VALUE(Array_Index: Integer; Value: Single): integer; stdcall; external 'The.dll';
work, he would like to declare it as follows:
Code:
function Set_Array_Value(Array_Index: Integer; Value: Single): integer; stdcall; external 'The.dll';
looks like:
Code:
DECLARE FUNCTION Set_Array_Value LIB "THE.DLL" (BYVAL Array_Index AS LONG, BYVAL Value AS SINGLE) AS LONG
ALIAS as follows:
Code:
FUNCTION Set_Array_Value ALIAS "Set_Array_Value" (BYVAL Array_Index AS LONG,BYVAL Value AS SINGLE) EXPORT AS LONG Array_Value(Array_Index)= Value END FUNCTION
him to use mixed/lowercase letters in his Pascal declaration, i.e.:
Code:
function Set_Array_Value(Array_Index: Integer; Value: Single): integer; stdcall; external 'the.dll';
function does not appear to get called at all by my PowerBasic EXE test
program. If it is possible, how can I change the Dll function itself to
allow him to use the mixed case (Set_Array_Value) declaration on his end?
Thank you, and I hope you all had a wonderful holiday season and a
great New Year's Eve!!
Todd Wasson
Performance Simulations
Drag Racing and Top Speed
Prediction Software http://PerformanceSimulations.Com
P.S. I just tried the following Dll change and it worked through the PowerBasic test
EXE:
Code:
FUNCTION Set_Array_Value ALIAS "SET_ARRAY_VALUE" (BYVAL Array_Index AS LONG,BYVAL Value AS SINGLE) EXPORT AS LONG Array_Value(Array_Index)= Value END FUNCTION
name itself is pointless, and does not work. Would the customer's
following Pascal declaration work with the above Dll change?
Code:
function Set_Array_Value(Array_Index: Integer; Value: Single): integer; stdcall; external 'the.dll';
[This message has been edited by Todd Wasson (edited December 31, 2000).]
Comment