Prefetch-Method crashes MS-Access

Yes, as you know I was suspicious of the callbacks as well. One thing it makes me wonder about is interaction with the UI from an external thread. Perhaps inline code, such as saving to variables, is fully synchronous, whereas when trying to write to the UI (debug window) it incurs some sort of asynchronous behavior (interaction with the UI thread?) that causes problems. No matter, I think the goal is to determine what things cause problems, and to not do those things. :-/

I’m glad you’re able to put back some of the standard behavior of the OCX. My goal was to divide-and-conquer, ultimately to determine which things were contributing to the problem, and which things weren’t. You’re doing well.

Regards,
Jerry.

Just one question:

in GlobalSettings.h i find

#include “MapWinGIS**_i**.h”

that gets marked as an error by vs because this file is missing.
And it’s just the “ICallback*” that, - as vs “says” -, isn’t defined.

How is this “ICallback*” defined in GlobalSettings?

Do you mean GlobalSettingsInfo.h? I don’t see that include in GlobalSettings.h.

But that file should exist. It is generated by compiling the IDL file (which includes the definition of ICallback). If that file is missing for you, perhaps try a Clean/Rebuild, and see if it gets resolved.

Yes, it’s GlobalSettingsInfo.h and also MapWinGIS.h.
I did a clean on the Project but that didn’t generate the File MapWinGIS_i.h
did a search but cannot find it.
Did also a compile directly on MapWinGIS.idl, but even that didn’t create that file.
…the project builds even without it, - but should it be there?

ah, just looked into the filesystem and there the file is present, - but not included in the solution.

That’s correct that it’s not technically part of the solution, since it is a generated file. It will just get ‘included’ at build-time.

Hi Jerry,

found an interresting article about event-handling in ms access:

if you look on this page in paragraph ACC.15 there is a nice sample, that shows the difference in event-handling in ms access and other programing environments.
maybe that’s the problem: too many events?

cheers
Stefan

Hi Jerry,

it seems, as if the last statement: Too many events for ms access is the clue to a solution.
Just compiled a version of mapwingis (vs 2019 & GDAL 3.2) where i just commented out the TilesLoaded-Event so it doesn’t get fired at all, and even after 20 minutes of excessive panning and zooming the database runs stable and map display is beautifully fast.

Do you know a way to limit the number of events fired from this ocx to it’s client application?

regards
Stefan

Hello Stefan.

I should first say, that’s excellent news.

So, is this solution different than just not hooking the TIlesLoaded event? In other words, is there a problem with the OCX posting the events even if MS Access is not registered for the events?

Hi Jerry,

it seems. Even when i not used the TilesLoaded-Event, - defined no handler for it -, vs debugger stopped often at the line, where this event gets rised.
I just commented out that line in Map.h where RiseEvent stands for the TilesLoaded-Event, and since then, nothing crashed anymore.
Looks strange to me, but if that’s the solution for my problem, everything is fine.
Next problem to solve would be, how to create my own setup program for this custom version. Is there something to be found on github for this project?

You can use InnoSetup. You will have to download it, but the installation script is already distributed with the OCX source code (C:\dev\MapWinGIS\src\InnoSetup\MapWinGIS-only.iss)

Great, will spend my time tomorrow with it, thank you!