Using Windows DLLs NOT Created in Clarion for Windows 
Author Message
 Using Windows DLLs NOT Created in Clarion for Windows

Hi all !

I'm trying to use Windows DLL that is not created in Clarion for Windows.
** NEVER DONE IT BEFORE **
I have:

1 .  Created Equivalent Clarion for Windows Language Prototypes.
2.   Created a Clarion for Windows Library (.LIB ) File for the DLL.
3.      Referenced  the Library (.LIB) File in the Project System.

Most of the functions work, BUT those who return data to a GROUP structure
are giving me a bad time.   For example this one:

FS_GetUnitStatus(Long UnitNo, *UnitStatusRec UnitStatus),Long,Pascal,Raw

The UnitStatusRec is defined as:

Type UnitStatusRec                        'full unit status record type
    lInstalled                   As Long      '=1 if unit installed
    lOnLine                     As Long      '=1 if unit on-line
    lDeactivated               As Long     '=1 if unit deactivated
    lTimeOffset                As Long     'offset time WRT local system
time (minutes)
    lMemorySize             As Long      'total size of data flash mems
    lFreeMemory             As Long      'free memory (bytes)
    lTransSerialNo           As Long      'current transaction serial
number
    lTransListHost           As Long      'last transaction entry accessed
by host
    lNoTrans                   As Long      'number of transaction records
in system
    lNoTemplate              As Long      'number of templates in unit
    lHostCommsStatus    As Long      'status of host comms
    lAlarmStatus             As Long      'status of alarm inputs
    lLockStatus               As Long     'status of lock
    lFirmwareVers           As Long      'firmware version number x100
    lFirmwareType           As Long      'firmware type
End Type

And  UnitStatus  also.
When I call this function and assign the values from the GROUP to a local
variable(outstr,DIM(15)) on screen I don't get the result that I want e.g.

UnitNo = 1
localUnitStatGroup = FS_GetUnitStatus(UnitNo, UnitStatus)
outstr[1] = 'Free Memory      =' & localUnitStatGroup. lFreeMemory
outstr[2] = 'Number of templ =' & localUnitStatGroup. lNoTemplate
outstr[3] = 'Number of trans  =' & localUnitStatGroup. LNoTrans
.
.
display()

outstr[1]      displays  538976            should display  431360
outstr[1]      displays  538980            should display  260
outstr[1]      displays  538981            should display  6

WHAT AM I MISSING HERE ??



Tue, 13 Mar 2001 03:00:00 GMT  
 Using Windows DLLs NOT Created in Clarion for Windows
Kristjn,

You showed us everything but your actual call to FS_GetUnitStatus(). It
you're not already doing it, try this.

        bla = FS_GetUnitStatus(UnitNo, Address(UnitStatus))

If the compiler belches on that, try changing your prototype to:

FS_GetUnitStatus(Long UnitNo, ulong),Long,Pascal,Raw

Regards,

Mark

Quote:

>Hi all !

>I'm trying to use Windows DLL that is not created in Clarion for Windows.
>** NEVER DONE IT BEFORE **
>I have:

>1 .  Created Equivalent Clarion for Windows Language Prototypes.
>2.   Created a Clarion for Windows Library (.LIB ) File for the DLL.
>3.  Referenced  the Library (.LIB) File in the Project System.

>Most of the functions work, BUT those who return data to a GROUP structure
>are giving me a bad time.   For example this one:

>FS_GetUnitStatus(Long UnitNo, *UnitStatusRec UnitStatus),Long,Pascal,Raw

>The UnitStatusRec is defined as:

