|
No idea, I didn't knew viewports . It will be probably easier for the drawing part but I suppose you still have to manage the scrollbars.
|
|
|
|
|
Cedric,
you mean,
first draw everything on the the view in OnDraw.
then create compatible dc. (memorydc)
then build a bitmap from whatever on the view content or on Doc.
then use stretchblt to inlarge or compress the image.
Am i right?
thanks
Leya
|
|
|
|
|
No, first draw everything in the memoryDC, then stretch it to the view DC (using stretchBlt).
But take a look at Rage's solution, it will probably be easier for the drawing part (I cannot help because I never used viewports before).
|
|
|
|
|
No, first draw everything in the memoryDC, then stretch it to the view DC (using stretchBlt).
But take a look at Rage's solution, it will probably be easier for the drawing part (I cannot help because I never used viewports before).
Cedric,
then provide me the code of your solution .. memory dc, bitmap, stretchblt etc. for my purpose.
thanks
Leya
|
|
|
|
|
It was just a suggestion, I don't have any source code. You'll have to look a little bit yourself.
Did you check the solution from Rage also ?
|
|
|
|
|
Hi,
Please help me on the folowing:-
I have list view which misbehaves when i try to drag the column guides between the "column" headers to size the columns (especially the last column). By "misbehaves" I mean the list view gets rectangular patches on it (of the same colour as the main window. What am i doing wrong or which message (guess it is a notification message) am i not handling?
Thanks in advance.
|
|
|
|
|
I believe that you have taken the report view of the list control and on dragging the header control of the list the window behind the list control is showing up. If this is the case you can try as follows
Use RedrawWindow() in HDN_ITEMCHANGED
Does this solve your problem?
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
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
|
|
|
|