I am trying to get the Microsoft Mappoint OCX working in C++ Builder 6.0 Pro.

So far I can place pushpins and delete them but I cannot attach a name or note.

When the compiler is in Debug mode the code will compile without any error but crashes when running Mappoint related code.

It reports - Debugger Exception Notification

Project MapTest2.exe raised exceptionclas EAccessViolation with message 'Access violationat address 00401DD3 in module 'MapTest2.exe.
Reda of address 00000000'. Process stopped. Use Step or Run to continue.

It would appear that the C++ cannot handle the Microsoft Mappoint OCX properly - all suggestions welcome.

When the complier is in Release mode the code works.


:rolleyes:

Hello Trevor!

I am trying the same thing with CB5 but it only works to add a pushpin - not to delete them. Can you tell me how you've been able to delete all the pushpins you've made in your program???

Here is a sample code how I make pushpins in my Application including a note and a symbol:

void __fastcall TForm1::AddPin( double Lat, double Lon, AnsiString
Truck, AnsiString Note )
{
WideString txt;
PushpinPtr pin;
LocationPtr loc;

loc = Map->GetLocation( Lat, Lon, 100 );

txt = Truck;
pin = Map->AddPushpin( loc, txt );

pin->set_BalloonState( geoDisplayName );
pin->set_Symbol( 85 );
pin->set_Highlight( true );
txt = Note;
pin->set_Note( txt );

pin->MoveTo( TruckSet );

delete pin;
delete loc;
}

Hope you can help me!

Thanks in Advance,

Michi

Hi Michi,

I have already posted a reply in the private messages forum but the following is more or less what I said.

I have a solution to interfacing Borland Builder and Mappoint but I am using it in a tracking system. Can you tell me what you are using it for - ie are you a competitor??.

Deleting a pin is as simple as pin->delete but you will have many more hurtles to get over before you get it all working the way you want it. Email me and I will sned you a CD with our software on it (no source) then you can see what I have done.

Regards,
Trevor :)

Edited 3 Years Ago by happygeek: fixed formatting

This article has been dead for over six months. Start a new discussion instead.