|
Thanks !
But I would like to know if there are a simple MFC function to uncompress a file zip.
|
|
|
|
|
no.
-Jack Mott
jackm@scalablesoftware.com
|
|
|
|
|
I prefer the SawZip ATL Control by Franky Bream. It is easier to use, IMHO, and does not require a license.
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
No, but there is a free library called ZLIB that will help you.
There is also free ActiveX controls around, even one on codeproject called SawZip that will do it. And finally I have a few c++ classes on my web site
that could do help you.
www.codeproject.com/atl/sawzip.asp
www.gzip.org/zlib/
www.viksoe.dk/code (last item in c++ section)
Bjarke Viksoe
My code at: www.viksoe.dk/code
|
|
|
|
|
Thanks
|
|
|
|
|
Hi,
I have a linked_list class, and item class.
class item : public CObject
{
DECLARE_SERIAL(item)
public:
virtual void Serialize(CArchive& ar);
int Angle_D;
CPoint Coord;
int value;
item* next;
}
class linked_list : public CObject
{
DECLARE_SERIAL(linked_list)
public:
virtual void Serialize(CArchive& ar);
void add(int Intensity, CPoint coord, double angle_D);
CPoint m_PCenter;
int HowBig();
void Del ();
linked_list();
virtual ~linked_list();
private:
item* start;
};
i added class item in the header file of my linked_list class.
In my application(MDI) i have a linked_list vairable ( mylist).
so when i want to serialize it, i just:
void CTurboMechDoc::Serialize(CArchive& ar)
{
mylist.Serialize(ar);
}
then in linked_list class:
void linked_list::Serialize(CArchive &ar)
{
item* ptr= start;
CObject ::Serialize(ar);
while(ptr->next != NULL)
{
ptr->Serialize(ar);
ptr=ptr->next;
}
}
and finally in class item:
void item::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
if(ar.IsStoring())
{
ar << Coord;
}
else
ar >> Coord;
}
and i did write IMPLEMENT_SERIAL(classname, CObject,1) for linked_list and item class.
ofcourse the file linked_list.cpp contains the implimentations of both item class and linked)list.
i do have a bitmap displayed as well, but i didn't serialize that.
the problem is that it doesn't work.
can anyone help me?
Ehsan
Ehsan Behboudi
|
|
|
|
|
1) why are you wasting your time on implementing your own linked list? Use std::list or CTypedPtrList
2) i do have a bitmap displayed as well, but i didn't serialize that. the problem is that it doesn't work
What exactly doesn't work? You can't compile this code? It crashes? It makes your monitor explode?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
i can't do anything about the linked_list class. i have 7 weeks to finish my project at work(summer job) and the program is written using my own linked_list.
about the bitmaps, the program works fine, the problem is with serializing it.
1- i have to figure out how to serialize my linked_list correctly.
2- I have to serialize bitmap object as well, which i don't know.
can you help me please?
Thanks
Ehsan Behboudi
|
|
|
|
|
1) Your linked_list::Serialize should write more information - when reading list contents, you have to know when to stop. You can do one of the following:
(a) write number of items before item contents
(b) write boolean flag before each item. true means that there's more data, false means 'no more list items available'
All this stuff comes for free when you use CTypedPtrList - you have only to implement Serialize for the item class.
2) Before serializing convert your bitmaps to dib sections (search for MFC wrapper at CodeProject), then use CArchive::Read/CArchive::Write.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
in the a) and b) part,
you mean:
void linked_list:: Serialize(CArchive& ar)
{
CObject::Serialize(ar);
item* ptr=start;
if(ar.IsStoring())
{
ar>>m_NumberItems;
while(ptr->next != NULL)
{
ar>>ptr->Serialize;
ar>>TRUE;
ptr=ptr->next;
}
}
else
//same thing, but using ar<<
am I on the right track?
Ehsan Behboudi
|
|
|
|
|
Hi,
I have a linked_list class, and item class.
class item : public CObject
{
DECLARE_SERIAL(item)
public:
virtual void Serialize(CArchive& ar);
int Angle_D;
CPoint Coord;
int value;
item* next;
}
class linked_list : public CObject
{
DECLARE_SERIAL(linked_list)
public:
virtual void Serialize(CArchive& ar);
void add(int Intensity, CPoint coord, double angle_D);
CPoint m_PCenter;
int HowBig();
void Del ();
linked_list();
virtual ~linked_list();
private:
item* start;
};
i added class item in the header file of my linked_list class.
In my application(MDI) i have a linked_list vairable ( mylist).
so when i want to serialize it, i just:
void CTurboMechDoc::Serialize(CArchive& ar)
{
mylist.Serialize(ar);
}
then in linked_list class:
void linked_list::Serialize(CArchive &ar)
{
item* ptr= start;
CObject ::Serialize(ar);
while(ptr->next != NULL)
{
ptr->Serialize(ar);
ptr=ptr->next;
}
}
and finally in class item:
void item::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
if(ar.IsStoring())
{
ar << Coord;
}
else
ar >> Coord;
}
and i did write IMPLEMENT_SERIAL(classname, CObject,1) for linked_list and item class.
ofcourse the file linked_list.cpp contains the implimentations of both item class and linked)list.
i do have a bitmap displayed as well, but i didn't serialize that.
the problem is that it doesn't work.
can anyone help me?
Ehsan
Ehsan Behboudi
|
|
|
|
|
Hello guru's,
I've the feeling it's so simple, but I cannot manage it:
We all know the standard menu in a MDI application made by MFC-wizard. But what I need now is having also the menu in each doc/view. I've tried some idea's, but they all failed. I succeeded in putting a toolbar and status bar, but the menu...arrghhhh!!!
Do you have any idea's?
Thanks in advance,
EiSl
|
|
|
|
|
Just create new doc/view classes and add new document template in CYourApp::InitInstance:
BOOL CGeNIeApp::InitInstance()
{
...
AddDocTemplate(new CMultiDocTemplate(
IDR_YOURTYPE,
RUNTIME_CLASS(CYourDoc),
RUNTIME_CLASS(CYourFrame),
RUNTIME_CLASS(CYourView)));
AddDocTemplate(new CMultiDocTemplate(
IDR_ANOTHERTYPE,
RUNTIME_CLASS(CAnotherDoc),
RUNTIME_CLASS(CAnotherFrame),
RUNTIME_CLASS(CAnotherView)));
}
...
}
Just create the menu with IDR_ANOTHERTYPE and it will be displayed automatically when you switch between views.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I need to develop a web service and I don't know where to start. I have found some information about this subject but I'm still confused.
My web site runs under 4 differents servers. People are redirect to one of these server when the load on one of them is too important. A log file is generated with a COM Component called from an asp page on each server. Which means I have 4 log files.
What I need to do is to get all these log files in one file, located on a 5th server.
I have to do that with a C++ Service.
If someone could show me some sample code to use, or tell me what functions I should use, I will be grateful.
Frédérick Thirault
|
|
|
|
|
Do you really need web service for that? You can connect to your 4 webservers using LAN, right?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for your reply.
I know there are other (and better) way to do that, but I was asked to use a service.
Frederick Thirault
|
|
|
|
|
> I was asked to use a service.
Looks like they want you to program Win32 service - this is totally different from web service. Did they ask for "Web Service" explicitly?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Well, they asked for C++ Service.
Frederick Thirault
|
|
|
|
|
Check Platform SDK/Base Services/DLLs,Processes and Threads/Services in MSDN. There are also a samples: "Service" and "RPCSvc". I remember using them as starting point when I had to code a service.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for your help. I will try that.
Frederick Thirault
|
|
|
|
|
Hi,
I am using a HTTP SendRequest to POST some data to an ASP. The ASP then replies with some data to me, which I then read using the HTTP Read method. The code snippet below shows what I am doing
bResult = m_pHttpFile->SendRequest(<....stuff in here....>);
do{
uiRead = m_pHttpFile->Read( (void*)buffer, 500 );
My question is, if the ASP has a lot of process to do before responding, will my Read function be called before the ASP has responded, and so nothing will be returned in the buffer. Or does it block until the ASP responds?
Thanks in advance
Neil
|
|
|
|
|
I need to catch clicks in Netscaoe Navigator the way GetRight, Go!Zilla, FlashGet and other download managers do. I cannot find any information on the net about that. Please HELP ME!
|
|
|
|
|
Yes there is smart people. They are all using IE.
|
|
|
|
|
Do you call that smart? By developing only for IE your are limited to Windows (OK, Mac too). What about UNIX? Never heard of it?
|
|
|
|
|
You have to hook to the apps window and intercept mouse clicks that way. I'm afraid that's as much help as I can give you on the fly.
To the anonymous people responding so far, this is NOT the proper place for a browser flame fest. Take it somewhere else.
|
|
|
|