|
Thanks for replying
No, OnKillFocus() is not working.
Actually wat i have done is create a subclass of CRichEditCtrl and that i have included in the Dialog that facilitates me to capture KeyPress event.
The code snippet is sumthing like this:
BOOL CSend::PreTranslateMessage(MSG* pMsg)
{
extern char userStatus[50];
if (pMsg->message == WM_KEYDOWN)
strcpy(this->userStatus,"Typing");
return CRichEditCtrl::PreTranslateMessage(pMsg);
}
but , then i have find out that Lost Focus is Mouse event and that cannot be handled using abouve snippet so i have tried a different this which is as follows:
BOOL CChat::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
NMHDR* pNMHDR = (NMHDR *)lParam;
if(pNMHDR && pNMHDR->code == NM_KILLFOCUS)
{
CWnd *pFocus = CWnd::GetFocus(); // call to a static function
if(pFocus &&(pFocus->GetParent() == this))
{
if(pFocus->GetDlgCtrlID() == TXT_SEND)
MessageBox("here",NULL,MB_OK);
}
}
return CDialog::OnNotify(wParam, lParam, pResult);
}
OR
BOOL CChat::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
UINT notificationCode = (UINT) HIWORD(wParam);
return CDialog::OnCommand(wParam, lParam);
}
But stll unable 2 capture lost focus event of CRichEditCtrl.
|
|
|
|
|
See if CRichEditCtrl::SetEventMask(ENM_MOUSEEVENTS | ENM_KEYEVENTS) is of any use?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Sorry, this is not solving the problem. Pls suggest me some other solution.
|
|
|
|
|
I am using Microsoft Flexgrid 6.0 in my application.
however when I try to maximize the application window , flexgrid does not get expanded in proportion to expansion and looks ugly.
any idea of setting up flexgrid such that it will expand according to the boundries of window in which it is embeded.
thanks
sanjay
|
|
|
|
|
Handle the WM_SIZE message for the parent window, and call MoveWindow on the control to resize the FlexGrid.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Dear all,
What is the simplest way to change the font size of an edit control? For ex., to change from 8 pt to 10 pt.
Thanks.
BRs.
____
Tuan
|
|
|
|
|
Assuming that this is a dialog project, call CEdit::SetFont() in the dialog's OnInitDialog() method. You'll first need to create a font, presumably with a CFont object that belongs to the dialog itself.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks so much, David. Is that the simplest and fastest way?
____
Tuan
|
|
|
|
|
Yes. I think you can also do it in the resource editor, but that might force you to change the font for the entire dialog page in question, and you might not want to do that.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Tuan Dang wrote:
Is that the simplest...
If by "simple" you mean "shortest," then I would have to say yes.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hi,
I am making an SDI program that needs to switch between "2 panes on the left, 1 on the right" and "1 left, 1 right"
I'm creating the 2 left panes by nesting a CreateStatic in another Splitter. (I make my CreateStatic calls from OnCreateClient) My idea is to somehow (after OnCreateClient) change the nested splitter from 2 rows to just one.
** My question is this: Is there a way I can Redefine my nested splitter and change the number of rows that it displays?
If there is a simpler way to solve this problem please let me know. I have looked at the splitter classes here on CP, but they seem to offer a lot of features that i don't want/need, and if a simpler solution exists I would prefer that.
Thanks.
Mike
"I bet Einstein turned himself all sorts of colors before he invented the light bulb." -- Homer J.
|
|
|
|
|
I've recently been through this process with an application of mine. The key to managing the content of splitter windows is the dialog control ID and parent window assigned to the windows in the splitter panes.
CSplitterWnd requires that the windows that occupy each pane be child windows of the splitter, and have the control ID returned by the CSplitterWnd function IdFromRowCol(int row,int col) . This function returns the control ID required for a given row and column within the splitter. Use SetDlgCtrlId() to set the control ID for the window you want to occupy the splitter pane at row,col. You also need to call SetParent for that same window to set its parent to be the splitter.
Note that the window occupying a splitter pane can be another splitter.
Software Zen: delete this;
|
|
|
|
|
I have a 32 bit (RGBA) image in CBitmap, and for processing purposes i get the array using GetBitmapBits & SetBitmapBits. And after that plot to screen.
The problem is that is only works if the target system is also running on 32bit screen depth. How can i get an array of pixel values from CBitmap to a DIB then after processing plot to screen?
Also, any DIB class? I'm completely lost.
|
|
|
|
|
uus99 wrote:
The problem is that is only works if the target system is also running on 32bit screen depth
why doesn't it work on other bit depths? what happens?
Cleek | Losinger Designs | ClickPic | ThumbNailer
|
|
|
|
|
RGBA: sounds like you are using GDI+. In which case look up GDI+ here at CP, there are several aticles on working with bitmaps. Also, check out Bitmaps & Palettes: CxImage, CDIBSection, CDibData uses GDI and sould give you an insight on converting from one format to anouther if needed. Using GetBitampBits and SetBitmapBits is not garanteed to give you the bits in any given format; therefore, they could eventualy return/set bits using a different format (driver dependent).
Well I hope this helps.
Good Luck!
INTP
|
|
|
|
|
The thing is i am receiving an image from a frame grabber in MemDC, which the image is RGBA (32bits) and tha A=0 all the times, so actually it is RGB (24bits+8bits empty).
At the moment, i can plot to screen using
pDC->StretchBlt(20,40,180,180,&MemDC,10,40,512,512,SRCCOPY);
It works, coz my screen is on 32bit depth. If my screen is changed to 24bit or 16bit, nothing comes out.
So, how can i make sure that i can always plot to any screen depth? I should use DIB is it?
|
|
|
|
|
Sorry I have be gone for a few days.
It almost sounds like the MemDC and the pDC are incompatible, because the color depth of the bitmap should not be the problem. If you select a bitmap of higher resolution than the screen and then blit it to the screen all you should notice, if any thing, is that the colors appear wrong. The only reason (normaly) for using a DIB, insted of a the normal windows bitmap type, is when you need to access the bits directly (more efficeintly). I do no beleive using a DIB will fix the problem. If you do not have a copy of Programming Windows by Charles Petzold, then I recommend you get one, it provides good information on GDI as well as code for working with DIBs. The bit manipulation code in CDibData was based mosly on information from that book.
Good Luck!
P.S. if you figure out what the problem is, please post it.
INTP
|
|
|
|
|
I am working on an OpenSSL application and need to call certain functions within my code. I have declared the following variables:
private: BIGNUM *bnPrime;
private: BIGNUM *bnSecret;
I make the following call and recieve the subsequent error:
StreamReader *sr = new StreamReader(fs);
BN_hex2bn(&bnPrime, sr->ReadLine());
error C2664: 'BN_hex2bn': cannot convert parameter 1 from 'BIGNUM *__gc *' to 'BIGNUM **'
The spec for BN_hex2bn is:
int BN_hex2bn(BIGNUM **a, const char *str);
I'm sure the String* returned from the ReadLine() call will cause an error as well, but if I could get some help with the first part. Thanks!
Alex
|
|
|
|
|
I know you can put what is returned from StreamReader's ReadLine() function into a CString object. Maybe you could do something like this:
CString str = sr->ReadLine();<br />
int nHex = atoi(str);
then convert the number. Just trying to help; don't scold me if it sounds stupid!!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I'm just curious...why is it that the number of visual c++ programmers overwhelmed the number of those using Visual Basic/VB.NET and C#, I'm just a newbiew in programming, and looking for a language most suitable for mobile (embedded) development. And in microsoft roadmap for VS.NET whidbey/orca i saw that visual c++ .net will be enhanced for native coding ( i really dont know what this mean and its diff in "manage" offered by .net ). Can anyone help me on this. i'm recently stdying embedded visual C++ 4.0, do you think my knowledge in this PL will be usefull in the future?
|
|
|
|
|
monn wrote:
why is it that the number of visual c++ programmers overwhelmed the number of those using Visual Basic/VB.NET and C#,
How in the world could you possibly gather statistics to support such a claim? If a person has been using VC++ for a number of years, but then starts using VB for a project, how would they go about answering a "What programming language do you use?" poll? Answering VB would mean that all prior work done with VC++ is not considered. Answering VC++ would mean that current work done with VB is not considered. Answering both would effectively cancel each other out.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
God is Real, unless declared Integer.
|
|
|
|
|
It usually helps to put some useful text with a smiley so the recipient does not have to guess as to what is being said/implied.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
"WTF" :no-comments:
God is Real, unless declared Integer.
|
|
|
|