|
Hi Anshuman,
Cool,
Thanks a bunch. It works like milk and water.
Neeraj.
|
|
|
|
|
Hi,
I have to create a small application in vc++ in which if I type the url of a zip file, the application lists the contents of the the zip file. Then I select one of them and only that file gets downloaded.
Is such a thing possible? i.e. an application listing the contents of a zip file on the net?
If it is so, please can you give me a general idea how to do this.
Thanks,
Tara
Fortitudine Vinsinues!
|
|
|
|
|
TheinstruTara wrote: I have to create a small application in vc++ in which if I type the url of a zip file, the application lists the contents of the the zip file. Then I select one of them and only that file gets downloaded.
AFAIK you can silently download the zip file to a temp folder, then show the contents to the user and then do the extraction stuff.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Please have a look,
char mychar[4] = {65, 97, 62, 0};
sBuf.Format("%s",mychar[0]);
There is no error after compiling the program, but there is a bug when run the program.
Thanks,
Joy Anne
|
|
|
|
|
Try this:
char mychar[4] = {65, 97, 62, 0};
sBuf.Format("%s", mychar);
Joy Anne wrote: no error after compiling the program, but there is a bug when run the program
That's the problem with printf and its friends: it's not type safe so heaps of errors compile fine but fail at runtime. In an ideal world any mistake you make results in a compile time error rather then a runtime error: this is what it means for something to be type safe. Using stringstream s moves closer to this ideal.
Steve
-- modified at 4:14 Friday 5th May, 2006
PS: sBuf = mychar; will probably do the trick.
|
|
|
|
|
|
sBuf is not a c string as it has the member function Format - It's probably a CString . As such it has an assignment operator which takes a c string. The code I submitted should work and there is no need for strcpy .
Steve
|
|
|
|
|
|
And what are you trying to do ? The %s in the Format functions specifies that the function expect a string, and you supply it with a char. Change it to:
sBuf.Format("%s",mychar);
|
|
|
|
|
Joy Anne wrote: char mychar[4] = {65, 97, 62, 0};
sBuf.Format("%s",mychar[0]);
sBuf.Format("%c, %c, %c, %c", mychar[0], mychar[1], mychar[2], mychar[3]);<br />
sBuf.Format("%d, %d, %d, %d", mychar[0], mychar[1], mychar[2], mychar[3]);<br />
sBuf.Format("0x%X, 0x%X, 0x%X, 0x%X", mychar[0], mychar[1], mychar[2], mychar[3]);
Maxwell Chen
|
|
|
|
|
|
|
WhiteSky wrote: for(int i=0;i<3;i++)
sBuf.Format("%c",mychar[i]);
AFAIK, this will overwrite sBuf three times, and is equivalent to
sBuf.Format("%c",mychar[2]);
~RaGE();
|
|
|
|
|
its only example for %c and %s.%c isnt problem
(sBuf.Format("%s",mychar[0]);)
<br />
Maxwell Chen<br />
sBuf.Format("%c, %c, %c, %c", mychar[0], mychar[1], mychar[2], mychar[3]);<br />
|
|
|
|
|
I'd like to create dialog box with completed fields...
write smth like this
class CDlg:public CDialog{
public:
CDlg(UINT nRes, CWnd *pParent,int nIndx=-1);
DECLARE_MESSAGE_MAP()
afx_msg void OnOk();
};
CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) {
if(nIndx!=-1){
CPerson* pers=(CPerson*)ob_arr[nIndx];
AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK
SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156
}
}
|
|
|
|
|
NoName II wrote: CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) {
if(nIndx!=-1){
CPerson* pers=(CPerson*)ob_arr[nIndx];
AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK
SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156
}
Do the initialization part in OnInitDialog . Do not do this in the construtor.
Nibu thomas
Software Developer
CPP Faqs by Michael dunn
|
|
|
|
|
how can I send nIndx in OnInitDialog?
|
|
|
|
|
Use an Init function for these kind of initialization purposes.
NoName II wrote: how can I send nIndx in OnInitDialog?
Store the nIndx as a member variable or store the person object as a member variable of the dialog class.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
|
Hi,
I have these coding in my vc++ project.In this,bitmap m_pdib is converted in to jpeg and this jpeg image is shown in the videoplayer.
m_pdib.GetJpgData(1,true);
m_pdib.DispTODC(1, true);
I want to store this converted jpeg image into a file.How to create a file and store this jpeg image
sunita ramesh
-- modified at 3:09 Friday 5th May, 2006
|
|
|
|
|
|
I have a newly desinged cam file in which image files are stored in the form of bitmap.This bitmap is retrived & converted in to jpeg image and then it is displayed in the video player.(it is an Active control ).
Everytime to play the video,i call this function,Playwave(int picno).
for displaying this image,i call m_pdib.GetJpegData(1,true) and m_pdib.DispTODC(1,true).
I want to store this jpeg image in a folder.
How to do that.
sunita
|
|
|
|
|
If you could put the image on a DC or on a CBitmap object you can solve your problem using the class CImage . It has the Save function that automatically convert the image in many file format (jpg gif png bmp).
Hope this helps.
|
|
|
|
|
thanks for ur reply.
Do i need to add class cImage.
How to do this..
Can u please explain me in detail.
sunita ramesh
|
|
|
|
|
DEFINE_GUID(ImageFormatJPEG, 0xb96b3cae,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
CImage m_Image;
m_Image.Attach(hbitmap handle);
m_Image.Save(yourfile,ImageFormatJPEG);
m_Image.Detach();
|
|
|
|
|