GM_AddCustomAreaClass FUNCTION
Hi Mike,
I tried to call the GM_AddCustomAreaClass(string, GM_AreaSTyle_t, Int16), it gave me an Error code 2.
Could you let me know what wrong with my definitions?
Public Declare Function GM_AddCustomAreaClass Lib "GlobalMapperInterface" _
( _
ByVal aName As String, _
ByVal aStyle As GM_AreaStyle_t, _
ByRef aFeatureCode As Int16 _
) As Int32
<StructLayout(LayoutKind.Sequential)> Public Structure GM_AreaStyle_t
Public mBorderPenStyle As GM_PenStyle_t16
Public mBorderPenWidth As Int16
Public mBorderPenColor As Integer
Public mBrushColor As Integer
Public mBrushStyle As GM_BrushStyle_t16
Public mDrawLabel As Byte
Public mDrawLabelAlways As Byte
Public mFont As GM_FontDef_t
End Structure
<StructLayout(LayoutKind.Sequential)> Public Structure GM_FontDef_t
Public mFaceName As String
Public mColor As Integer
Public mWeight As Int16
Public mPointSize As Byte
Public mItalicize As Byte
Public mUnderline As Byte
Public mStrikeout As Byte
Public mCharset As Byte
Public mBgMode As GM_FontBackground_t8
Public mFixedHgt As Single
Public mPlacement As GM_LabelPlacement_t8
Public mReserved1 As Byte
Public mReserved2 As Byte
Public mReserved3 As Byte
Public mAngle As Single
End Structure
Thanks in advance!
Dilys
I tried to call the GM_AddCustomAreaClass(string, GM_AreaSTyle_t, Int16), it gave me an Error code 2.
Could you let me know what wrong with my definitions?
Public Declare Function GM_AddCustomAreaClass Lib "GlobalMapperInterface" _
( _
ByVal aName As String, _
ByVal aStyle As GM_AreaStyle_t, _
ByRef aFeatureCode As Int16 _
) As Int32
<StructLayout(LayoutKind.Sequential)> Public Structure GM_AreaStyle_t
Public mBorderPenStyle As GM_PenStyle_t16
Public mBorderPenWidth As Int16
Public mBorderPenColor As Integer
Public mBrushColor As Integer
Public mBrushStyle As GM_BrushStyle_t16
Public mDrawLabel As Byte
Public mDrawLabelAlways As Byte
Public mFont As GM_FontDef_t
End Structure
<StructLayout(LayoutKind.Sequential)> Public Structure GM_FontDef_t
Public mFaceName As String
Public mColor As Integer
Public mWeight As Int16
Public mPointSize As Byte
Public mItalicize As Byte
Public mUnderline As Byte
Public mStrikeout As Byte
Public mCharset As Byte
Public mBgMode As GM_FontBackground_t8
Public mFixedHgt As Single
Public mPlacement As GM_LabelPlacement_t8
Public mReserved1 As Byte
Public mReserved2 As Byte
Public mReserved3 As Byte
Public mAngle As Single
End Structure
Thanks in advance!
Dilys
Comments
-
Dilys,
Your aAreaStyle parameter should be passed ByRef rather than ByVal since you need the pointer to the structure passed in and not a copy of the structure.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Oh, yes!
Thanks Mike!
Cheers
Dilys
Categories
- 12.9K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 645 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 419 Projection Questions
- 829 Raster Data
- 1.4K Vector Data
- 6.6K Support
- 180 Announcement and News
- 926 Bug Report
- 561 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 575 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 242 How I use Global Mapper
- 108 Global Mapper Forum Website