|
Hi,
I don't know if this or a similar question is already asked, the search function only gave a .jar-article, so I try to ask on my own.
In a project I have to compress and copy files to a remote computer which should work without any user interaction, and so I'm now asking for a way to do that.
The whole program should run under Windows XP, which can read ZIPs, but are there system libraries to generate ZIPs, or do I need special programs / libraries to zip them? Can I zip files under C++ or do I have to call standard programs nevertheless?
And regarding the transfer, is there an easy way to initiate a non-interactive ftp-transfer of the zip-file after zipping has finished? Can I use the ftp-Program included in windows giving special command line options or do I need a special ftp-library to transfer that file to the remote server?
I'm using MS Visual C++ 6.0 under Windows XP (SP2 installed), if this info is important...
Thanks in advance for your help
Martin Dietz
|
|
|
|
|
Hi,
I recommend you to look at this: 7-zip
It is 7-zip's LZMA SDK, and I think it should fit your needs.
Best regards
|
|
|
|
|
Hello Galatei,
The problem with 7-zipped files will be that the partners in Jena need a special program to uncompress the files we are sending to them. This was the main reason why I asked about the ZIP-format as this can be uncompressed by windows alone. I can test if I can make use of the 7-zip libraries and ask Jena if they are willing to install an extra decompression program, but in the meantime I hope someone can help me with the ZIP compression...
Thanks anyway
Martin Dietz
|
|
|
|
|
Have a look at InfoZip. AFAIK, both Winzip and java.util.zip is based on InfoZip
http://www.info-zip.org/[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
m.dietz wrote: In a project I have to compress and copy files to a remote computer which should work without any user interaction, and so I'm now asking for a way to do that.
I recomend to use zLib.
It is open source, thoroghly tested and known to work very well with almost every Zip-Tool
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
|
I use the following code to draw an icon on the Window.
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP), IMAGE_ICON, m_nButtonWidth, m_nButtonHeight , LR_DEFAULTCOLOR);
::DrawIconEx(hDC, 2, 2, hIcon, m_nButtonWidth, m_nButtonHeight, 0, NULL, DI_NORMAL);
This draws the icon on the Window. But my problem is that my window has a gradient background and my icon has a white background so when I draw the icon, the square shape of the icon with the white background is visible. I want to make the white portion of the icon transparent so that my Window background is visible. How do I do it?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
|
|
|
|
|
if you run this code what happens?
<br />
HICON hIcon = LoadIcon(AfxGetApp()->m_hInstance,(LPCTSTR)IDR_MAINFRAME);<br />
::DrawIconEx(GetDC()->m_hDC, 2, 2, hIcon, 32, 32, 0, NULL, DI_NORMAL);<br />
<br />
|
|
|
|
|
No changes. The problem still exists.
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
|
|
|
|
|
oh yes ,I think you cant show icon on windows yes I see your problem but change background of icon to default color
|
|
|
|
|
Hi,
To simply draw icon with transparent background, you should apply AND mask to icon, where 1's specify transparency. For example: in VisualStudio editor, there's a color in color table, which looks like monitor with greeny background. By using this color, you specify which pixel are supposed to be transparent.
Finally, in DrawIconEx function you should specify DI_NORMAL effect mask to draw icon image as well as its mask.
Hope that helps,
Regards
|
|
|
|
|
the problem is that i have a thread function
<br />
UINT threadfun(LPVOID param)<br />
{<br />
CList list = (CList)param;<br />
}<br />
and i want to pass param to this function using AfxBeginThread
<br />
AfxBeginThread(threadfun,(WPARAM)m_List); <br />
where "m_List" is from a type defined variable
<br />
typedef CTypedPtrList<CPtrList , tagPLAYLISTENTRY*> CList;<br />
the compiler generate this error:
1- 'CList' : undeclared identifier
2- syntax error : missing ';' before identifier 'list'
3- 'list' : undeclared identifier
i know he can not see this type "CList" inside the function
but what is the solution of this , and how can i make it work
thnx alot 4 ur time and concern.
|
|
|
|
|
Is this file included...
#include <afxtempl.h>
|
|
|
|
|
yes it is included,
but as u know the thread function is not a part of the class so it can't see the headers so it don't know what is CList exactly is
problem right ??
i also tried to make the variable static and access it inside the thread function but it come up with an unresolved external error
F Y I, this time was working perfeclty in a member function of the class
but with the thread function, i don't know the problem
|
|
|
|
|
Hi,
yes it is included,
but as u know the thread function is not a part of the class so it can't see the headers so it don't know what is CList exactly is
Make sure that <afxtempl.h> can be parsed by precompiler when header with your thread function is processed. You can even add #include <afxtempl.h> statement directly before your thread function declaration,
example:
#include <afxtempl.h>
void __stdcall YourThreadFunction(LPVOID param)
{
CList list = (CList)param;
}
Did you know that your thread function can also be a part of your class?
#include <afxtempl.h>
class tester {
private:
CList m_list;
public:
void TestMyThread() {
CreateThread(...,...,YourThreadFunction,this,...,...)
};
static void YourThreadFunction(LPVOID param)
{
tester *p = (tester*)param;
CList list1 = p->m_list;
};
};
Regards
|
|
|
|
|
F Y I, typedef was working perfeclty in a member function of the class
but with the thread function, i don't know the problem
so it is not a problem with "typedef CTypedPtrList CList;"
because it was working before
|
|
|
|
|
singersinger wrote: typedef CTypedPtrList<CPtrList , tagPLAYLISTENTRY*> CList;
CList is the name of an existing class. Choose another name.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
singersinger wrote: UINT threadfun(LPVOID param)
{
CList list = (CList)param;
}
There are a few problems here.
First, CList is an existing type name when you use MFC. Use a different name for that: typedef CTypedPtrList CMyList; .
Second, CMyList will be a type, not a pointer. Use the reference operator to cast it to get a pointer to it: AfxBeginThread(threadfun, (WPARAM)&m_List); and the corresponding: UINT threadfun(LPVOID wParam) { CMyList* list = (CMyList*)wParam; ...}
Finally, if your threadfun is declared in another file, make sure it has the afxtempl.h header included.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
maybe i am posting the wrong words,
so to keep it simple
i have a function that causes the application to wait till it finishes it's work, so normally you would make it a thread function and call it using AfxBeginThread to let the application continue working after calling it
am i right in this ??
if i am right, this function uses some member variables that are declared in the class but the thread function can't see the member variables of the class
am i right ??
if i am, i want to pass this member variable to the thread function so that it could understand it and work with it "while this varibale not a rgular data type, it is a typedef from a combination of types"
can anybody help me with this
for any other information do not hesitate to reply
thnx alot 4 ur time and concern.
|
|
|
|
|
hi!
how do i change color of open file dialog or browse folder dialog?
(color of border, title and dialog)
to display open file dialog, i used CFileDialog::DoModal()
to display browse folder dialog, i used SHBrowseForFolder()
Zo.Naderi-Iran
|
|
|
|
|
You need to derived class of CFileDialog and use I think useWM_PAINT
|
|
|
|
|
Hopefully this is more specific, but what are boolean statments? If I'm posting in the wrong forum for C++ I'm sorry.
I'm a true failure.
|
|
|
|
|
(wrong_forum) == false
(5+1 > 0+2) == true
thursday.isaweekend() == false
(dog.has4legs() || hamster.canfly()) == true
wikipedia - boolean logic[^]
|
|
|
|
|
i'm not sure at all what you mean by "boolean statments", but if i understand it like you, it represents all the C++ statements that can be evaluated to a boolean.
if (a == 3) { ... }
for (int i = 0, i < 5; i++) { ... }
while(myIterator != myList.end()) {... }
and so on...
|
|
|
|
|
A boolean statment is true or false(1 or 0)key is on or key is off.
Anyway we have fazzy logic that it says we have many states between 1 and 0
|
|
|
|