Develop and Download Open Source Software

  • This project does not use forum

Browse Subversion Repository

Contents of /filemv/zip.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7 - (show annotations) (download)
Wed Jan 2 22:06:47 2008 UTC (16 years, 3 months ago) by tabasa
File MIME type: text/plain
File size: 1730 byte(s)


1
2 #include "defextern.h"
3
4 #ifndef STRICT
5 #define STRICT
6 #endif
7 #include <stdio.h>
8 #include <windows.h>
9 #include "win.h"
10 #include "mes.h"
11 #include "status.h"
12
13 #define CommandLen 1000
14 #define DllLen 100
15
16 typedef (WINAPI *zzz)(const HWND,LPCSTR ,LPSTR ,const DWORD);
17 zzz fn;
18 HINSTANCE hLib ;//= LoadLibrary( "zip32j.DLL");
19
20 BOOL zipflag;
21
22
23 void FreeDll()
24 {
25 FreeLibrary(hLib);
26 setstatus("free dll");
27 }
28
29 BOOL dllLoad(char *name, char *fncname)
30 {
31 // static char currentdll[DllLen]="";
32 zipflag =FALSE;
33 hLib = LoadLibrary( name);
34 //if (hLib) strcpy(currentdll, name);
35 if (hLib) {
36 fn =(zzz)GetProcAddress(hLib, fncname);
37 if(fn == NULL) {
38 setstatus(fncname ,"load error");
39 }
40 else {
41 zipflag =TRUE;
42 setstatus("loaded",fncname);
43 return TRUE;
44 }
45 }
46
47 FreeDll();
48 return FALSE;
49 }
50
51
52
53 char buf[CommandLen];
54 char ans[CommandLen];
55
56 void DoZip(HWND hWnd, char *zip, char *from)
57 {
58 if(!zipflag)
59 {
60 setstatus("no-dll");
61 return;
62 }
63 wsprintf(buf, "-r \"%s.zip\" \"%s\"", zip, from);
64 setstatus(buf);
65 (*fn)(hWnd, buf, ans, CommandLen );
66 LogWin(ans);
67 }
68
69 void DoLzh(HWND hWnd, char *zip, char *from, char *file)
70 {
71 if(!zipflag)
72 {
73 setstatus("no-dll");
74 return;
75 }
76 //a ***.lzh -x1r2a2 path file
77 //�f�B���N�g�����T�u�f�B���N�g�����������������i�[
78 wsprintf(buf, "a \"%s.lzh\" -x1r2a2 \"%s\\%s\"", zip, from, file);
79 setstatus(buf);
80 (*fn)(hWnd, buf, ans, CommandLen );
81 LogWin(ans);
82 }
83
84 // e c:\arc\archive.lzh -x1a1 -c c:\ *.*
85 // �f�B���N�g���\�������\�z�������� c:\ �����W�J�B
86 //
87
88 void DoUnLzh(HWND hWnd, char *to, char *from)
89 {
90 if(!zipflag)
91 {
92 setstatus("no-dll");
93 return;
94 }
95 wsprintf(buf, "e \"%s\" -x1a1 -c \"%s\\\" *.*", from, to);
96 setstatus(buf);
97 (*fn)(hWnd, buf, ans, CommandLen );
98 LogWin(ans);
99 }

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision
svn:mime-type text/plain

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26