Q&A - Question

GIS_DataSet gives an error message

Question
Bahodir asked on January 30, 2020, keyword: Developer Kernel
Hi, I have a problem with GIS_DataSet

I uploaded to TGIS_ViewerWnd some shp files
using TComboBox i want to see selected shp data in TDBGrid.

This my code:
for TComboBox OnSelect
GIS_DataSet1->Open( (TGIS_LayerVector *)( GIS->Items->Items[ComboBox1->ItemIndex] ), GIS->Extent ) ;


The problem is that when I select any shp

for example

i choose "city" i see the data in TDBGrid
then i choose "water" data is displayed in TDBGrid
then when I choose the "city" again the program gives such an error
 
Access violation at address 00652333 in modelu 'exename.exe'. Read of address 00000000.

what can I do?
Answers
Artur Redzko (TatukGIS) replied January 30, 2020
Please send us a test case project on support@.
I suggest using an extent in units that are in a layer coordinate space. Otherwise, for a projected map (GIS.CS <> layer.CS) where extents are in different ranges, a dataset will be empty. 
If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.