Click here to Skip to main content
16,011,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Shell API Pin
vijayaramaraju29-Sep-01 1:48
vijayaramaraju29-Sep-01 1:48 
GeneralRe: Shell API Pin
vijayaramaraju29-Sep-01 1:48
vijayaramaraju29-Sep-01 1:48 
GeneralInternet Post Questions Pin
Winston,Dang28-Sep-01 23:45
Winston,Dang28-Sep-01 23:45 
GeneralRe: Internet Post Questions Pin
Anders Molin29-Sep-01 1:05
professionalAnders Molin29-Sep-01 1:05 
GeneralCDialog::OnInitDialog () Assertion Error Pin
28-Sep-01 23:13
suss28-Sep-01 23:13 
GeneralRe: CDialog::OnInitDialog () Assertion Error Pin
Michael P Butler29-Sep-01 2:08
Michael P Butler29-Sep-01 2:08 
Question‘CdialogBar’? Pin
Ahmad28-Sep-01 22:30
Ahmad28-Sep-01 22:30 
GeneralA simple Callback Howto, please Pin
yarp28-Sep-01 21:39
yarp28-Sep-01 21:39 
I'm currently writing a file viewer and I would like to automatically unzip .ZIP files to preview their content. My unzipper is a .dll which uses the zlib library. This is a very important part of the application.
Below is the method which reads a .ZIP file in the .dll. I would like to callback my application and give it a pointer to the buffer (an array) containing each unziped file.
As I've never written any callback I don't really know how to implement this, can someone explain me the howto. Thanks in advance.

void C3DZipLoader::Load(char* fileName) {
char* pszFileName;

unzFile hUzf = unzOpen(fileName.ToPStr());
if (hUzf==NULL) return NULL;

pszFileName = new char[MAX_PATH];

if (unzGoToFirstFile(hUzf)==UNZ_OK) {
while (true) {
ZeroMemory(pszFileName, MAX_PATH);
unzGetCurrentFileInfo(hUzf,
NULL,
pszFileName, MAX_PATH,
NULL, 0,
NULL, 0);

if (unzOpenCurrentFile(hUzf)==UNZ_OK) {

// We read the stream form Zlib and get a buffer
// containing the file then we...
<do_the_callback_call_here>

unzCloseCurrentFile(hUzf);
}

if (unzGoToNextFile(hUzf)!=UNZ_OK) break;
}
}
delete [] pszFileName;

return <something>;
}

Yarp
General.bmp to .jpg Pin
Maya C28-Sep-01 20:17
Maya C28-Sep-01 20:17 
GeneralRe: .bmp to .jpg Pin
Christian Graus29-Sep-01 21:02
protectorChristian Graus29-Sep-01 21:02 
GeneralAll or nothing Pin
overflow28-Sep-01 17:49
overflow28-Sep-01 17:49 
GeneralRe: All or nothing Pin
Michael Dunn28-Sep-01 20:40
sitebuilderMichael Dunn28-Sep-01 20:40 
GeneralRe: All or nothing Pin
29-Sep-01 2:27
suss29-Sep-01 2:27 
GeneralRe: All or nothing Pin
overflow3-Oct-01 18:49
overflow3-Oct-01 18:49 
GeneralQuestion about GetControlBar() Pin
overflow28-Sep-01 15:42
overflow28-Sep-01 15:42 
QuestionHow can I show/hide the plus symbol of a tree item? Pin
28-Sep-01 15:34
suss28-Sep-01 15:34 
AnswerRe: How can I show/hide the plus symbol of a tree item? Pin
Michael Dunn28-Sep-01 16:20
sitebuilderMichael Dunn28-Sep-01 16:20 
AnswerRe: How can I show/hide the plus symbol of a tree item? Pin
Paolo Messina29-Sep-01 2:42
professionalPaolo Messina29-Sep-01 2:42 
QuestionHow to send an e-mail using OnFileSendMail Pin
28-Sep-01 15:13
suss28-Sep-01 15:13 
AnswerRe: How to send an e-mail using OnFileSendMail Pin
Shog929-Sep-01 10:02
sitebuilderShog929-Sep-01 10:02 
QuestionHow to let a control support OLE Pin
28-Sep-01 15:04
suss28-Sep-01 15:04 
AnswerRe: How to let a control support OLE Pin
Michael Dunn28-Sep-01 16:22
sitebuilderMichael Dunn28-Sep-01 16:22 
QuestionHow to get hInternet handle from within IE ? Pin
Peter Hayward28-Sep-01 14:45
Peter Hayward28-Sep-01 14:45 
GeneralAVI & BMP Pin
28-Sep-01 12:26
suss28-Sep-01 12:26 
GeneralMSVCRT... Pin
28-Sep-01 11:51
suss28-Sep-01 11:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.