Cheers Mark, that was very helpful. Thanks for your time
MyFathersSon
Posts
-
What am I doing wrong? -
cin causes infinite loop in my programUnless your input is an array of strings then use cin>>tempstring otherwise use cin.getline(tempstring, MAXBUFFERSIZE, '\n'); this function takes 3 parameters, and the last one is the delimiter i.e. when to signal the function to return.
-
What am I doing wrong?Cheers Mark, Unfortunately I feel that the code might be causing problems. I code the control as follows: void CEditableCircleCtrl::DrawControl()//called by OnDraw method { CDC *pDC = GetDC(); if(pDC == NULL) { return; } CRect circlerect; //draw the round rectangle circlerect.top = 0; circlerect.left = 0; circlerect.bottom = 40; circlerect.right = 40; pDC->Ellipse(circlerect); } ... int CEditableCircleCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (COleControl::OnCreate(lpCreateStruct) == -1) return -1; //create the edit box editrect.top = 13; editrect.left = 6; editrect.bottom = 28; editrect.right = 36; editctrl.Create(WS_VISIBLE|WS_CHILD|ES_CENTER,editrect, this, 0); return 0; } How can I get hold of the text? Am I doing something wrong? WM_CHAR doesn't capture any text entered in the control. Where would I place any of your suggestions?
-
What am I doing wrong?I've used MFC to create a custom control: An Ellipse with an edit control inside, so it appears as a circular edit box. Problem is, I can't get the data out from the edit control whenever I type anything in. I'm using the windows message handler WM_CHAR, but I fear that that message handler is only interested in the rectangle and not the edit control. How do I get access to the edit control's data? Thanks
-
How to cancel printing using commondialog ctrlHi All I'd like to know how to cancel a print job (using VB) if the user presses the CANCEL button when the print dialog shows. Any ideas? thanks in advance
-
While loop...assuming you've a data control data1.refresh data1.recordsource = "select * from yourdb" data1.recordset.movefirst do while not data1.recordset.eof strFirstField = data1.recordset.fields("Field1").value strSecondField = data1.recordset.fields("Field2").value data1.recordset.movenext loop
-
how to enable the textbox to be able to save text??mystring = text1.text //store what they've entered in a string combo1.additem mystring //store what's in the textbox in a combo next time user uses the system they drop down the combo to find their item and don't enter text in the text box
-
Printing problems in VBThanks for your advice OldWarhorse. Not much on google.
-
Printing problems in VBI did but the results are the same. Thanks for your advice.
-
Detection of device on insertion/removal from systemI might be wrong but I think that the only way to do this is by writing a driver. Devices being connected/disconnected cause an interrupt at KERNEL level, and those addresses are out of bounds in user mode.
-
Printing problems in VBThanks for your suggestion. I placed a Printing.EndDoc statement as follows: For i = 0 To List2.ListCount - 1 Step 1 Printer.Print List2.List(i) Next i Printer.EndDoc ' added and this printed both text and graphic, but on separate pages. I'm not sure how to carry out your second suggestion. MyFathersSon
-
Printing problems in VBHi all, I'm trying to print out text and graphics on the same page using VB's Printer.Print For i = 0 To List2.ListCount - 1 Step 1 Printer.Print List2.List(i) Next i If Clipboard.GetFormat(vbCFBitmap) Then Printer.PaintPicture Clipboard.GetData(), 0, 0 Printer.EndDoc End If The graphics gets printed out, but the text from the list box doesn't. Any ideas on how I can resolve this? Thanks MyFathersSon