|
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
|
|
|
|
|
|
1. Make sure the class is only defined in one place (header file).
2. Make sure the contents of the header file are only included once. Use guard macros to prevent that:
#ifndef __STOCK_H__
#define __STOCK_H__
class Stock
{
...
};
#endif // __STOCK_H__
Regards,
Alvaro
|
|
|
|
|
Hello..
I want to know something! In Visual C++ also can use C code, but can or not C code in same project call C++ function??
like this, my C code is in what.c and I want to call function in loginDlg.C++, the function name is CLoginDLg...
i try do this in file what.c
CLoginDlg dlg;
dlg.DoModal();
but this error appear when i compile it
error C2065: 'CLoginDlg' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'dlg'
error C2065: 'dlg' : undeclared identifier
error C2224: left of '.DoModal' must have struct/union type
anybody can help me.. or i do wrong!!??
|
|
|
|
|
If you post some code perhaps we can help you.
Simon
C++: Only friends can see your private parts.
Sonork ID 100.10024
|
|
|
|
|
where to i post my code in this forum??
|
|
|
|
|
You can't call C++ code from C the way you're trying it. CLoginDlg is a class which C does not recognize.
What you can do is wrap that code inside a global "C"-style function inside your C++ file:
extern "C" void OpenLoginDlg()
{
CLoginDlg dlg;
dlg.DoModal();
}
Then you can call OpenLoginDlg in your C code.
Regards,
Alvaro
|
|
|
|
|
never mind for login dialog...
but i want you to solve this problem... because this i my main problem........
this is my C code
case IDC_OK:
database db; //this i call function from c++ file
db.Open(CRecordset::dynaset,"password);
while(!db.IsEOF())
{
if(db.m_userID == IDC_USER_NAME)
{
if(db.m_password == IDC_PASSWORD)
{
ShellExecute (NULL, "open", "d:\\games\\Same.exe",NULL,NULL,SW_SHOWNA);
exit(0);
}
else
{
AfxMessageBox("Incorrect password!");
m_word="";
UpdateData(false);
return;
}
}
loginConn.MoveNext();
}
but this error appear
error C2065: 'database' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'db'
error C2065: 'db' : undeclared identifier
error C2224: left of '.Open' must have struct/union typeerror C2065: 'CRecordset' : undeclared identifier
error C2143: syntax error : missing ')' before ':'
|
|
|
|