Calling External DLL Code

You can use the Pascal calling convention to write code that calls external DLL code. Siebel VB pushes the arguments on the stack from left to right. It uses the Far reference to pass these arguments, by default. You can write code that uses the following keywords when it calls external DLL code:

  • ByVal. Passes a value through a variable. Note the following:
    • You must specify ByVal before you specify the argument that it modifies.

    • If you apply ByVal to a numeric data type, then Siebel VB passes the argument through a variable, not through a reference.

    • If you apply ByVal to a string data type, then Siebel VB passes the byFar pointer to the string data. It uses the byFar pointer to pass a string to a string descriptor, by default.

      For more information, see Pass Values Through Reference.

  • Any. Passes a value of any datatype. If you use Any for an argument, then Siebel VB does not examine the type of this argument. It does examine the type of any other argument that you do not specify as type Any. It uses the Far reference to pass the argument unless you specify the ByVal keyword. If you specify the ByVal keyword, then it does one of the following:
    • Numeric data. Places the value on the stack.

    • String data. Sets the pointer to the string.

The external DLL code must determine the type and size of the value.

If Siebel VB uses ByVal to pass a null string, then the external code receives a nonNULL character of 0. To send a NULL pointer, you must declare the argument as ByVal As Any, and then call the code with an argument of 0.