Hi,<br><br>Did you inspect your application with FileMon as it has been suggested in the thread you mentioned? You may find some other dll-s that couldn&#39;t be loaded at run time in the FileMon file access log.<br><br>Best regards,<br>
<br>Tamas<br><br><br><br><div class="gmail_quote">2009/12/3 sebastien DECORME <span dir="ltr">&lt;<a href="mailto:sebastien.decorme@survey-copter.com">sebastien.decorme@survey-copter.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="FR">

<div>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">HI</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I want to make Degre to UTM conversion with the
OSR/GDAL library (anything else I’ve no choice) </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I’m looking on the web for 3 days to find a way
to make this.</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I’ve downloaded  the FWtools 2.4.6</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I’ve add to my project all the dll in the
directory</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">C:\Program Files\FWTools2.4.6\csharp </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I add in the path </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">C:\Program Files\FWTools2.4.6\bin </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">And my very simple test program look like this</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> System;</span></font></p>


<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> System.Collections.Generic;</span></font></p>


<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> System.ComponentModel;</span></font></p>


<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> System.Data;</span></font></p>


<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> System.Drawing;</span></font></p>


<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> System.Text;</span></font></p>


<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> System.Windows.Forms;</span></font></p>


<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">using</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> OSGeo.OSR;</span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">namespace</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> UTM_GEO</span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">    <font color="blue"><span style="color: blue;">public</span></font> <font color="blue"><span style="color: blue;">partial</span></font> <font color="blue"><span style="color: blue;">class</span></font> <font color="teal"><span style="color: teal;">Form1</span></font> : <font color="teal"><span style="color: teal;">Form</span></font></span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">    {</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">        
</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">       
<font color="teal"><span style="color: teal;">SpatialReference</span></font> oUTM =
<font color="blue"><span style="color: blue;">new</span></font> <font color="teal"><span style="color: teal;">SpatialReference</span></font>(<font color="maroon"><span style="color: maroon;">&quot;&quot;</span></font>);</span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">       
<font color="teal"><span style="color: teal;">SpatialReference</span></font> oWGS =
<font color="blue"><span style="color: blue;">new</span></font> <font color="teal"><span style="color: teal;">SpatialReference</span></font>(<font color="maroon"><span style="color: maroon;">&quot;&quot;</span></font>);</span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">       
</span></font><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">public</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">
Form1()</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">        {</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
InitializeComponent();         </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">        }</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">        <font color="blue"><span style="color: blue;">private</span></font> <font color="blue"><span style="color: blue;">int</span></font> FindUtmZone(<font color="blue"><span style="color: blue;">double</span></font> Longitude)</span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">        {</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
<font color="blue"><span style="color: blue;">int</span></font> retour = -1;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
retour = <font color="teal"><span style="color: teal;">Convert</span></font>.ToInt16
((Longitude - (-180)) / 6 + 1);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
</span></font><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">return</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> retour;</span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">       
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">       
<font color="blue"><span style="color: blue;">private</span></font> <font color="blue"><span style="color: blue;">void</span></font> BtnToUTM_Click(<font color="blue"><span style="color: blue;">object</span></font> sender, <font color="teal"><span style="color: teal;">EventArgs</span></font> e)</span></font></p>


<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">       
</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
<font color="blue"><span style="color: blue;">double</span></font> Longitude = <font color="teal"><span style="color: teal;">Convert</span></font>.ToDouble(TxtGeoLon.Text);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
<font color="blue"><span style="color: blue;">int</span></font> ZoneUTMCourante = FindUtmZone(Longitude);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">           
</span></font><font color="blue" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;" lang="EN-GB">string</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> NomProj = <font color="maroon"><span style="color: maroon;">&quot;UTM
&quot;</span></font> + ZoneUTMCourante.ToString() + <font color="maroon"><span style="color: maroon;">&quot; / WGS84&quot;</span></font>;</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">           
oUTM.SetProjCS(NomProj);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">           
oUTM.SetWellKnownGeogCS( <font color="maroon"><span style="color: maroon;">&quot;WGS84&quot;</span></font>
);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">       
}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">    }</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">}</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB">I’ve an error at this
line </span></font></p>

<p class="MsoNormal"><font color="teal" face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: teal;" lang="EN-GB">SpatialReference</span></font><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> oUTM = <font color="blue"><span style="color: blue;">new</span></font>
<font color="teal"><span style="color: teal;">SpatialReference</span></font>(<font color="maroon"><span style="color: maroon;">&quot;&quot;</span></font>);</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">The type initializer for
&#39;OSGeo.OSR.OsrPINVOKE&#39; threw an exception.&quot;. </span></font></span></p>

<p class="MsoNormal"><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">The innermost exception is what you&#39;d
expect - &quot;System.<b><span style="font-weight: bold;">DllNotFoundException</span></b>:
Unable <b><span style="font-weight: bold;">to</span></b> <b><span style="font-weight: bold;">load</span></b> <b><span style="font-weight: bold;">DLL</span></b>
</span></font></span><span lang="EN-GB"><br>
<span>&#39;<b><span style="font-weight: bold;">osr_wrap</span></b>&#39;:
The operating system <b><span style="font-weight: bold;">cannot</span></b>
run.&quot;</span></span></p>

<p class="MsoNormal"><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB"> </span></font></span></p>

<p class="MsoNormal"><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-GB">I’ve tested this link </span></font></span></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><a href="http://n2.nabble.com/using-OGR-OSR-from-C-where-to-put-the-dependent-DLLs-td2032457.html" title="http://n2.nabble.com/using-OGR-OSR-from-C-where-to-put-the-dependent-DLLs-td2032457.html" target="_blank">http://n2.nabble.com/using-OGR-OSR-from-C-where-to-put-the-dependent-DLLs-td2032457.html</a></span></font></p>


<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">but it doesn’t work at all.</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Please I need help</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Thanks</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Sébastien DECORME</span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

<p class="MsoNormal"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> </span></font></p>

</div>

</div>


<br>_______________________________________________<br>
FWTools mailing list<br>
<a href="mailto:FWTools@lists.maptools.org">FWTools@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/fwtools" target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a><br>
<a href="http://fwtools.maptools.org/" target="_blank">http://fwtools.maptools.org/</a><br>
<br></blockquote></div><br>