|
And also make sure that CGridCtrl::CGridCtrl(int,int,int,int) has been "declared".
|
|
|
|
|
it is... the CGridCtrl is a class made by Chris Maunder available somewhere here on Codeproject.
|
|
|
|
|
Is there any way of creating a console program that runs without the user noticing? SOmething like a invisible console? I've seen an article that taught to do this, somewhere in CP, but I can't find it anymore..
|
|
|
|
|
Would ShellExecut() do it?
|
|
|
|
|
The simplest way to do that I've found is to create a normal Windows application (one with a WinMain function), and then don't create a window.
Software Zen: delete this;
|
|
|
|
|
|
Hey,
I've an application with 2 dialogs. The first dialog holds a couple of controls, the second dialog a listbox with handles to the controls (on the first dialog).
Now I want to set the focus to the control on the first dialog by selecting an item in the listbox. My problem is that the focus jumps back to my listbox after I set it to the control.
Code after selecting an item in listbox (all pointers are valid!)
<br />
CWnd* pWnd = GetHandleToDialogControl(iIndex);
pWnd->SetFocus()
I can see that the control get the focus, but it jumps back to listbox immediately...
|
|
|
|
|
You might try using PostMessage to send a user-defined message from the second dialog to the first in your listbox notification handler. This should let the focus handling in the list box complete, and then your user-defined message would reach the first dialog, which could then set the focus as desired.
Software Zen: delete this;
|
|
|
|
|
Where is this code located? In OnInitDialog()? If so, make sure you return FALSE from the OnInitDialog() function. If not, the system will give the first control in the dialog the focus (which may not be the control you have given focus).
--
Nominated For Three Glemmys
|
|
|
|
|
Having two dialogs communicate in this fashion indicates a very bad design. They should be using PostMessage() to communicate with each other.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello!
I have two classes A and B, which is derived of A
class A {};<br />
<br />
template<class T> class B : protected A<br />
{<br />
public:<br />
operator const A&() { return *this; }<br />
};
When I try
A a;<br />
B<int> b;<br />
a = b;
I get the Error
error C2243: 'type cast' : Konvertierung von 'class B<int> *' zu 'const class A &' existiert bereits, aber es ist kein Zugriff darauf moeglich
Why? I have defined an public conversion operator...
Alex
|
|
|
|
|
You defined a const conversion operator, but your assignment is to a non-const l-value.
Software Zen: delete this;
|
|
|
|
|
LionAM wrote: public:
operator const A&() { return *this; }
create two operators, one const, one not :
template<class T> class B : protected A {
public:
operator const A&() const { return *this; }
operator A&() { return *this; }
};
|
|
|
|
|
Thank you for your answers!
Unfortunately this seems not to work
under Visual C++ 6 (another bug?) - but it
does work in VC2005 Express...
But if I declare the classes as friends,
it works (and I even don't need the public
type cast operator).
Alex
|
|
|
|
|
Hi!
i want send BN_CLICKED message to my static control, when a key is down, in its focus (in OnKeyDown event of my static control).
void CMyStatic::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) <br />
{<br />
this->SendMessage(BN_CLICKED ,<br />
MAKELONG(this->m_hWnd,BN_CLICKED),<br />
(LPARAM)(this->m_hWnd) );<br />
<br />
<br />
CStatic::OnKeyDown(nChar, nRepCnt, nFlags);<br />
}
but it don't work. what do i do?
Zo.Naderi-Iran
|
|
|
|
|
First of all, BN_CLICKED is not a message. It's a notification send as part of the message. PLease refer to the button messages..!
|
|
|
|
|
First of all, BN_CLICKED is a notification sent by a button to its parent window. The corresponding notification for a static window is STN_CLICKED .
That said, the simplest thing for you to do is this:
void CMyStatic::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
GetParent()->SendMessage(WM_COMMAND,
MAKEWPARAM(STN_CLICKED,GetDlgCtrlID()),
(LPARAM)m_hWnd);
CStatic::OnKeyDown(nChar, nRepCnt, nFlags);
} Note that this will cause your CMyStatic control to treat each keypress as a click.
Software Zen: delete this;
|
|
|
|
|
Thank you!
but it don't work.
void CMyStatic::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { <br />
this->SendMessage(WM_LBUTTONDOWN);<br />
this->SendMessage(WM_LBUTTONUP);<br />
CStatic::OnKeyDown(nChar, nRepCnt, nFlags);}<br />
this code runs Clicked work.
Zo.Naderi-Iran
|
|
|
|
|
You should be sending BM_CLICK instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
i want alarm beep application.So i searchde in nte i got some thing.I used MessageBeep() function.But it gives only sound of same frequency.But i need different sounds or speed for different things.For ex: if alrm value is low it gives very slow beep and if it si very high then it beeps very high speed.
I saw PlaySound() api and there we can give .wav file oi our resource file and we use it through SND_RESORCE flag.
I dont how to include .wav file in our resource(.rc) file.Pls help me out and give any ideas for this???
Anu
|
|
|
|
|
|
Beep(DWORD dwFreq,DWORD dwDuration) the more frequency you give, the more *creeech* it gives. For high alerts, give more duration. 1000(ms) gives you 1 sec of beep.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
I have come across what seems to be a complicated problem. I need to add
string resources and bitmap resources to an exe file after it is
compiled. Anyone have any ideas ???, any WIN API functions that can do this ???.
Many thanks.
|
|
|
|
|
Sure you can - ever use VC++ 6.0/5.0 (or earlier) to open an executable as resources? The APIs have been available since before Windows 3.1.
See functions like BeginUpdateResource(...) , UpdateResource(...) and EndUpdateResource(...) for more info.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Thanks for the correction and sorry for the bad advice.
John
|
|
|
|