Opened 12 years ago

Closed 12 years ago

#4685 closed defect (invalid)

problems with implementing my own GDALDataset

Reported by: dawnsun Owned by: warmerdam
Priority: high Milestone:
Component: default Version: 1.9.1
Severity: normal Keywords: GDALDataset
Cc:

Description

I download the gdal-1.9.1 sourcecode, compile it successfully, and create a new MFC project which wants to do something using gdal. In my MFC project,i just write a class called MyTest_gdal as follows:

#include <gdal_priv.h> class MyTest_gdaldataset : public GDALDataset { public:

MyTest_gdaldataset() {

m_iValue = 32; eAccess = GA_Update; nRasterXSize = 5000; nRasterYSize = 6000;

} virtual ~MyTest_gdaldataset() {

FlushCache();

} int m_iValue;

};

then , suddenly i find the strange result as follows:

GDALDataset* pTest = new MyTest_gdaldataset(); int iX= pTest->GetRasterXSize( ); int iY= pTest->GetRasterYSize( );

Here, the variable iX=1 , and iY = 5000. So surprise? and I find that the memory of pTest is already wrong , what's wrong??

I deadly need your help, and hope that you can send me a Email when you solve this problem. Thank you very much. My Email addr: qzning@…

Change History (1)

comment:1 by Even Rouault, 12 years ago

Milestone: 1.9.2
Resolution: invalid
Status: newclosed

This is not a GDAL bug (so it is not appropriate for a GDAL Trac ticket), but something with how you use GDAL. Please refer to the GDAL driver tutorial ( http://gdal.org/gdal_drivertut.html ) and/or send an email to the gdal-dev mailing list if you cannot solve your problems.

Note: See TracTickets for help on using tickets.