|
first you pay Unisys $3000 for using their LZW compression scheme (which GIF is based on), then you search this site to find an implementation.
“If it turns out that I’m actually the one who did it, then looking for the real killers would be a big old waste of time.”
-- OJ Simpson
|
|
|
|
|
I'm building a little utility to help with budgeting. I have a dialog in which one will enter transaction information, but the one I have is damn ugly.
How would you reorganize to make this dialog[^] prettier?
|
|
|
|
|
Make the list of options a drop down and then underneath it dynamically show only the options that relate to the selection - use ShowWindow to show/hide different things as needed.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
Make the list of options a drop down and then underneath it dynamically show only the options that relate to the selection - use ShowWindow to show/hide different things as needed.
I was wondering about this when I first threw the dialog together. It's a bit more work, but it will be much prettier. Thanks.
|
|
|
|
|
Be sure to provide history entries in the dropdown stuff, so users don't have to enter the data again and again, just select it instead.
How low can you go ? (MS rant)
|
|
|
|
|
If your working with Calendars include some MS stuff: CDateTimeCtrl.
|
|
|
|
|
I'll second that.
How low can you go ? (MS rant)
|
|
|
|
|
Hi!
I recently made a invisible static control by overriding CMyStatic::OnPaint() and doing nothing there.
Ouch. This does totally screw up the update of my parent window! When hiding the parent window (a dialog) through another window and get my dialog back on top of z-order, then all controls will be painted until my invisible control. All controls after my invisible control will not be repainted, I need to move the window to get them repainted.
That's pretty strange. I can't call the base class member CStatic::OnPaint() , because then it wouldn't be invisible anymore. I tried a bit and added this as only line in my OnPaint() handler: CPaintDC dc(this);
Now window update works as usually. Can somebody explain what's happening? I really like to understand.
Thanks
|
|
|
|
|
u need to know a little win32 story.
if u override WM_PAINT message, u must have min 2 lines to tell OS related info.
the function CPaintDC dc(this) has these 2 lines inside.
includeh10
|
|
|
|
|
If you Invalidate() a window it will try to redraw itself at the next opportunity.
Because your 'invisible' static control is hidden for a while it is automatically Invalidate()ed. So when it comes to draw it again, it still thinks it is Invalidate()ed. If you Validate() your static control rather than creating a DC from the window, it will also work.
HOWEVER, why did you not just create the window without WS_VISIBLE set?
|
|
|
|
|
ah thx for the good explanation, I remember from my Win32 experience.
Mythago wrote:
HOWEVER, why did you not just create the window without WS_VISIBLE set?
I remake a splitter control, the splitter itself _can_ be "invisible". If I set the WS_VISIBLE style I can't get mouse messages and stuff anymore.
|
|
|
|
|
btw, one more question: Is there a easier MFC solution to validate a client rect than calling CPaintDC dc(this); ? Or does it already provide the mininum solution?
|
|
|
|
|
Yes you can use ValidateRect(NULL) surprisingly...;)
|
|
|
|
|
Mythago wrote:
Yes you can use ValidateRect(NULL) surprisingly...
my hero
M
|
|
|
|
|
hi
i am writng my own printsetup dailog box in mfc. i selected all properties and when i give print the printer is not signaling . i am providing my code below please correct where the mistake. if my code is wrong please give guidence how can i send data to printer. my intention is not displaying windows printdialog box. what are the functionality we did on printdialog we can carry on our dialogbox. It's urgent. please help
thank you
void CMyPrintSetup::OnButPrint()
{
// TODO: Add your control notification handler code here
unsigned char temp[32];
DEVMODE *devout,*devin;
DWORD dwNeeded,dwRet;
DEVMODE* pDevMode;
/**********************getting printer handle**********************/
if(!OpenPrinter(printername,&hprinter,NULL)) //for getting handle for printer
MessageBox("Printer can't be opened","emazines",MB_OK);
/*******get the size of the buffer for specified printer****************/
dwNeeded=DocumentProperties(NULL,hprinter,printername,NULL,NULL,0);
pDevMode=(DEVMODE*)malloc(dwNeeded);
/**get the default DEVMODE for the printer and modify if your needs*********/
dwRet=DocumentProperties
(NULL,hprinter,printername,pDevMode,NULL,DM_OUT_BUFFER);
if (dwRet != IDOK)
{
/* If failure, cleanup and return failure. */
free(pDevMode);
ClosePrinter(hprinter);
}
pDevMode->dmOrientation=m_orientation;
pDevMode->dmCopies=m_copies;
/***********set the new values to printer****************/
dwRet=DocumentProperties
(NULL,hprinter,printername,pDevMode,pDevMode,DM_IN_BUFFER|DM_OUT_BUFFER);
if(dwRet!=IDOK)
{
MessageBox("properties initialization error","emazines",MB_OK);
}
/*********************** code for printing *************************/
CDC dc; //creating a DC object
AfxMessageBox(printername);
HDC hdc=CreateDC(NULL,printername,NULL,NULL);
dc.Attach(hdc);
dc.Rectangle(100,100,200,200);
dc.TextOut(50,50,"Emazines Software Private Limited");
dc.DeleteDC();
/*********************End of the code for printing*********************/
CDialog::OnOK();//for closing window
}
|
|
|
|
|
Use:
dc.Startpage();
//print stuff
dc.EndPage();
|
|
|
|
|
CDC dc; //creating a DC object
AfxMessageBox(printername);
HDC hdc=CreateDC(NULL,printername,NULL,NULL);
dc.Attach(hdc);
dc.StartDoc();
dc.StartPage();
dc.Rectangle(100,100,200,200);
dc.TextOut(50,50,"Emazines Software Private Limited");
dc.EndPage();
dc.EndDoc();
dc.DeleteDC();
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
create several wizard property-pages on a property-sheet which is child of a dialog-box.
problem comes out:
if press a button of any property-page to display a message box or dialog box, whole app process is at dead-lock.
if the button does only functionalities without displaying messge-box or dialog-box, it is OK.
did u have the problem also and how do u fix it?
thx.
includeh10
|
|
|
|
|
Hi,
I have created an OCX using VC++ 6.0. This OCX is applying in my Borland Delphi 5.0's application. However, I was encountered a problem of showing this OCX component icon in Delphi which I imported from VC++ ActiveX Control. I was coded the LoadBitmap in Create function as follows:
BOOL CTesting::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
CBitmap bmp;
bmp.LoadBitmap(IDB_OCXBMP);
return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
When I drag this component from my Delphi on the Form, it will not show what was my picture created in VC++. It shows empty instead!!!
Any comments or solutions, please reply me as soon as possible.
Cheers. Thanks.
Regards,
Miao Miao
|
|
|
|
|
I've notice that evertime I delete a function (in a dialog based app) that I loose the CFileNameDlg Class from the Class View tab. I don't get it back again until I use class wizard to add a new function. Anyone got anythoughts on this (I've had this happen to me to often).
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
|
|
|
|
|
You need to delete the class view information to make the compiler rebuild it. I forget the extension tho.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Okay.. I'll look into that, two other questions ...
did you get the email I sent? didn't want to think I forgot about that
also... off the top of your head, how do I either stop the IDOK command in a dialog (I need to confimn that the user actually wanted to click it) or how do I send the IDOK message (keep getting "protected errors"... any thoughts?
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
|
|
|
|
|
Mel Feik wrote:
did you get the email I sent? didn't want to think I forgot about that
Yes, I got it, no worries.
I dunno how to send IDOK, but I'm not sure what you mean by stop it - how would you get it unless someone clicked it ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Delete the *.ncb file.
The VC 6.0 had this irritating bug...
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
last reply is a real reply, others are noising.
i am wandering why the guy is always making noising everywhere? feel lonely? show off with poor knowledge?
the guy replied on my poster with:
HAHAHHAHAHHAHAHHAHHAHAHHA.
u go to hospital now!
includeh10
|
|
|
|
|