Beginning and the prehistory of the problem is here:
In a few words: I'm trying to work from VBA with GIS system through C dll functions, which receive/return the pointer to a big UDT structure "TGisAbfrage" (in English it would be "GisQuery"). Function, declared in C as :
TGisAbfrage* API_EXPORT erzeugeAbfrageStruktur(voi
creates this UDT structure and returns the pointer to it. I have to fill some parts of this structure with parameters and to give the UDT as a parameter to the next function, (which runs the query, in fact):
TBool API_EXPORT ausfuehrenAbfrage(TGisAbfr
So, when I'm trying to run in VBA the abovementioned function, the Access application crashes with error:
The instruction at address "0x00000000" referenced memory at number "0x00000000". The memory could not be "read".
The relevant info for the problem:
1. Declaration in VBA modul.
Public Type Bool '
Bool As Integer
Declare Function erzeugeAbfrageStruktur Lib "D:\Gis\GisAbfrage32.dll" () As Long
Declare Function ausfuehrenAbfrage Lib "D:\Gis\GisAbfrage32.dll" (ByVal lng As Long) As Bool
Remark:= type Bool was declared to fit the C declaration (I don't know, if conditional compillation is relevant here,
but it was declared so in a C header) -
typedef short TBool; // 19.01.98, S.J.
#define false 0 // 19.01.98, S.J.
#define true 1 // 19.01.98, S.J.
The VBA function, where I test the thing, and where the error happens, looks so:
... - irrelevant declarations
Dim b As Bool
Dim lngPointer As Long
... - irrelevant code
lngPointer = erzeugeAbfrageStruktur()
... - irrelevant code, lngPointer was not modified here
b = ausfuehrenAbfrage(ByVal lngPointer) '!!!! - here the application crashes
... - irrelevant code
I told today with the guy, who created this dll and asked him expressly, what will happen if to give the pointer to ausfuehrenAbfrage() just after getting it from erzeugeAbfrageStruktur(), and without any modification of the structure in-between. He told, that it has just to run, but the structure will not be filled with results and the info, that nothing was found, will be saved in some UDT elements. But ANYWAY IT HAS TO RUN. But under Access 2000 it doesn't run.
What causes of that do you think are possible? In what direction have I to dig?