<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.3790.2541" name=GENERATOR>
<STYLE>
<!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Verdana;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
/* Page Definitions */
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
-->
</STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Verdana color=#0000ff size=2>Dear <FONT color=#000000>Frank
Warmerdam</FONT></FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV> Thank you for your
advise.I though the backslash is one possible reason.</DIV>
<DIV> When I put the
above code in pure console ,it works well. But when I put them in a qt project
,it can't get the dataset . I put these code in the begining of qt
project after main() .It should run first .I think if I
include file #include "gdal_priv.h" and link gdal lib file ,it should work
.</DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV align=left>
<DIV align=left><FONT face=Verdana size=2>
<HR style="WIDTH: 122px; HEIGHT: 2px" SIZE=2>
</FONT></DIV>
<DIV><FONT color=#c0c0c0><FONT face=Verdana size=2>gislif</FONT></DIV>
<DIV><FONT face=Verdana size=2>2005-12-15</FONT></FONT></DIV></DIV>
<DIV><FONT face=Verdana size=2>
<HR>
</FONT></DIV>
<DIV><FONT face=Verdana><FONT size=2><STRONG>发件人:</STRONG> Frank
Warmerdam</FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT size=2><STRONG>发送时间:</STRONG>
2005-12-15 22:50:09</FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT size=2><STRONG>收件人:</STRONG>
gislif</FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT size=2><STRONG>抄送:</STRONG>
gdal-dev@lists.maptools.org</FONT></FONT></DIV>
<DIV><FONT face=Verdana><FONT size=2><STRONG>主题:</STRONG> Re: [Gdal-dev] same
code, different result?</FONT></FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>
<DIV>On 12/15/05, gislif <gislf@126.com >
wrote:</DIV>
<DIV>></DIV>
<DIV>> Hello,</DIV>
<DIV>></DIV>
<DIV>>
Why the same code has
diferent result? I have the following</DIV>
<DIV>> code in two deferent seperate
program to generate dataset, one
program</DIV>
<DIV>> (which has only these codes
)is ok ,the other(which has other
program</DIV>
<DIV>> writen by qt )
failed. why? seting
mistake?</DIV>
<DIV>></DIV>
<DIV>></DIV>
<DIV>> int main( int argc, char **argv
)</DIV>
<DIV>> {</DIV>
<DIV>> //</DIV>
<DIV>> GDALDataset *poDataset;</DIV>
<DIV>> GDALRasterBand *poBand;</DIV>
<DIV>></DIV>
<DIV>> GDALAllRegister();</DIV>
<DIV>></DIV>
<DIV>> poDataset = (GDALDataset *)
GDALOpen( "c:\output.jpg", GA_ReadOnly );</DIV>
<DIV> </DIV>
<DIV>"gislif",</DIV>
<DIV> </DIV>
<DIV>Does the above really work? My
understanding is that the backslash</DIV>
<DIV>would always get interpreted as an
escape character on the "o"</DIV>
<DIV>so you would end up trying to
open the file "c:output.jpg" which
would</DIV>
<DIV>depend on your current directory.
In C/C++ I always double backslashes</DIV>
<DIV>in paths.</DIV>
<DIV> </DIV>
<DIV>eg.</DIV>
<DIV>GDALOpen( "C:\\output.jpg", GA_ReadOnly );</DIV>
<DIV> </DIV>
<DIV>I am not aware of any reason GDAL
should work differently in a Qt</DIV>
<DIV>app than not in a Qt app.</DIV>
<DIV> </DIV>
<DIV>Best regards,</DIV>
<DIV>--</DIV>
<DIV>---------------------------------------+--------------------------------------</DIV>
<DIV>I set the clouds in motion - turn
up | Frank Warmerdam,
warmerdam@pobox.com</DIV>
<DIV>light and sound - activate the windows
| <A
href="http://pobox.com/~warmerdam">http://pobox.com/~warmerdam</A></DIV>
<DIV>and watch the world go round -
Rush | Geospatial Programmer
for Rent</DIV>
<DIV> </DIV>
<DIV>.</DIV></FONT></DIV></BODY></HTML>