| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1667 人关注过本帖
标题:c# 结构体数组问题 求高手帮忙!!!!!
只看楼主 加入收藏
maomao4109
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-3-27
收藏
 问题点数:0 回复次数:3 
c# 结构体数组问题 求高手帮忙!!!!!
功能:反回 GridID 编号文件的 GRID 信息

ByVal GridID As Long 为输入值
stGrid As GRID 为返回值

vb 源码 :
Declare Function VBGetGridPropsStdCall Lib "Grid.dll" (ByVal GridID As Long, stGrid As GRID) As Long

Type GRID
    pszName As String
    lGridID As Long
    pszTableName As String
    pszCoordSys As String
    pszCoordName As String
    pszZDesc As String
    pszXYUnitName As String
    lCoordUnits As Long
    dXMin As Double
    dXMax As Double
    dYMin As Double
    dYMax As Double
    uGridWidth As Long
    uGridLength As Long
    dCellSize As Double
    fVersionNumber As Double
    byDisplayStatus As Long
    byGridDataType As Long
    byNumBytesPerRawVal As Long
    lGridType As Long
    stGrdInfo As VB_GRD_INFO
    stGrcInfo As VB_GRC_INFO
    byGridModified As Long
End Type

Type VB_GRD_INFO
    fZmin As Double
    fZmax As Double
    ZUnitType As Long
    pszZUnits As String
    fLightAzimuth As Double
    fLightAngle As Double
    uNumInflections As Long
    stInflectionDesc(0 To 63) As VB_INFLECTION_DESC

End Type


Type VB_GRC_DICT
    iRed As Long
    iGreen As Long
    iBlue As Long
    pszDescr As String
End Type

Type VB_INFLECTION_DESC
    fZValue As Double
    RGBColor As Long
End Type

我想转成C# 文件
public static extern int VBGetGridPropsStdCall(int GridID,[Out] GRID stGrid);
但不知道结构体如何改 c# 不能直接定义数组大小;
求高手帮忙!!!!!

[[it] 本帖最后由 maomao4109 于 2008-8-7 15:27 编辑 [/it]]
搜索更多相关主题的帖子: 结构体 数组 
2008-08-07 15:25
maomao4109
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-3-27
收藏
得分:0 
自已顶
顶顶顶
2008-08-07 16:14
fjfhnui
Rank: 1
等 级:新手上路
帖 子:57
专家分:0
注 册:2007-6-18
收藏
得分:0 
c# 不能直接定义数组大小 谁说的
2008-08-11 00:02
tpriwwq
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-7-24
收藏
得分:0 
private int[] myvalue;

myvalue = new int[5];

这个大小就定义了
2008-08-12 13:01
快速回复:c# 结构体数组问题 求高手帮忙!!!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022749 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved