|
I'm useing MFC and got a problem in finding focused control within my dalog box...
Thank you masters!
|
|
|
|
|
GetFocus() may be?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Rajesh R Subramanian wrote: GetFocus() may be?
Wow! And how did you find it?
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
[My articles]
|
|
|
|
|
I ask Robert.
Every time there is a question in the C++ board, I ask Robert. Robert answers all the questions. He has to. I beat him with a calfskin leather belt until he does.
His Mondays are brutal, when queries pile up over the weekend.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Oh, well, poor Bob, just another THHB's victim.
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
[My articles]
|
|
|
|
|
Rajesh R Subramanian wrote: I beat him with a calfskin leather belt...
Please leave your personal stuff at home.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Balanced the ugly troll's vote.
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
[My articles]
|
|
|
|
|
Thanks pal.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Why the hell does all your arguments, always, take place in my section?
Getfocus()? how many times have you tried it before in a dialog box?
|
|
|
|
|
continue like this, you're in the good path...
|
|
|
|
|
Maybe this[^]thread will help.
|
|
|
|
|
Thank you gentelman, good answer!
modified on Saturday, October 4, 2008 1:26 AM
|
|
|
|
|
Hi all,
i want to use CArchive for serilization data and have written a small class like the following one. The class contains two CArchive members. In one i want store data from the other i want load data.
I want to use a cast operator using the new class without overloading any >> and << operator from CArchive when serialize in and out data.
class TestArchive
{
public:
TestArchive():
oStore(new CMemFile(), CArchive::store)
oLoad(new CMemFile(), CArchive::load)
{;}
void SetLoadMode(bool bMode) {m_bLoadMode = bMode; }
operator CArchive&() { return m_bLoadMode ? oLoad : oStore; }
protected :
bool m_bLoadMode;
CArchive oStore;
CArchive oLoad;
...
};
...
using the class like that, (implicit casting)
CTestArchive oTestArchive;
Byte by = 255;
oTestArchive << by;
I got an error C2593 operator << is ambiguous.
With explicit casting CTestArchive to CArchive, it works fine.
(CArchive&)oTestArchive << by;
It seems to me, that the written cast operator is not used.
Any ideas ?
Regards
Wolfgang
modified on Friday, October 3, 2008 7:30 AM
|
|
|
|
|
I reckon you need to implement the << and >> operators in your class,redirecting the implementation to the correct member in each. There's no way the compiler is going to call your cast because it's to an unrelated type (not base class). The compiler can't know that the shift operators you intend to use are from the CArchive class unless you somehow tell it. I'm impressed that even the explicit cast version works it probably won't with older compilers.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Well, the explicit cast is a very rude tool, for instance
class A
{
public:
void foo(){ printf("foo\n");}
};
void main()
{
int i;
((A &)i).foo();
}
happily compiles.
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
[My articles]
|
|
|
|
|
Hi all im getting error as :C1010: unexpected end of file while looking for precompiled header directive.. whenever i try to compile program with CppSQLite headers.. I included the sqlite.lib reference in thye linker options.. pls its urgent... i need to submit a mini project.. its dependent on ur help....
|
|
|
|
|
gkns wrote: pls its urgent
Well, you know, Google is very fast [^].
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
[My articles]
|
|
|
|
|
and if the previous answer doesnt help, read the comments (on about Page 5) of the CPPSqlLite article by Rob Groves, where someone had that exact issue and was given two ways of fixing it (one of which CPallini's google search found for you)
Often it helps to read through the comments at the bottom of an article ..
'g'
|
|
|
|
|
HI
im using HRGN stuff, i have 2 boxes that have a variable width and height, on mouse down in the corner ive coded it to change the width and the height variables and update but the two HRGN's dont update,
int nWidth = 550;
int nHeight = 400;
HRGN hRegion1 = CreateRectRgn(0, 0, nWidth, nHeight);
HRGN hRegion2 = CreateRectRgn(0, 0, nWidth, nHeight);
void ClientResize(HWND hWnd, int nWidth, int nHeight)
{
RECT rcWnd;
POINT pnt, pntDiff;
GetCursorPos(&pnt);
GetWindowRect(hWnd, &rcWnd);
if((pnt.x >= (rcWnd.right-20))&&(pnt.y >= (rcWnd.bottom - 20)))
{
pntDiff.x = pnt.x - nWidth;
nWidth += (int)pntDiff.x;
pntDiff.y = pnt.y - nHeight;
nHeight += (int)pntDiff.y;
MoveWindow(hWnd, rcWnd.left, rcWnd.top, nWidth, nHeight, TRUE);
}
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
g_Hwnd = hWnd;
dwStyle &= ~(WS_CAPTION|WS_SIZEBOX);
SetWindowLong(hWnd, GWL_STYLE, dwStyle);
CombineRgn(hRegion1, hRegion1, hRegion2, RGN_OR);
SetWindowRgn(hWnd, hRegion1, true);
break;
case WM_LBUTTONDOWN:
ClientResize(hWnd, nWidth, nHeight);
break;
case WM_LBUTTONUP:
UpdateWindow(hWnd);
break;
}
|
|
|
|
|
Sarriss wrote: but the two HRGN's dont update
I don't see any code that changes the regions there
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
it changes the values used in the region, do i have to restate those regions then or is there a way of updating them
|
|
|
|
|
The values used to create the region have no relevance later.
Yes, you need to alter the regions if you want them altered.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Also note that once you call SetWindowRgn(), the window owns the region
(you aren't supposed to touch it).
You need to create a new region to update the window region again.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
I want to know if any application is listening to my keyboard activity by set using the low level keyboard hook.
How can i do it ?
|
|
|
|