|
i got it fixed thanks a lot
JOAQUIN
you are the one man
|
|
|
|
|
I have a need to add controls to the Print Setup dialog.
I did this via what I thought was the standard means:
- Copied the Print Setup dialog (PRINTDLGORD) to my RC file
- Created a Class based on this new dialog
- Used this new class (CMyPrintDialog) in place of CPrintDialog
- Added controls to the new dialog
- Used the following code:
CMyPrintDialog PrintSetup( TRUE,
PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS | PD_NONETWORKBUTTON |
PD_HIDEPRINTTOFILE | PD_NOSELECTION | PD_ENABLESETUPTEMPLATE );
PrintSetup.m_pd.hInstance = AfxGetInstanceHandle();
PrintSetup.m_pd.lpSetupTemplateName = MAKEINTRESOURCE( IDD_MY_PRINT_SETUP );
PrintSetup.DoModal();
All seems to work fine except entering text into a Edit Box on the new dialog appears to make the dialog repaint on each character. This is seem as:
- The Protrait/Landscape icon repaints each time a char is typed
- The cursor on the dialog repositions at the begining of the edit box on each char
- Takes a long time for each character and the hourglass appears.
I suspect I have left out a step.
Any suggestions?
AW
|
|
|
|
|
Two questions:
What ID did you use for the edit box; make sure you're not re-using the ID of a control used by the system.
Do you have an EN_UPDATE or EN_CHANGE handler for the control? If so, what actions are you performing in it?
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
Hey,
I would like to get started learning about DLLs. I currently only work in MFC and C++ using VC++ 6. Does anyone know of any good tutorials for using DLLs with MFC apps.
.NET or not .NET? MFC is the question......
|
|
|
|
|
Have a look at the MSDN samples DLLHUSK and DLLTRACE. They are fairly good starting points.
My jokes page
|
|
|
|
|
I wonder how it works. Let's say that I have a header file named MyHeader.h
then I want to use the #ifndef stuff... but how?
Like this(?):
#ifndef MYHEADER_H
...
#endif
if yes:
how does the compiler know that MYHEADER_H is my header... hmm... hope you understand..
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
#ifndef MYHEADER_H
#define MYHEADER_H
#endif This prevents a header's contents from being #included more than once.
--Mike--
"Everyone has figured out what 'service pack' really means, so they had to go and change the language. Perhaps this is what Bill was talking about in the 'security is top priority' letter."
-- Daniel Ferguson, 1/31/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
BUT OF COURSE!!
Thanks buddy(ies)!!!
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
I want to scale a DIB into a window DC, and to do that I am using StretchDIBits - everything works fine. Because StretchDBits directly in the window DC is a very slow operation , I am trying to speed up the operation by stretching first into a mem DC and then draw the bitmap into the window DC using BitBlt. My problem is that StretchDIBits into the mem DC seems to have no result - nothing appears into the window DC. If I stretch directly everything works fine.
//
HBITMAP hBmp = ::CreateBitmap( /* ... */);
BITMAPINFO bmpInfo
// build bmp info
//original code
::StrectchDibits( hDC, /* ... */); //everything is OK
//updated code
HDC hMemDC = ::CreateCompatibleDC( hDC);
::StretchDBIits( hMemDc, /* ... */);
::BitBlt( hDC, /* ... */, hMemDC, /* ... /-*/); //!?
any help will be welcome ! Thanks .
|
|
|
|
|
solon wrote:
//updated code
HDC hMemDC = ::CreateCompatibleDC( hDC);
After you create the MemDC, you will have a monchromatic bitmap with 1 pixel selected into that memdc. What you need to do now is to create a bitmap that has the proper height, width and color depth to match the Window DC that you want to paint to.
In order to do this you should use some code similar to this:
<br />
RECT rClient;<br />
::GetClientRect(hWnd, &rClient);<br />
HBITMAP hBmp = ::CreateCompatibleBitmap(hDC, rClient.right, rClient.bottom);<br />
<br />
(HBITMAP)::SelectObject(hMemDC, hBmp);<br />
Now you can continue with the code that you have previously written.
solon wrote:
::StretchDBIits( hMemDc, /* ... */);
::BitBlt( hDC, /* ... */, hMemDC, /* ... /-*/); //!?
Finally in order to cleanup, you must do things in this order.
<br />
::DeleteDC(hMemDC);<br />
::DeleteObject(hBmp);<br />
|
|
|
|
|
If I'm adding a static text control to my dialog box, how do I make the text come on more than one line? It seems to just write the text in one long line all the way across the dialog box. I realize that I could just use two static text controls and align them above and below one another, but I don't want to do this because then it gets treated as two seperate texts when doing the Tab Order.
|
|
|
|
|
Change the style to multiline and resize the static control.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Hi.
I was wondering if there is an easy way to delete an entire directory and EVERYTHING under it. The functions that are available now seems to need the directory to be empty first.
THanks.
|
|
|
|
|
I think this is going to work!!
Fill the SHFILEOPSTRUCT struct like this I think (not tested):
SHFILEOPSTRUCT shf;
memset(&shf,0,sizeof(shf)); // Reset the structure before using it
shf.hwnd = hWnd; // The windowe that will show status (e.g a progress bar that shows how much is left of the file operation)
shf.wFunk = FO_DELETE;
shf.pFrom = "C:\\WINDOWS"; // Delete this structure
shf.fFlags = FOF_SIMPLEPROGRESS; // Display a progress bar
// Finaly:
SHFileOperation(shf);
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
That will not work because pFrom needs two null characters at the end.
shf.pFrom = _T("C:\\windows\0");
--Mike--
"Everyone has figured out what 'service pack' really means, so they had to go and change the language. Perhaps this is what Bill was talking about in the 'security is top priority' letter."
-- Daniel Ferguson, 1/31/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
how about:
void foo( char * boo )
// boo works as an in/out parameter
|
|
|
|
|
char* SomeFunction() ;
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
Hi,
I would like that in my property page when the user presses over the last tab order control, it jumps to the first tab order contol, not to the tab header, is that possible ?
Thanks, Bye !
Braulio
|
|
|
|
|
I'm not getting what you mean to do? Is it some sort of "circular" property sheet what you're trying to achieve?
PS: Si quieres nos entendemos en español, mucho más fácil , aunque no sé si otra gente aquí se lo tomará a mal.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hola !
HE he, si creo que si nos ponemos a hablar en Español igual Nish o otro se cabrean , así que aquí va mi inglés potajero...
Yes, the thing is that I have a system made to update data automatically when you press tab or whatever
http://www.codeproject.com/dialog/killfocus.asp
It saved me a lot of boring work, ... but... If I use that on a Non modal Property Page I got a problem... when you press tab on the last control the focus goes to the parent and I cannot distinguish very well the event that happened, the good thing would be that it goes again to the first tab order control again.
Is there some possibility to do that ?
Gracias Joaquin !
Braulio
|
|
|
|
|
I must confess I've not completely caught your point, so I will guess anyway
So your problem is that your property page loses control when the user press on the tab (control is taken over by the property sheet) and you'd like the property page to have an opportunity to retain control? If so, today some folks have had a similar discussion here, and seems like WM_NCACTIVATE is the message you should handle on your propery pages to determine when control goes elsewhere.
Hope it helps. Don't mind asking again if this is not what you were after.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks !,
I´m gonna try the OnActive thing, but I would like to do it generic, do you know anyway to get the first control that have a tab stop ? ( just a function named like... "FirstTabOrderCtrl()" or something like that
Thanks again, Bye !
Braulio
|
|
|
|
|
You know what? Seems like calling SetFocus on the property page itself yields control to its first control (with respect to tab order). At least I've just tried it with a CDialog and it works.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks good tip !
The only problem is that OnActive is not called when the user presses the tab because it already has the focus ( crazy stuff... ).
Hasta luego Joaquin !, me rindo por hoy mañana me pondré de nuevo, con la cabeza más fresca
Un saludo
Braulio
|
|
|
|
|
Has anyone seen this error under windows xp before? I have a very simple application using a list control.. when the app is first launched I get the error "HLVDD.DLL hardlock virtual device failed initialization" What is this?
Thanks,
Rob
|
|
|
|