Access violation masc.dll

From: Martin (kung_nolle_at_hotmail.com)
Date: 01/14/05


Date: 14 Jan 2005 02:38:40 -0800

Hi,

I'm writing an application to test Mobitex and the MASC protocol. I've
decided to use an dll(masc.dll). The MASC DLL is a Windows DLL that
implements the MASC protocol, allowing applications that have no
knowledge of MASC to communicate with Mobitex modems.

I'm using Delphi and has converted masc.h (written in C/C++) to
delphicode. When I call a method I get the following message: 'Access
violation att address 10001029 in module masc.dll'. Read of address
00000000'.

This is the method I tried to call

Defintion in masc.h

EXPORT int CALLBACK MASC_Open(HMASC* hMASC, char* address,
MASC_SETTINGS* settings, unsigned long timeout);

Definition in Delphi

function MASC_Open(hMASC :HMASC; address: PChar;
settings:MASC_SETTINGS; Timeout: LongInt):integer; cdecl; external
MASCDLL;

My call to MASC_Open in the code:

status := MASC_Open(hMasc, address, settings, 0);

Declaration HMASC, MASC_SETTINGS

HMASC: In masc.h typedef void*
       in delphi HMASC=pointer;

MASC_SETTINGS In masc.h typedef struct
                        {
                          unsigned int frameQueueSize;
                          unsigned int commandQueueSize;
                          unsigned int mpakQueueSize;
                          }
             in delphi type
                            MASC_SETTINGS = record

                              frameQueueSize :cardinal;
                              mpakQueueSize :cardinal;
                             commandQueueSize :cardinal;
                              end{MASC_SETTINGS};

I'm not very familiar with c/c++ and pointers so I wouldn't be
surprised if the explanation to the "access violation" lies in the
conversion of different data types and pointers.

Please help if you can, I'm stuck...

Martin
pointers from c/c++ to delphi.



Relevant Pages

  • Access violation masc.dll
    ... I'm writing an application to test Mobitex and the MASC protocol. ... The MASC DLL is a Windows DLL that ... Definition in Delphi ...
    (borland.public.delphi.ide)
  • Re: Access violation masc.dll
    ... Martin wrote: ... > I'm writing an application to test Mobitex and the MASC protocol. ... The MASC DLL is a Windows DLL that ...
    (comp.lang.pascal.delphi.misc)
  • Re: Access violation masc.dll
    ... Martin wrote: ... > I'm writing an application to test Mobitex and the MASC protocol. ... The MASC DLL is a Windows DLL that ...
    (borland.public.delphi.ide)
  • Re: Access violation masc.dll
    ... > I'm writing an application to test Mobitex and the MASC protocol. ... > Declaration HMASC, MASC_SETTINGS ... The AV could be caused by referencing a pointer that has not been assigned. ...
    (comp.lang.pascal.delphi.misc)