|
Hi All,
i download opensourcecode to unzip a folder from below path
------http://www.winimage.com/zLibDll/minizip.html-------
->How to get the Minizip package and then 1.1 with zip64 support
i want to unzip a folder to another location.
Lets say if the zip file is at
C:\\temp\\aaa.zip
i want to unzip aaa.zip at C:\\temp\\abcd\\aaa
once i download the files from the above link i get Unzip.h file and use unzOpen() function. but unfortunately, its not working as per my expectation.
is there any body who can help me ?
below is my code :
***************************************************************
HRESULT UnZipFile(CAtlString srcPath, CAtlString tgtPath,CAtlString& errorMessage)
{
HRESULT hr=NOERROR;
CAtlString message;
INT result=0;
unzFile pZipFile=unzOpen((CAtlStringA)tgtPath);
if(pZipFile==NULL)
{
hr=E_FAIL;
message.Format(_T("Failed to open a zip file.\r\n%s"), tgtPath);
errorMessage=message;
}
return hr;
}
*****************************************************************
Kind regards,
Praveer
|
|
|
|
|
Hello,
Did you check what this E_FAIL is returning ?
Regards,
Gopi.
|
|
|
|
|
Quote: its not working as per my expectation
What are your expectations and what is the observed behaviour?
Veni, vidi, vici.
|
|
|
|
|
Hi,
the expected behavior is program should unzip the folder
|
|
|
|
|
How so if you don't even use the source path in your code?
P.S.:
More to the point, you don't call any functions to actually unzip anything! Unzopen fails, because it expects the zip file name/path, but you are passing to it the target path, which presumably is a directory, not a file at all. NMo wonder it doesn't work!
Moreover, unzOpen only provides a handle to the zip file that lets you access the individual files contained within, you need to use variuous other functions to walk over the list of files, find their relative path, and extract it to the target location.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Member 4201820 wrote: i want to unzip aaa.zip at C:\\temp\\abcd\\aaa Does that folder exist? If not, will unzOpen() create it? What is the value of tgtPath ? Have you tried sending an email to info@winimage.com?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Need to pass data from the sound wave convert ogg
|
|
|
|
|
|
I need to implement a recording function, using MFC to do and send the recording file to the Android mobile phone, all I need will be wav convert ogg, recording and use speex technology, but I never used, not used.
All programs ape to friends, please tell me what you know, it is better for examples of MFC recording convert ogg.Thank you!
renxiaoyao
|
|
|
|
|
renxiaoyaoa8 wrote: it is better for examples of MFC You should use Google to look for samples. When you have specific technical questions then come back and post them here.
|
|
|
|
|
|
I have a program that display a popup dialog above the notification area of the task bar. I am using the following function to get the work area of the primary monitor.
CRect rcDesktop;
::SystemParametersInfo(SPI_GETWORKAREA,0,&rcDesktop,0);
CRect rc;
GetWindowRect(rc);
ScreenToClient(rc);
unsigned int m_nStartPosX = rcDesktop.right - rc.Width() - 1;
unsigned int m_nStartPosY = rcDesktop.bottom - rc.Height();
SetWindowPos(
&wndTop,
m_nStartPosX,
m_nStartPosY,
rc.Width(),
rc.Height(),
SWP_NOOWNERZORDER | SWP_NOACTIVATE);
I tested my program on my single/dual monitor setups and it's working correctly, but one of my users reported that on his three monitor setup, the popup dialog is displaying on the wrong monitor. It seems like SystemParametersInfo() can't get the correct working area on his system. Does anyone know any other way to get the working area of the primary monitor?
-- modified 2-Jun-14 17:00pm.
|
|
|
|
|
Looks good to me. Rather than looing for "another method" I'd verify user assumptions about where the dialog is supposed to appear are right. Also, trace or log output (return value, GetLastError, coordinates acquired).
|
|
|
|
|
Hi,
Make sure you are compiling with COMPILE_MULTIMON_STUBS defined and add #include <multimon.h>
Best Wishes,
-David Delaune
|
|
|
|
|
Hi,
I currently get data from a website like this;
Go to the webpage, wait while the page loads, "select" the data in the webpage by dragging my mouse over it, Copy to clipboard, call up my text editor, Paste the data into the editor, save the output, analyze the data using my C++/MFC Analyzer.
There must be a way I can get the data without the need to copy/paste etc.
I know something about HTTP Connections, sockets, etc., but I am at a loss to know just what parameters need to be passed to the website in the request. I tried just sending the URL of the webpage, which returned a lot of stuff which I did not want.
Does anyone have a simple example of how this is supposed to work?
Thanks so much,
Bryan.
|
|
|
|
|
If you read the HTML output directly then there will be a load of stuff that you are perhaps not interested in. The answer is to find some classes that help you find specific parts quickly, and C++/MFC does not offer the facilities that are available in .NET. Most web scrapers are written in the latter framework using C# or VB.NET. As to what information to send to the website, that depends on the website itself as each one has its own structure.
|
|
|
|
|
Bryan Anslow wrote: Go to the webpage, wait while the page loads, "select" the data in the webpage by dragging my mouse over it, Copy to clipboard, call up my text editor, Paste the data into the editor, save the output, analyze the data using my C++/MFC Analyzer. I think you can replace all but the last of these steps with URLDownloadToFile().
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hey, that works well, thanks for pointing me at that function.
My minor hurdle right now is that I need to login with my userid and password to access one of the pages.
Don't suppose that there is some way of getting my credentials in there somehow?
Thanks,
Bryan.
|
|
|
|
|
See if NetUseAdd() helps.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I got the word that I am supposed to be ready to take on some MFC work
I'm starting here with this link...
Tutorial by Sung of the University Of Washington / Bothell[^]
I found THIS PAGE[^] on Microsoft's website, but my impression is that that page is for experts who already know everything about it.
I welcome helpful suggestions on where to look, read, practice, etc.
modified 2-Jun-14 6:53am.
|
|
|
|
|
|
Books by Jeff Prosise have been helpful to me and many others.
|
|
|
|
|
hello my friends. how i can pause a timer in qelapsedclass in qt?
i looked for but i couldnt find any function . can anyone help me?
thanks
|
|
|
|
|
|
Hi world. how i can convert a QString to char* in QT?
is there any function?
thanks
|
|
|
|