<html><head></head><body><div class="ydp8a8fa506yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">See code below:</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I downloaded GDAL 3.x for Windows from the GISInternals website.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I have Windows 10 64Bit, Visual Studio 2019 C++</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">The code below loads a data file after calling <span>GDALAllRegister();</span></div><div dir="ltr" data-setdir="false"><span>There are no runtime or GDAL errors reported.</span></div><div dir="ltr" data-setdir="false"><span>But the header results are incorrect and corrupted. See attached Debug Window.</span></div><div dir="ltr" data-setdir="false"><span>I tried loading a 3D TIFF file and a ENVI file, with the same problem. </span></div><div dir="ltr" data-setdir="false"><span>Any Idea what the problem could be?</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><span>Note, from the ENVI ascii data File Header, the raster size should be 320x190 with 256 bands for this example.</span></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">//------------------- CODE</div><div dir="ltr" data-setdir="false"><div><div>void CMFCApplication3Dlg::OnBnClickedButton1()</div><div>{</div><div><span style="white-space: pre-wrap;"> </span>CStringA fileName = "C:\\temp\\PC_IT5_G2.bin";</div><div><br></div><div><span style="white-space: pre-wrap;"> </span>// C++ </div><div><span style="white-space: pre-wrap;"> </span>GDALDataset* data = (GDALDataset*)GDALOpen(fileName, GA_ReadOnly);</div><div><br></div><div><span style="white-space: pre-wrap;"> </span>// C </div><div><span style="white-space: pre-wrap;"> </span>GDALDatasetH dataH = GDALOpen(fileName, GA_ReadOnly);</div><div><span style="white-space: pre-wrap;"> </span>GDALDriverH hDriver = GDALGetDatasetDriver(dataH);</div><div><br></div><div><span style="white-space: pre-wrap;"> </span>CStringA NameS = GDALGetDriverShortName(hDriver);</div><div><span style="white-space: pre-wrap;"> </span>CStringA NameL = GDALGetDriverLongName(hDriver);</div><div><br></div><div><span style="white-space: pre-wrap;"> </span>int nx = GDALGetRasterXSize(hDriver);</div><div><span style="white-space: pre-wrap;"> </span>int ny = GDALGetRasterYSize(hDriver);</div><div><span style="white-space: pre-wrap;"> </span>int nz = GDALGetRasterCount(hDriver);</div><div><br></div><div><span style="white-space: pre-wrap;"> </span>CStringA errMsg = CPLGetLastErrorMsg();</div><div><br></div><div><span style="white-space: pre-wrap;"> </span>int i = 0;</div><div>}</div></div><br></div><div dir="ltr" data-setdir="false">//------------------------ FILE HEADER minus Meta Data</div><div dir="ltr" data-setdir="false"><div><div>ENVI</div><div>acquisition time = 2020-04-29T15:53:46.486+00:0</div><div>samples = 320</div><div>lines = 190</div><div>bands = 256</div><div>header offset = 0</div><div>file type = ENVI Standard</div><div>data type = 12</div><div>interleave = bip</div><div>byte order = 0</div><div>wavelength units = Nanometers</div><div>wavelength = {</div><div> 948.74, 951.95, 955.16, 958.37,</div><div> 961.58, 964.79, 968, 971.22,</div><div> 974.44, 977.65, 980.87, 984.1, ......</div></div><br></div></div></body></html>