by Roger Seiler » Wed Mar 05, 2008 2:17 pm
Colin and Dutch,
As you can see from the Rmc4Fwh.prg file, this implementation of Fivewin's DLL32 command is still a work in progress. Many of the DLL32 commands don't work yet (won't even compile!) because they include arrays that aren't yet handled correctly. Perhaps you can work on that part of it - I will work on some more myself when I have time. As yet, I don't have any working samples using Rmchart.dll - so this is REALLY a work in progress! But I'm sure it will work once the problem of how to handlle the arrays is solved correctly.
The array structures are all described in the commented-out VB code in the top third of the prg. I'm not sure how to "type" them in the command, because in the VB code they seem to have been given a type specification in a format not mentioned in the DLL32 documentation. In this case we get a name for the array "T" then "AS" then a name referring to the array's design, followed by PTR. I just can't seem to get that to work yet with Fivewin's DLL32.
Can someone with more experience with DLL32 give us some guidance on this?
Here is a sample of the code we're working with - first the VB-BSC original and then my translation to FWH:
VB-BSC original:
// Here is the layout of an array to be used, as defined in the
// original BSC code sample shipped with Rmchart:
' ***** RMC_AddCaptionI() *****
TYPE tRMC_CAPTION
nBackColor AS LONG
nTextColor AS LONG
nFontSize AS LONG
nIsBold AS LONG
sText[200] AS CHAR
END TYPE
// Here is how the function is stated in the BSC code:
DECLARE FUNCTION RMC_AddCaptionI LIB "RMCHART.DLL" ( _
nCtrlID AS LONG, _
nRegion AS LONG, _
T AS tRMC_CAPTION PTR _
) AS LONG
//--------------------------------------------
// Now for my translation of the above BSC function call to FWH,
// which does not work:
DLL32 FUNCTION RMC_AddCaptionI( ;
nCtrlID AS LONG, ;
nRegion AS LONG, ;
@T AS tRMC_CAPTION PTR ;
) AS LONG PASCAL LIB "RMCHART.DLL"
// ( tRMC_CAPTION, above, is a name representing the
// layout of the array.)
------------------------------------
Fivewin's DLL32 allows the following data types:
BYTE, CHAR WORD, BOOL, HANDLE, HWND, HDC LONG, STRING, LPSTR, PTR, DOUBLE
What is the correct way to use these types in order to translate the BSC code...
"T AS tRMC_CAPTION PTR"
into part of a Fivewin DLL32 command?
If we can figure this out, then I should be able to quickly fix all 130+ of the Rmchart DLL32 function calls so that they will work.
Then we should be able to dance nicely with Rmchart in Fivewin!
- Roger