|
U Can CMap,CStringArray etc.
-@SuDhIrKuMaR@-
|
|
|
|
|
Hi all,
i m working on VC++2005,SDI type application,in Dialog Box for Tabstop function of control i m using both Tab Key and Enter key.i m using this code .
BOOL CDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_RETURN))
{
pMsg->wParam = VK_TAB;
}
return CDialog::PreTranslateMessage(pMsg);
}
But i want tabstop function with use of both keys working on other controls like Edit,Combo etc but not for Button.
How can i do this. please help me for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
One simple method is to get the controlId from pMsg->hwnd by using GetDlgCtrlID() and check whether its that of your button control. See the code snippet rewritten for you.
BOOL CDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_RETURN))
{
UINT CtrlID = ::GetDlgCtrlID( pMsg->hwnd );
if( CtrlID != IDC_BUTTON1 &&
CtrlID != IDC_BUTTON2 )
{
pMsg->wParam = VK_TAB;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks Its working, But when i click on Button then after clicking its lost the focous on Dialog Box.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: Thanks Its working, But when i click on Button then after clicking its lost the focous on Dialog Box.
I didn't get it.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
i want after clicking on Button the cursor go to next control, but here the cursor is not visible after clicking on button.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I am creating DB application using VC++ & MS Access.
To store D.O.B. to MS Access DB, in VC++ dialog which control is good, is Date Time Picker useful?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
yes it is nice ,Create its COleDateTime type variable for storing value in DB.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi,
Thanks for the help!!
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Its O.K,
You can Vote me if answer is useful for u.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
sory , iam noise
i have two string matrixes that are tow dimintions
i want compare each line in first matrix with all lines in the second matrix
i want compare the line as block not char by char
as
string s1[50][50];
string s2[50][50];
i want comare s1[0]with s2[0]&& s2[1]......etc
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
This is like your homework with loops.
-@SuDhIrKuMaR@-
|
|
|
|
|
When getting the resources of type RT_RCDATA loaded into memory, MSDN is clear that the memory will be automatically released when the application terminates, but it does not really provide a way to release the memory when we are finished with it.
I can't use GlobalFree() and UnlockResource() is deprecated.
Any ideas on how to explicitly release the memory that the pointer returned from LockResource points to?
|
|
|
|
|
I found some code that went :-
HGLOBAL hGl=LoadResource((HINSTANCE)hInst,hrsrc);
...some time later
FreeResource((HGLOBAL)hGl);
does that help ?
|
|
|
|
|
I saw that yesterday in searching MSDN but unfortunately MSDN for Visual C++ 6.0 says...
"FreeResource
The FreeResource function is obsolete. It is provided to simplify porting of 16-bit Win32-based applications. It is not necessary for Win32-based applications to free resources loaded by using the LoadResource function. The resource obtained by LoadResource is automatically freed when the module is was loaded from is unloaded. However, to save memory and decrease the size of your process's working set, you should release the memory associated with accelerator tables, bitmaps, cursors, icons, and menus by calling the functions in the following table."
// End quote
I'm emdedding binary files and even though they are compressed, I just get that odd feeling leaving them in memory for the life of the application.
I'll probably concede that I'm looking for functionality that does not exist, unfortunately.
Thanks for the reply and help.
|
|
|
|
|
Wait. It just dawned on me that it was right under my nose all along.
From MSDN...
"The resource obtained by LoadResource is automatically freed when the module is was loaded from is unloaded."
I've been looking at it from the perspective of embedding the resource in my .exe when it looks like I should be using a "resource only" dll module. If I "LoadLibrary()" and "FreeLibrary()" for the resource module, the memory from "LockResource()" should be freed when I call "FreeLibrary()" according to the quote above. (Or at least when the reference count for the resource module goes to zero)
Do you think I'm barking up the wrong tree or is that probably the detail I've been ignorant of all along?
|
|
|
|
|
hi
after use [isdigit()function] i want use this digit and store it in integer varibel
i don't want true or false , i want this digtel number
|
|
|
|
|
int i = 0;
char a='5';
if (isdigit(a))
{
i = a - '0';
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
Is it unportable too?
(it doesn't work on my system...)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
int.Parse or int.TryParse ?
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
Well there are a lot of alternatives. IMHO using the .NET Framework for such a task is ludicrous.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|