[Mapserver-users] What am i doing wrong in this C program?

mountainduo at mho.com mountainduo at mho.com
Thu Mar 4 14:12:52 EST 2004


Hello,

i am trying to access the layers of a mapObj and when i do, i get an
exception access violation...it seems that the layers are not initialized.
do i need to do anything other than msLoadMap?

thanks

    theMap = (mapObj*)msLoadMap( filename, NULL );

    printf( "Map->name %s\n", theMap->name );
    printf( "Map->status %i\n", theMap->status );
    printf( "Map->height %i\n", theMap->height );
    printf( "Map->width %i\n", theMap->width );
    printf( "Map->numlayers %i\n", theMap->numlayers );
    printf( "Map->transparent %i\n", theMap->transparent );
    printf( "Map->interlace %i\n", theMap->interlace );
    printf( "Map->imagequality %i\n", theMap->imagequality );
    printf( "Map->cellsize %i\n", theMap->cellsize );
    printf( "Map->extent.minx %i\n", theMap->extent.minx );
    printf( "Map->extent.miny %i\n", theMap->extent.miny );
    printf( "Map->extent.maxx %i\n", theMap->extent.maxx );
    printf( "Map->extent.maxy %i\n", theMap->extent.maxy );
    printf( "Map->units %i\n", theMap->units );
    printf( "Map->scale %i\n", theMap->scale );
    printf( "Map->resolution %i\n", theMap->resolution );
    printf( "Map->shapepath %s\n", theMap->shapepath );
    printf( "Map->numoutputformats %i\n", theMap->numoutputformats );

    printf( "layers size %i\n", sizeof(theMap->layers) );
    for ( x = 0; x < theMap->numlayers; x++ )
    {
        printf( "theMap->layer[%i].name: %s\n", x, theMap->layers[x].name );

    }//end for x





More information about the mapserver-users mailing list