DLL32 problem
- Roger Seiler
- Posts: 223
- Joined: Thu Dec 01, 2005 3:34 pm
- Location: Nyack, New York, USA
- Contact:
DLL32 problem
Antonio,
I get an "error Base/1003 variable does not exst LPLONG" when calling a dll function via DLL32. I notice that in the fwcmd.chm docs, in the explanation for DLL32 it does not list LPLONG as a data type, though it does list LPSTR. Insofar as this seems to be a common C datatype, can LPLONG be added as a valid data type used in a C function that is included in a DLL?
Specifically, I'm getting this error with the Protection PLUS function calls to its 32 bits DLL when using the command DLL32. For example:
DLL32 FUNCTION pp_checksum(filename AS LPSTR, checksum AS LPLONG) AS LONG PASCAL LIB "keylib32.dll"
- Roger
I get an "error Base/1003 variable does not exst LPLONG" when calling a dll function via DLL32. I notice that in the fwcmd.chm docs, in the explanation for DLL32 it does not list LPLONG as a data type, though it does list LPSTR. Insofar as this seems to be a common C datatype, can LPLONG be added as a valid data type used in a C function that is included in a DLL?
Specifically, I'm getting this error with the Protection PLUS function calls to its 32 bits DLL when using the command DLL32. For example:
DLL32 FUNCTION pp_checksum(filename AS LPSTR, checksum AS LPLONG) AS LONG PASCAL LIB "keylib32.dll"
- Roger
- Roger Seiler
- Posts: 223
- Joined: Thu Dec 01, 2005 3:34 pm
- Location: Nyack, New York, USA
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Roger Seiler
- Posts: 223
- Joined: Thu Dec 01, 2005 3:34 pm
- Location: Nyack, New York, USA
- Contact:
Antonio,
Do you mean that I can insert a C function into an FWH prg by:
1. preceding it with the line #pragma BEGINDUMP
2. then write in a line with the C function, and then
3. follow it with the line #pragma ENDDUMP, and then
4. continue with my FWH code?
Or does the C code have to be in a separate prg?
And if #pragma enables mixing C code with FWH code, are the variables used in the C function directly visible to the rest of the FWH code?
(Obviously, I'm not much of a C programmer or I'd already know this. I've never used the #pragma capability before, so I'm learning something new here.)
Thanks!
- Roger
Do you mean that I can insert a C function into an FWH prg by:
1. preceding it with the line #pragma BEGINDUMP
2. then write in a line with the C function, and then
3. follow it with the line #pragma ENDDUMP, and then
4. continue with my FWH code?
Or does the C code have to be in a separate prg?
And if #pragma enables mixing C code with FWH code, are the variables used in the C function directly visible to the rest of the FWH code?
(Obviously, I'm not much of a C programmer or I'd already know this. I've never used the #pragma capability before, so I'm learning something new here.)
Thanks!
- Roger
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
PRAGMA
Antonio,
I've been looking at the samples and it would appear your suggestion involves placing C code directly into FWH.
Our need is to call a C function in a DLL. The problem we encounter is the Data Type LPLONG is not supported in FWH.
So, the following call:
nReturn := pp_lfopen( 'test.lf', LFOPEN_NOCACHE, LF_FILE, 'password', nLFhandle )
With the following DLL:
DLL32 Function pp_lfopen( filename As LPSTR, lfflags As LONG, lftype As LONG, password As LPSTR, handle As LPLONG) As LONG PASCAL LIB "Keylib32.dll"
Will return the error Undefined LPLONG
Can you give a quick sample of how to access the function in the DLL ... and then we can rewrite all the functions in the same manner and make the result to other FWH users who wish to access the current SoftwareKey libraries.
Thank you ...
I've been looking at the samples and it would appear your suggestion involves placing C code directly into FWH.
Our need is to call a C function in a DLL. The problem we encounter is the Data Type LPLONG is not supported in FWH.
So, the following call:
nReturn := pp_lfopen( 'test.lf', LFOPEN_NOCACHE, LF_FILE, 'password', nLFhandle )
With the following DLL:
DLL32 Function pp_lfopen( filename As LPSTR, lfflags As LONG, lftype As LONG, password As LPSTR, handle As LPLONG) As LONG PASCAL LIB "Keylib32.dll"
Will return the error Undefined LPLONG
Can you give a quick sample of how to access the function in the DLL ... and then we can rewrite all the functions in the same manner and make the result to other FWH users who wish to access the current SoftwareKey libraries.
Thank you ...
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: PRAGMA
Try:
EMG
Code: Select all
nReturn := pp_lfopen( 'test.lf', LFOPEN_NOCACHE, LF_FILE, 'password', @nLFhandle )
Code: Select all
DLL32 Function pp_lfopen( filename As LPSTR, lfflags As LONG, lftype As LONG, password As LPSTR, @handle As PTR) As LONG PASCAL LIB "Keylib32.dll"
Thank you
We tried PTR but the culprit was the missin @ for nHandle. Thank you. I'll move ahead now ... it is much appreciated.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
I use only a few of the functions provided by SoftwareKey. This is what I have so far:
Code: Select all
DLL32 FUNCTION pp_eztrial1(file AS LPSTR, password AS LPSTR,@errcode AS LONG,@hnd AS LONG) ;
AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_errorstr(errorcode AS LONG, @buffer AS LPSTR) ;
AS VOID PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_lfclose(hnd AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_bitclear(bit_field AS LONG, bit_number AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_bittest(bit_field AS LONG, bit_number AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_bitset(bit_field AS LONG, bit_number AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_getvarnum(hnd AS LONG, varno AS LONG, @value AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_setvarnum(hnd AS LONG, varno AS LONG, value AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_getvarchar(hnd AS LONG, varno AS LONG, @buffer AS LPSTR) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_lfopen(filename AS LPSTR, flags AS LONG, lfType AS LONG, password AS LPSTR, @lfhnd AS LONG) ;
AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_lfalias(lfhnd AS LONG, filename AS LPSTR, flags AS LONG, lfType AS LONG, password AS LPSTR, @lfNewest AS LONG) ;
AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_libtest(testnum AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_redir(drive AS LPSTR) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_compno(type AS LONG, filename AS LPSTR, hdd AS LPSTR) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_copycheckth(hnd AS LONG, flags AS LONG, compno AS LONG, b AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_semopen(hnd AS LONG, sem_type AS LONG, path AS LPSTR, prefix AS LPSTR, @shnd AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_semclose(shnd AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_semcount(hnd AS LONG, sem_type AS LONG, path AS LPSTR, prefix AS LPSTR, @kount AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_upddate(hnd AS LONG, flags AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_expired(hnd AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_countinc(hnd AS LONG, var_no AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_setvarchar(hnd AS LONG, varno AS LONG, string AS LPSTR) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_valdate(hnd AS LONG) AS LONG PASCAL LIB "keylib32.dll"
DLL32 FUNCTION pp_getvardate(hnd AS LONG, var_no AS LONG, @month_hours AS LONG, @day_minutes AS LONG, @year_secs AS LONG) AS LONG PASCAL LIB "keylib32.dll"