Article View: comp.lang.pascal.delphi.misc
Article #103Access violation masc.dll
From: Martin
Date: Fri, 14 Jan 2005 10:38
Date: Fri, 14 Jan 2005 10:38
57 lines
2789 bytes
2789 bytes
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.
Technical Details
Message-ID:
<7b95a6bf.0501140238.40e08340@posting.google.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10baee,eb7f1ca82bd8ffc4,start X-Google-Thread: 10545b,eb7f1ca82bd8ffc4,start X-Google-Thread: 1043cf,eb7f1ca82bd8ffc4,start X-Google-Attributes: gid10baee,gid10545b,gid1043cf,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!not-for-mail From: kung_nolle@hotmail.com (Martin) Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.ide,borland.public.delphi.objectpascal Subject: Access violation masc.dll Date: 14 Jan 2005 02:38:40 -0800 Organization: http://groups.google.com Lines: 57 Message-ID: <7b95a6bf.0501140238.40e08340@posting.google.com> NNTP-Posting-Host: 81.186.240.79 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1105699121 13124 127.0.0.1 (14 Jan 2005 10:38:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 14 Jan 2005 10:38:41 +0000 (UTC)