struct sfiledata_t
{
unsigned int attrib;
long time_create;
long time_access;
long time_write;
unsigned long size;
std::string name;
unsigned long objid;
unsigned long creater;
unsigned int attribex;
unsigned int version;
unsigned int maxsize;
}; //使用
BOOL CNormalDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here struct sfiledata_t soap_file;
m_pSoap->GetFileInfo(m_szObjPath,&soap_file);
GetDlgItem(IDC_STATIC_TYPE)->SetWindowText("文件夹");
//文件名
m_filename.Format("%s", soap_file.name);
UpdateData(FALSE);
//空间大小
CString tempstr;
tempstr = itoa(soap_file.size,tempstr.GetBuffer(0),10);
tempstr = tempstr + " bytes";
GetDlgItem(IDC_STATIC_BYTE)->SetWindowText(tempstr); //创建日期
CString temptime;
temptime = itoa(soap_file.time_create,temptime.GetBuffer(0),10);
GetDlgItem(IDC_STATIC_TIME)->SetWindowText(temptime); //属性设置
if(soap_file.attrib & _A_RDONLY) //只读
m_readonly.SetCheck(1);
if(soap_file.attrib & _A_HIDDEN ) //隐藏
m_hide.SetCheck(2);
if(soap_file.attrib & _A_ARCH ) //归档
m_archive.SetCheck(3); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE
}这样做为什么出错啊,文件名出错,大小和日期都不是想要的结果,为负值,请问该如何做呢?
{
unsigned int attrib;
long time_create;
long time_access;
long time_write;
unsigned long size;
std::string name;
unsigned long objid;
unsigned long creater;
unsigned int attribex;
unsigned int version;
unsigned int maxsize;
}; //使用
BOOL CNormalDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here struct sfiledata_t soap_file;
m_pSoap->GetFileInfo(m_szObjPath,&soap_file);
GetDlgItem(IDC_STATIC_TYPE)->SetWindowText("文件夹");
//文件名
m_filename.Format("%s", soap_file.name);
UpdateData(FALSE);
//空间大小
CString tempstr;
tempstr = itoa(soap_file.size,tempstr.GetBuffer(0),10);
tempstr = tempstr + " bytes";
GetDlgItem(IDC_STATIC_BYTE)->SetWindowText(tempstr); //创建日期
CString temptime;
temptime = itoa(soap_file.time_create,temptime.GetBuffer(0),10);
GetDlgItem(IDC_STATIC_TIME)->SetWindowText(temptime); //属性设置
if(soap_file.attrib & _A_RDONLY) //只读
m_readonly.SetCheck(1);
if(soap_file.attrib & _A_HIDDEN ) //隐藏
m_hide.SetCheck(2);
if(soap_file.attrib & _A_ARCH ) //归档
m_archive.SetCheck(3); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE
}这样做为什么出错啊,文件名出错,大小和日期都不是想要的结果,为负值,请问该如何做呢?
解决方案 »
- WTL中有没有表示类名的m_strClass?
- 单文档中的视图刷新问题。
- 如何使鼠标点击ListCtrl某行时,该行不高亮,不变蓝?
- 错误Exception:0xC0000005,指针越界问题
- 为什么我的VC6.0装了之后不能运行阿?(编译正常)
- VC下网络编程
- 简单问题;如何把两个unsigned long 的合并为一个字符串
- 微软拼音输入法的输入汉字区域如何制作的
- 程序读写自己全部内存,怎么做?
- MSCOMM控件串口通信 内存泄露问题的解决
- 求一个对大虾来说简单的问题:如何在使用socket API的时候,让socket的操作变成非阻塞的?
- 求救,如何完全控制createprocess 建立进程?
m_pSoap->GetFileInfo(m_szObjPath,&soap_file);
读取后的数据是否正确 ?没有太多时间帮你试,不好意思