MapTools.org

AW: [Shapelib] DLL -> access violation

shapelib@lists.maptools.org shapelib@lists.maptools.org
Tue, 2 Mar 2004 21:59:58 +0100
I use VC++6.0. Make minimal project (dialog). (add the
shapefil.h,shapelib.lib and shapelib.dll in the working directory
Only add 3 things,
1.Include in stdafx.h
2.Linker: use shapelib.lib
3.Dialogclass: SHPHandle file = SHPOpen("michael_lines.shp","rb");

mfg Michael

-----Ursprungliche Nachricht-----
Von: shapelib-admin@lists.maptools.org
[mailto:shapelib-admin@lists.maptools.org]
Gesendet: Dienstag, 2. Marz 2004 19:35
An: shapelib@lists.maptools.org
Betreff: Re: [Shapelib] DLL -> access violation


shapelib-admin@lists.maptools.org wrote:
> Hi,
> all times i want to opnen shapefile whit the SHPOpen function, i get this
> error:
>
> Exception in text.exe(SHAPELIB.DLL):0xC000005: Access Violation
>
> Dont know why! The name is right and i can open the file whit normal
> functions.
> (VC++: CFile file.
> 	 file.open(...) )
> Or does this funtion only work in C? I thought i can use the DLL in VC++
> programms.
> I include the shapefil.h and under projects i told the linker were he can
> find the
> shapelib.lib. What i have t do jet?
> Thy for any reponse

Michael,

I'm not clear on exactly how you are calling SHPOpen().  It does normally
work from C++ code built with MS VC++.  I use that frequently.  However,
if you have different linkage conventions between your application and the
DLL,
or if your filename string is of the wrong type or any number of other
situations
you could get a crash.  Try elaborating on the conditions.  Provide a
minimal
program that demonstrates your problem.

Best regards,
--
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Shapelib mailing list
Shapelib@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/shapelib



This archive was generated by Pipermail.