Knowledge Base Article
KB10412 - Using DK-ActiveX in a Visual C++ environment, I am unable to set up the parameters on a shape layer (e.g., color, style, width, etc.). From the samples the VB code looks like the following:
Set ll = New XGIS_LayerSHP
ll.Path = GisUtils.GisSamplesDataDir + "rivers.shp"
ll.Name = "rivers"
ll.UseConfig = False
ll.Params.Line.OutlineWidth = 0
ll.Params.Line.Width = 3
ll.Params.Line.Color = RGB(0, 0, 255)
GIS.Add ll
But in VC++ 6.0 the 'Params.Line' attribute does not seem to be exposed. There does not seem to be any way to go up the hierarchy to the XGIS_ParamsLine class. And there does not seem to be any functions in the type that expose it.
The problem that you describe relates to casting. We advise you to refer to the DK hierarchy diagram and DK help file for references to class dependences.
To set up the cast to the proper types, you would need to do the following:
CXGIS_LayerVector *ll;
CXGIS_ParamsSectionVector *params;
CXGIS_ParamsLine *line;
params = (CXGIS_ParamsSectionVector *) ll->get_Params();
line = (CXGIS_ParamsLine *) params->get_Line();
line->put_Color(0);
Created: 2004-06-30, Modified: 2005-09-14
|