CreateMarker() NULL exception trown

716
7
09-08-2010 09:56 AM
RobHaynes
New Contributor
I am having a weird problem when using the CreateMarker(bmp) method. It seems an exception is getting thrown somewhere in the mscore.lib. Its not the bitmap that is bad. It was working perfectly fine and then out of nowhere it stopped. Anyone else run into this or know what might have happened.
0 Kudos
7 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

If you can post a snippet of your code I'll take a look. Is this version 1500?

Cheers

Mike
0 Kudos
RobHaynes
New Contributor
I'm pretty sure its not the code because it works fine on other machines. But here is how I am using the function:

trkSymbol = Symbol.CreateMarker(path);

where path is a string that contains the location of the file. I verified that the path is correct.

Thx
0 Kudos
RobHaynes
New Contributor
I'm pretty sure its not the code because it works fine on other machines. But here is how I am using the function:

trkSymbol = Symbol.CreateMarker(path);

where path is a string that contains the location of the file. I verified that the path is correct.

Thx
0 Kudos
RobHaynes
New Contributor
Same thing happens w/ 1200 and 1500.  And the weird thing is, it doesn't happen on 3 or 4 other machines, just my development machine.  Its like an extra "something" is happening on my machine that fails, but the extra thing doesn't happen.  Is there a setting somewhere for the .bmp file path that is somehow failing?

Hi,

If you can post a snippet of your code I'll take a look. Is this version 1500?

Cheers

Mike
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

On your dev machine what happens if you check the file exists first e.g. System.IO.File.Exists() or create a new in memory BitMap from the file on disk before using in the CreateMarker method?

Cheers

Mike
0 Kudos
RobHaynes
New Contributor
Hi,

On your dev machine what happens if you check the file exists first e.g. System.IO.File.Exists() or create a new in memory BitMap from the file on disk before using in the CreateMarker method?

Cheers

Mike


Ok, so I tried what you said and the problem still happens.

if(System.IO.File.Exists(path))
{
           trkSymbol = Symbol.CreateMarker(path);
}

It is returning true but yet does not create the marker from the path.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Rob,

That's strange - presumably it still works on your other test machines?

How about creating an in memory Bitmap first? e.g.:

Bitmap bitmap = new Bitmap(@"C:\ronnie.bmp");
Graphic g = new Graphic(new ESRI.ArcGISExplorer.Geometry.Point(-0.9, 52));
g.Symbol = Symbol.CreateMarker(bitmap);
Note n = new Note("Test Marker", g);
ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(n);

Cheers

Mike
0 Kudos