MapPoint.exe in list of processes

Anonymous
04-16-2003, 02:23 AM
Hey,

I'm very new to MapPoint. I'm using it from BCB6. And I have the following problem:

I execute my C++program, in this program I run MapPoint. Everything works fine, but when I close the MapPoint application and my application, MapPoint.exe stays in the list of processes on my PC. I'm using Tapp to start MapPoint.

Can anyone tell me how to prevent MapPoint from staying in my memory?


Thanks in advance!

Leen

Anonymous
04-16-2003, 03:14 AM
Hi Leen,

I had the same in Delphi. Since I only need a map object to do my stuff, I now use:
mymap:=TMap.Create(myForm);
...
mymap.destroy;

This also creates a mapPoint.exe process, but it disappears afterwards. With the Map object you can do a lot of stuff. Hope this helps for you.

Pascal

Anonymous
04-18-2003, 05:00 AM
Hey,

It seems that I don't have that method in C++, so I'm still having the problem, but anyway thanks for your help!

Leen

Eric Frost
04-18-2003, 10:47 AM
It's been something like 7 years since I studied C++ and used it only rarely since then, but I think there was some way to un-instantiate or Undim/Unset or otherwise "destroy" an object (?).

Eric

Anonymous
05-08-2003, 08:56 AM
I am having the same issues with a COM component running in MTS. I set all objects including the Application object to Nothing. The MTS compenent remains active too.

Anonymous
09-14-2004, 04:26 AM
Hi all.

I encounter the same problems after a program crash or debugger program halt.

I have written a small function that kills all instances of the Mappoint object in memory, so your app will restart OK. It is in Delphi, so i hope that you can translate it in C. That should be no problem i guess, since most of the code is Windows system stuff anyway.

Hope this helps a bit...

Cheers.
Martin.

(************************************************* *******************************
Title : Procedure KillMappointInstances
Function : Kill's all active MapPoint objects anywehere in memory
Result : Number of instances found and terminated
Author : Martin Beek, martin@martinbeek.net
Uses : TLHelp32
************************************************** ******************************)

function KillMapPointInstances : Integer;
const
PROCESS_TERMINATE = $0001;
EXEFILENAME = 'MapPoint.exe';
var
ContinueLoop : BOOL;
FSnapshotHandle : THandle;
FProcessEntry32 : TProcessEntry32;
begin
Result := 0;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

while Integer(ContinueLoop) <> 0 do
begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeF ile)) =
UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =
UpperCase(ExeFileName))) then
Result := Integer(TerminateProcess(
OpenProcess(PROCESS_TERMINATE,
BOOL(0),
FProcessEntry32.th32ProcessID),
0));
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;

 
Web mp2kmag.com
mapforums.com