How to programming using VC6.0

confach
02-26-2004, 09:41 PM
I want to program using VC6.0,And when I use its OCX to open a specfic mappoint,by the way ,it is based on dialogue,it can pen the map,but it will report a error .and the code is
BOOL CRouteDirectionDlg::OnInitDialog()
{
CDialog::OnInitDialog();
..........
this->m_ctlMappoint.OpenMap("C:\\lazone.ptm");
...
}

how to solve it? have any example?

Matrices
02-27-2004, 06:02 AM
try

m_ctlMappoint.OpenMap("C:\lazone.ptm");

instead, and make sure the map actually exists. Whats the error?

M

Winwaed
02-27-2004, 08:37 AM
No, the double backslash looks right for C. The backslash is used as an escape character for producing special characters, eg. the newline is "\n"
To produce a conventional backslash you just repeat it.

I have an article pending (Eric said it should be published next week) about using MapPoint from VC++ without MFC.
My code has tested great with the Microsoft and Intel compilers, and I've had someone test against C++ Builder (that required a few changes to get it to work).

I haven't tried to programmatically open a pre-existing map, but if you have a wider problem with the COM interface, it might help identify it?


Richard

tanguy_laverdure
02-27-2004, 09:10 AM
// Bidouille pour eviter l'erreur sur l'assert
SetCapture();
// Fin bidouille

// Ouverture de la carte mappoint
_variant_t tVar;
short Var = 2;
tVar = Var;
_cMap = m_mapPointCtrl.NewMap(tVar);

// Bidouille necessaire pour eviter un plantage (probleme d'activation du controle)
m_pCtrlCont->OnUIDeactivate(m_mapPointCtrl.GetCtrlSite());
m_pCtrlCont->OnUIActivate(NULL);
SetFocus();
ReleaseCapture();
// Fin bidouille

Matrices
03-01-2004, 05:25 AM
No, the double backslash looks right for C. The backslash is used as an escape character for producing special characters, eg. the newline is "\n"
To produce a conventional backslash you just repeat it.

I have an article pending (Eric said it should be published next week) about using MapPoint from VC++ without MFC.
My code has tested great with the Microsoft and Intel compilers, and I've had someone test against C++ Builder (that required a few changes to get it to work).

I haven't tried to programmatically open a pre-existing map, but if you have a wider problem with the COM interface, it might help identify it?


Richard

hmmm.... not written in C for a while but I thought in quotes it'd use a single :s

M

 
Web mp2kmag.com
mapforums.com