void CMy1View::FileOpen()
{
CFileDialog openzipDlg(TRUE, ".zip", "",
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "程序文件(*.zip)|*.zip|All Files (*.*)|*.*||");
openzipDlg.m_ofn.lpstrTitle="选择解压缩文件";
if(openzipDlg.DoModal()==IDOK)
{
m_strMonitorPath = openzipDlg.GetPathName();
CFile file(m_strMonitorPath,CFile::modeRead);
char *pBuf;
DWORD dwFileLen;
dwFileLen=file.GetLength();
pBuf=new char[dwFileLen];
file.Read(pBuf,dwFileLen);
FileOpen2();
}
}void CMy1View::FileOpen2()
{
char dir[MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = m_hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = dir;
bi.lpszTitle = "解压路径";
bi.ulFlags = 0;
bi.lpfn = NULL; char pszDisplayName[MAX_PATH];
char *m_strDataPath;
LPITEMIDLIST lpID = SHBrowseForFolder(&bi); if(lpID != NULL){
if(SHGetPathFromIDList(lpID, pszDisplayName)){
int len=100;
m_strDataPath = pszDisplayName;
CFile file2(dir,CFile::modeCreate | CFile::modeWrite);
file2.Close();
}
}
}
帮我看看吧
{
CFileDialog openzipDlg(TRUE, ".zip", "",
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "程序文件(*.zip)|*.zip|All Files (*.*)|*.*||");
openzipDlg.m_ofn.lpstrTitle="选择解压缩文件";
if(openzipDlg.DoModal()==IDOK)
{
m_strMonitorPath = openzipDlg.GetPathName();
CFile file(m_strMonitorPath,CFile::modeRead);
char *pBuf;
DWORD dwFileLen;
dwFileLen=file.GetLength();
pBuf=new char[dwFileLen];
file.Read(pBuf,dwFileLen);
FileOpen2();
}
}void CMy1View::FileOpen2()
{
char dir[MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = m_hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = dir;
bi.lpszTitle = "解压路径";
bi.ulFlags = 0;
bi.lpfn = NULL; char pszDisplayName[MAX_PATH];
char *m_strDataPath;
LPITEMIDLIST lpID = SHBrowseForFolder(&bi); if(lpID != NULL){
if(SHGetPathFromIDList(lpID, pszDisplayName)){
int len=100;
m_strDataPath = pszDisplayName;
CFile file2(dir,CFile::modeCreate | CFile::modeWrite);
file2.Close();
}
}
}
帮我看看吧
我知道用zlib库,但我不知道该怎么用??
请告诉我吧!!
或者好心的话,给我修改下代码吧!!