Hi,
I just had following problem., is solved and wants to share it. In Delphi I needed to update an MDB database using SQL ADO components and right after it create a mappoint instance to check in what street vehicle is.
It does not workIt get an error (whitch I did not wrote down) like the caller is busy, operation cannot performed. But there is a very simple workaround. Execute the code outside the code where the SQL
So after the SQL things:
and the custom message handler can thenl load MP without problems with folling code:Code:PostMessage(Handle, WM_LOADMP, 0, 0);
I hope this will benefit other when they have similar problem. It has cost me a few hour of time until my euro was dropping (Flemish proverb)Code:constructor TMapPoint.Create(ErrorProc: TOnError); var Reg: TRegistry; FileName: string; begin inherited Create; FOnError := ErrorProc; try FMP := TApplication.Create(nil); Reg := TRegistry.Create; try Reg.RootKey := HKEY_CLASSES_ROOT; if not Reg.OpenKey('.ptm\MapPoint.Map.EU.11\ShellNew', False) then if not Reg.OpenKey('.ptm\MapPoint.Map.EU.9\ShellNew', False) then Exit; FileName := Reg.ReadString('FileName'); FMP.OpenMap(FileName, False); finally Reg.Free; end; except on E: Exception do begin if Assigned(FOnError) then FOnError(Self, E); end; end; end;![]()