<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=071353712-20032006><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>I have obtained the
SDE driver from latest CVS snapshot and compiled on Windows with VC8 (Visual
Studio 2005). </FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>As I am accessing
the GDAL dll from C# I had to make some additional steps, which are not
necessary when compiling with earlier versions of Visual
C++:</FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>- nmake /f
makefile.vc</FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>- mt /manifest
gdal13.dll.manifest
/outputresource:gdal13.dll;#2
(this is new to VS 2005)</FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>- cd
ogr/ogrsf_formats/sde</FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>- nmake /f
makefile.vc ogr_SDE.dll</FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>- mt /manifest
ogr_SDE.dll.manifest
/outputresource:ogr_SDE.dll;#2
(this is new to VS 2005)</FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>Thanks to MS, VC8
automatically generates a .manifest file for all DLLs generated by GDAL
makefiles (I suppose this will apply to almost any existing makefiles ...). And
thanks to MS, this additional .manifest file is useless for C# environments and
must be included as resource with ID 2. </FONT></SPAN><SPAN
class=071353712-20032006><FONT face=Arial size=2>Without that people will obtain
a fine DllNotFoundException from .Net ("the specified module could not be found"
or sth.) AND from C++ apps linking to GDAL dll. </FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006></SPAN><SPAN class=071353712-20032006><FONT
face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=071353712-20032006><FONT face=Arial size=2>Now, my really
problem: using the new SDE driver already everything is working, except access
to date fields. Currently I am obtaining a Win32 exception, after that the
application is terminated automatically by vcrt. The error occurs within
the following line </FONT></SPAN><SPAN class=071353712-20032006><FONT face=Arial
size=2>ogrsdelayer.cpp ( line 799):</FONT></SPAN></DIV>
<DIV><SPAN class=071353712-20032006>
<P><FONT face=Arial><FONT size=2><SPAN class=071353712-20032006>s</SPAN>trftime(
szDate, <FONT color=#0000ff>sizeof</FONT>(szDate), <FONT color=#800000>"%T
%<SPAN class=071353712-20032006>m</SPAN>/%<SPAN
class=071353712-20032006>d</SPAN>/%Y"</FONT>, &sDateVal );</FONT></FONT></P>
<P><FONT face=Arial size=2></FONT> </P>
<P><SPAN class=071353712-20032006><FONT face=Arial size=2>I have debugged and
sDateVal seems to contain valid data (Mar. 15th of 2004):</FONT></SPAN></P>
<P><SPAN class=071353712-20032006><FONT face=Arial
size=2>tm_sec=0<BR>tm_min=0<BR>tm_hour=0<BR></FONT></SPAN><SPAN
class=071353712-20032006><FONT face=Arial
size=2>tm_mday=15<BR>tm_mon=2<BR>tm_year=104<BR>tm_wday=1<BR>tm_yday=75<BR>tm_isdst=-1</FONT></SPAN></P>
<P><SPAN class=071353712-20032006><FONT face=Arial size=2>In other
cases, many of these date errors are having to do with regional
settings. I am not an expert in C++, but looking at the following URL I did not
see any mention to the %T format string (may be it is only defined in UNIX
systems?):<BR><A
href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_strftime.2c_.wcsftime.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_strftime.2c_.wcsftime.asp</A></FONT></SPAN></P>
<P><SPAN class=071353712-20032006><FONT face=Arial size=2>For the moment, I
thought a classic sprintf may help:</FONT></SPAN></P></SPAN></DIV></SPAN></DIV>
<DIV><SPAN class=071353712-20032006>
<P><FONT face=Arial size=2>sprintf(szDate, <FONT color=#800000>"%02i:%02i:%02i
%02i/%02i/<SPAN
class=071353712-20032006>%</SPAN>i"</FONT>,sDateVal.tm_hour,sDateVal.tm_min,sDateVal.tm_sec,sDateVal.tm_mday,sDateVal.tm_mon,sDateVal.tm_year+1900);
</FONT><FONT color=#008000><FONT face=Arial size=2>//here the '2' is the
precision</FONT></P>
<P></FONT><FONT><SPAN class=071353712-20032006><FONT face=Arial size=2>With this
change, at least a call to GetNextFeature() does not
crash.</FONT></SPAN></P></FONT></SPAN></DIV>
<DIV align=left>
<DIV align=left><FONT face=Arial><FONT size=2><SPAN
class=071353712-20032006>Regards.</SPAN></FONT></FONT></DIV>
<DIV align=left><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><SPAN lang=ES-TRAD
style="FONT-SIZE: 7.5pt; COLOR: navy; FONT-FAMILY: Arial; mso-ansi-language: ES-TRAD">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT color=#000000
size=3>Michael</FONT></SPAN></P></DIV></DIV></BODY></HTML>