[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
www.undertowsoftware.com • View topic - Follow-Up on Sample Code not running

Follow-Up on Sample Code not running

A forum made available for users of the MapPro OCX SDK to exchange ideas, ask each other questions, etc.

Follow-Up on Sample Code not running

Postby LarryWilton » Mon Jan 23, 2012 1:46 pm

I was just wondering is using VS-2010 may be my problem. On the older system I was using VS-2008. When I opened the sample in VS-2010, on the new system, it went through an automatic conversion, which didn't happened with the VS-2008, so I am wondering if the conversion may have introduced some error. Scratching my head, but nothing :-(
User avatar
LarryWilton
Active User
Active User
 
Posts: 26
Joined: Thu Aug 25, 2011 9:23 am

Re: Follow-Up on Sample Code not running

Postby FletcherJ » Mon Jan 23, 2012 2:34 pm

Larry,

I too am running 2010. Have you tried chaning the compile settings to see if that helped?

me
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: Follow-Up on Sample Code not running

Postby FletcherJ » Mon Jan 23, 2012 3:13 pm

Larry,

I just did a quick check.

After making sure I had the 2 ocxs in the VS 21010 toolbar, I opened a fresh copy of the sample code. Changed the compile mode to x86 (you actually have to add x64 and x86 settings), changed the target framework to 4 (I don't know if this is critical for getting the OCX to work, but it's the framework we are using for our other apps), set the startup program to "program.cs", and compiled.

It did convert one file when I tried to open it in 2010, but that was it.

The program now runs without error for me. But it won't show me any map details other than a very large, very rough outline of the US. So there is still something missing. But at least no more error...

Take care,
me
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: Follow-Up on Sample Code not running

Postby Gyrotech » Tue Jan 24, 2012 10:45 pm

It sounds like you are not setting the datapaths correctly. The COM object needs to know *where* to find the data it needs to render the maps.
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: Follow-Up on Sample Code not running

Postby ROstmeyer » Tue Jan 24, 2012 11:03 pm

FletcherJ wrote:Larry,

I just did a quick check.

After making sure I had the 2 ocxs in the VS 21010 toolbar, I opened a fresh copy of the sample code. Changed the compile mode to x86 (you actually have to add x64 and x86 settings), changed the target framework to 4 (I don't know if this is critical for getting the OCX to work, but it's the framework we are using for our other apps), set the startup program to "program.cs", and compiled.

It did convert one file when I tried to open it in 2010, but that was it.

The program now runs without error for me. But it won't show me any map details other than a very large, very rough outline of the US. So there is still something missing. But at least no more error...

Run the sample program, select File, Configure and in the Data Paths tab, make sure each of the datapaths is pointing to the appropriate folders on your system. Also make sure you set the datasource to US,CA.

Once you do that, you should be able to see all the map data, streets, etc.
User avatar
ROstmeyer
Active User
Active User
 
Posts: 16
Joined: Thu Aug 18, 2011 11:26 am

Re: Follow-Up on Sample Code not running

Postby LarryWilton » Wed Jan 25, 2012 10:06 am

FletcherJ wrote:Larry,

I too am running 2010. Have you tried chaning the compile settings to see if that helped?


It turns out it had nothing to do with the VS-2010 conversion. I missed a little thing, that the sample program couldn't run properly since the controls were not part of the VS toolbox. I had forgotten to add them, duh - for some reason, I thought that he installation would have done that automatically, or the sample code would have created the instances at run time, on its own.

In any case, it all sort-of makes sense now and I can proceed with my work.
User avatar
LarryWilton
Active User
Active User
 
Posts: 26
Joined: Thu Aug 25, 2011 9:23 am

Re: Follow-Up on Sample Code not running

Postby LarryWilton » Wed Jan 25, 2012 10:10 am

Gyrotech wrote:It sounds like you are not setting the datapaths correctly. The COM object needs to know *where* to find the data it needs to render the maps.

Yup, been caught but that many times. I used to set the datapaths at design time, by right-clicking on a visual instance of the OCX on my form and then selecting "Properties". Then, after that, I didn't have to worry about the datapaths and the datasource. However, once-in-a-while, I would forget to do that and then would spend 15 minutes trying to figure out what broke and my maps wouldn't appear :-)

You are right, if you don;t tell the OCX where the data is, there is no way for it to paint the maps.
User avatar
LarryWilton
Active User
Active User
 
Posts: 26
Joined: Thu Aug 25, 2011 9:23 am


Return to MapPro OCX

Who is online

Users browsing this forum: No registered users and 1 guest

cron