//时间结构;用以表达时间;
typedef struct {
unsigned long Year; //年;
unsigned char Month; //月;
unsigned char Day; //日;
unsigned char Hour; //时;
unsigned char Minute; //分;
unsigned char Second; //秒;
} TIME; typedef struct {
char Name[21];
TIME StartTime;
}COXPLAYDATA; typedef struct {
COXPLAYDATA * PlayData;
} COXGETPLAYDATA; COXGETPLAYDATA data;
memset(&data,0,sizeof(data));
data.PlayData=new COXPLAYDATA[2000];
data.StartTime.Year=m_sy;
data.StartTime.Month=m_sm;
data.StartTime.Day=m_sd;
data.StartTime.Hour=m_sh;
data.StartTime.Minute=m_smin;
data.StartTime.Second=m_ss;
data.MaxNum=2000;
上面是用vc写的,用VB怎样实现?多谢!
typedef struct {
unsigned long Year; //年;
unsigned char Month; //月;
unsigned char Day; //日;
unsigned char Hour; //时;
unsigned char Minute; //分;
unsigned char Second; //秒;
} TIME; typedef struct {
char Name[21];
TIME StartTime;
}COXPLAYDATA; typedef struct {
COXPLAYDATA * PlayData;
} COXGETPLAYDATA; COXGETPLAYDATA data;
memset(&data,0,sizeof(data));
data.PlayData=new COXPLAYDATA[2000];
data.StartTime.Year=m_sy;
data.StartTime.Month=m_sm;
data.StartTime.Day=m_sd;
data.StartTime.Hour=m_sh;
data.StartTime.Minute=m_smin;
data.StartTime.Second=m_ss;
data.MaxNum=2000;
上面是用vc写的,用VB怎样实现?多谢!
long as year
month as byte
day as byte
hour as byte
minute as byte
second as byte
end typetype COXPLAYDATA
name(0 to 20) as byte
starttime as time
end typetype COXGETPLAYDATA
PlayData() as COXPLAYDATA
end typedim data as COXGETPLAYDATAredim data.PlayData(2000) as COXPLAYDATA
data.StartTime.Year=m_sy
data.StartTime.Month=m_sm
data.StartTime.Day=m_sd
data.StartTime.Hour=m_sh
data.StartTime.Minute=m_smin
data.StartTime.Second=m_ss
data.MaxNum=2000
结束时别忘记调用
erase data.playdata
如 Type VitalInfo
Name as String
Salary As Long
SocSec As String
End Type建立变量Private/public YourName as VitalInfodim YourName as VitalInfo
数组变量
dim CompanyRecord(1 To 12) As VitalInfo
赋值YourName.Name ="abd"
YourName.Salary =1000
YourName.Socsec ="036-78-9987"数值赋值
Static Count as Integer
CompanyRecord(Count).Name ="dd"用户定义类型/记录可以嵌套使用
{
int i;
for(i=0; i<p->MaxNum; i++)
{
p->PlayData[i].Name= "lexus"; }
return 42;
}
但我在vb调用上面的API函数时返回p->PlayData是空的?不知道为什么?