>Type UnitStatusRec                        'full unit status record type
>    lInstalled                   As Long      '=1 if unit installed
>    lOnLine                     As Long      '=1 if unit on-line
>    lDeactivated               As Long     '=1 if unit deactivated
>    lTimeOffset                As Long     'offset time WRT local system
>time (minutes)
>    lMemorySize             As Long      'total size of data flash mems
>    lFreeMemory             As Long      'free memory (bytes)
>    lTransSerialNo           As Long      'current transaction serial
>number
>    lTransListHost           As Long      'last transaction entry accessed
>by host
>    lNoTrans                   As Long      'number of transaction records
>in system
>    lNoTemplate              As Long      'number of templates in unit
>    lHostCommsStatus    As Long      'status of host comms
>    lAlarmStatus             As Long      'status of alarm inputs
>    lLockStatus               As Long     'status of lock
>    lFirmwareVers           As Long      'firmware version number x100
>    lFirmwareType           As Long      'firmware type
>End Type

>And  UnitStatus  also.
>When I call this function and assign the values from the GROUP to a local
>variable(outstr,DIM(15)) on screen I don't get the result that I want e.g.

>UnitNo = 1
>localUnitStatGroup = FS_GetUnitStatus(UnitNo, UnitStatus)
>outstr[1] = 'Free Memory      =' & localUnitStatGroup. lFreeMemory
>outstr[2] = 'Number of templ =' & localUnitStatGroup. lNoTemplate
>outstr[3] = 'Number of trans  =' & localUnitStatGroup. LNoTrans
>.
>.
>display()

>outstr[1]      displays  538976            should display  431360
>outstr[1]      displays  538980            should display  260
>outstr[1]      displays  538981            should display  6

>WHAT AM I MISSING HERE ??

----------------------------
sig under construction

Certified Hobbyist



Wed, 14 Mar 2001 03:00:00 GMT  
 Using Windows DLLs NOT Created in Clarion for Windows
Hi Kristjn,

On 25 Sep 1998 00:22:41 -0800, "Kristjn Hjlmarsson"

Quote:

>FS_GetUnitStatus(Long UnitNo, *UnitStatusRec UnitStatus),Long,Pascal,Raw
...
>    lMemorySize             As Long      'total size of data flash mems

...

Quote:
>localUnitStatGroup = FS_GetUnitStatus(UnitNo, UnitStatus)
>outstr[1] = 'Free Memory      =' & localUnitStatGroup. lFreeMemory
>outstr[2] = 'Number of templ =' & localUnitStatGroup. lNoTemplate
>outstr[3] = 'Number of trans  =' & localUnitStatGroup. LNoTrans
>.
>.
>display()

>outstr[1]      displays  538976            should display  431360
>outstr[1]      displays  538980            should display  260
>outstr[1]      displays  538981            should display  6

I suppose the 3 lines above should be outstr[1], [2] and [3]?  Anyway,
the problem is that the assignments should be:

outstr[1] = 'Free Memory      =' & UnitStatus.lFreeMemory
outstr[2] = 'Number of templ =' & UnitStatus.lNoTemplate
outstr[3] = 'Number of trans  =' & UnitStatus.LNoTrans

because the localUnitStatGroup will receive a Long (the return type of
the function - ),Long,Pascal,Raw)  Sorry if I have mislead you in our
conversation few days ago;)

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

http://www.icetips.com  (http://199.34.26.90)
UIN nr.: 2428601



Wed, 14 Mar 2001 03:00:00 GMT  
 Using Windows DLLs NOT Created in Clarion for Windows
Thanks   Arnr!

That did it for me.

Best Regards

Kristjn Hjlmarsson



Sat, 17 Mar 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using Windows DLLs NOT Created in Clarion

2. Using Windows Dlls Not created in Clarion

3. Using DLLs NOT Created in Clarion

4. Using Dll's not created in clarion

5. DLLs not created in Clarion

6. HELP!: Create Clarion DLL to be used by Delphi

7. Creating - Fortran 77 dll for use in Visual Basic 6.0 (not using Compaq Visual Fortran)

8. MS Access not using cdx created by Clarion

9. Creating a Windows DLL in GNAT ADA

10. arity/windows creates dll's?

11. newbie help- creating windows "extension" dll

12. Lispworks/Windows creating a DLL

 

 
Powered by phpBB® Forum Software