Hi,
I'm using PBCC 5.01, and would like to use some of the functions available from JPSoftware's 4NT8 product.
I have no problem using the functions from Delphi 2.0, but I must be missing something simple when calling from PBCC 5.01. Here's some sample code that I'm working with;
I'm getting a "Parameter mismatches definition" error at
I've been looking at the screen for too long, so it's probably something simple. Constructive suggestions welcome.
Thanks from Joe
I'm using PBCC 5.01, and would like to use some of the functions available from JPSoftware's 4NT8 product.
I have no problem using the functions from Delphi 2.0, but I must be missing something simple when calling from PBCC 5.01. Here's some sample code that I'm working with;
Code:
#COMPILE EXE #DIM ALL 'The following comments are from the [URL="ftp://ftp.jpsoft.com/sdk/sdk.zip"]Plugin SDK[/URL] from JPSoft; 'From takecmd.h ' 'void WINAPI AddCommas( LPTSTR pszNumber ); '/* ' Insert thousands separators in pszNumber '*/ '3.3 Some functions in TakeCmd.dll manipulate the string that you pass to them ' within the buffer in which the string resides. Therefore, if the ' TakeCmd.dll function can return a longer string than is passed to it, you ' must make sure that you pass the string in a buffer that is large enough ' to provide working space and to hold the returned string if appropriate. ' An example of such a function is: ' void WINAPI AddCommas( LPTSTR pszNumber ); ' which inserts the thousands separator into the supplied number. In ' Delphi this would be declared as: ' procedure AddCommas(Arguments: PWideChar); stdcall; external 'TakeCmd.dll'; ' When this procedure adds in the thousands separator the resulting string ' will be longer than the string that you started with, and so you must ' allow room for that expansion. The size of the buffer that you need ' cannot be precisely defined, and you may need to experiment. However, as ' a guideline I would suggest a buffer of at least three times the length ' of the string that you are passing to the function. DECLARE FUNCTION AddCommas LIB "TakeCmd.dll" _ ALIAS "AddCommas" _ (lpstr AS STRING) AS STRING FUNCTION PBMAIN () AS LONG DIM TheString AS STRING * 512 TheString = "12345678" AddCommas TheString PRINT TheString END FUNCTION
Code:
AddCommas TheString
Thanks from Joe
Comment