[OSRS-PROJ] proj.4 in VB

Thomas Flemming tf at ttqv.com
Thu Jun 26 03:16:34 EDT 2003


Hello,

the main problem is, that the proj.dll is not usable by VB because of the 
function declarations. They have to be declared with __stdcall.
So not:
   void pr_xxx(..);
but:
   #include <windows.h> 	
   void __stdcall pr_xxx(..);

Then it should work.
Thomas



For more details in this see

Christopher Pouliot schrieb:
> Hello,
> 
> I have downloaded the proj.dll file (v4.4.6) and am trying
> unsuccessfully to use it in Visual Basic.  The simple initialization
> code below causes a fatal error in VB and crashes the program.  My
> experience working with external DLLs is limited so any assistance or
> sample VB code would be greatly appreciated.
> 
> Private Declare Function pj_init Lib "c:\software\proj\bin\proj.dll"
> (ByVal argc As Integer, ByRef argv() As String) As String
> 
> Private Sub Command1_Click()
>   Dim anArr(2) As String
>   Dim aResponse As String
>   
>   anArr(0) = "proj=utm"
>   anArr(1) = "zone=11"
>   anArr(2) = "ellps=GRS80"
>   
>   aResponse = pj_init(3, anArr)
> End Sub
> 
> 
> Thank you,
> 
> Chris
> ----------------------------------------
> PROJ.4 Discussion List
> See http://www.remotesensing.org/proj for subscription, unsubscription
> and other information.
> 

-- 

****************************************
**   Dipl.-Ing. Thomas Flemming
**      Software Development
**  thomas.flemming at touratech.de
**          tf at ttqv.com
**      http://www.ttqv.com
**
** ... und immer dem Pfeil nach!
***************************************


----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.



More information about the Proj mailing list