Select to view content in your preferred language

how to open shapefile from application outside of arcmap

675
0
08-03-2011 05:53 PM
HongyuNiu
New Contributor
Hi, I have trouble to get workspace using open from file. here my codes:

'shape file workspace is kind of file system workspace

Dim pWSFactPipeline As IWorkspaceFactory

pWSFactPipeline = New ShapefileWorkspaceFactory

If pWSFactPipeline Is Nothing Then

MsgBox("pointer to workspace factory is null")

End If

'work space is directory of file system

MsgBox("shapefile workspace type is " & pWSFactPipeline.WorkspaceType.ToString)

MsgBox("workspace description: " & pWSFactPipeline.WorkspaceDescription(True))

If pWSFactPipeline.IsWorkspace("D:\Data") Then

MsgBox(strWS & " is shapefile workspace")

End If


Dim pFeatureWSPipeline As IFeatureWorkspace = CType(pWSFactPipeline.OpenFromFile("D:\Data", hWnd), IFeatureWorkspace)



'open featureclass (shape file)

Dim pFeatureClassPipeline As IFeatureClass

pFeatureClassPipeline = pFeatureWSPipeline.OpenFeatureClass(strNamePipeline)


My program is stuck in the bold part. I am not sure that how I can get hWnd.

Thanks for your help.
0 Kudos
0 Replies