LibraryCall

This method enables a script to access a custom DLL to perform functions not available through standard scripting.

Syntax

MC.LibraryCall(LibName, FuncName [,param]*)

Example

Result = MC.LibraryCall(LibName, FuncName [,param]*)

Remarks

First, the method checks for security  to verify that the DLL has been properly registered for access by means of pASP scripting. An accessible DLL must have a registry entry in \HKLM\Software\Microsoft\Mobile Channels\Components, matching the name of the DLL.

Once LibraryCall verifies the DLL, LibraryCall dynamically loads the DLL by calling the GetProcAddress function. GetProcAddress also finds the function specified in FuncName. Up to eight additional parameters listed in [param] are then marshaled and passed to the DLL function.

The function should be declared in the DLL in the following manner:

LPTSTR LibCallFn(WORD wNumArgs, LPTSTR pArgs[])

where LibCallFn is the name of the function specified in LibraryCall. LibCallFn should also be declared by name in the EXPORTS section of the .DEF file of the DLL. The calling convention for this function is _cdecl.

If the return value for the DLL function is NULL, LibraryCall returns 0. Otherwise, LibraryCall returns the LPSTR string itself as a standard pASP string value.