|
You need to force the redraw of whatever is behind/underneath your
window.
Maybe try something like
RECT rect;
::GetClientRect(hwndMyWindow, &rect);
::MapWindowPoints(hwndMyWindow, HWND_DESKTOP, (LPPOINT)&rect, 2);
::InvalidateRect(NULL, &rect, TRUE);
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I am having a main exe dialog box from which another dialog box opens up which is having a button and a edit box. On clicking button my menu appears. what i want is when i click on menu item particular text should be written in edit box. when i open class wizard for menu items and choose my dlg class and write OnCommand code over there a debug error is given and when i choose second class as base class nothing happens on click event
Can anybody help me in this
Thanks in advance
|
|
|
|
|
|
write the command handler in the class which has the edit control.
then, if u have a member variable for the edit control then use it to set the required text otherwise directly use win32 api: setdlgitemtext() by taking the hande of the edit control
prasann
who else
|
|
|
|
|
hallo,
in order to display and change a date list written in a txt file, seveal CEdit and CSpinCtrl should be dynamic created. The amount for the set of Editbox and SpinCtrl should be dynamic decided, according to the count of date set. CSpinCtrl and CEdit has the same behavior.
I cant set the Message using ClassWizard, How can I dynamic set the Message for the CEdit and CspinCtrl?
I have tried,
in the Class, a Message Map UDN_DELTAPOS (ID, OnEditChange()). I set all the CSpinCtrl with the same ID. In this way, when any CspinCtrl changes, the function OnEditChange() will be called, but i can not recognize which one has been clicked.
does anyone who has a solution?
thanks
mwolf
|
|
|
|
|
|
To Hamid:
for the edit control is created dynamicly, we may asign an ID for this edit control using
<br />
#define LVS_EDIT_ID 5100<br />
<br />
m_pctlEdit = new CEdit;<br />
m_pctlEdit->Create(xxx, <big>LVS_EDIT_ID</big>);<br />
If we send a message to the edit control(NOT FAMILAR TO SendMessage too), The edit control how to deal with this message, and where is the code?
I'm very poor at SDK programming way.
|
|
|
|
|
to Hamid,
unfortunately, i havent got sendmessage in the link you gave.
I can assign a ID and a function before the CEdit is created, and use
UDN_DELTAPOS (ID, OnEditChange().
then by creating the CEdit, I can set the same ID for the CEdit.
the problem is, before the programm running, i cant decide how many CEdit should be created, so I have no idea how many IDs should be assigned in my program.
|
|
|
|
|
Do you want to make edit controls with user select why you dont use of a int variable I had worked before but I think its possible that you use of them.
|
|
|
|
|
I didnt understand what you siad you make a dynamic control now do you want to know where you must send messagess to it?
|
|
|
|
|
Hi,
I am studying LR1 compiler construction and am confused with the Closure(I) function.
The book I have gives the following:
Closure(I) =
repeat
for any item (A ---> a.XB, z) in I
for any production X ---> y
for any w {set} FIRST(Bz)
I <-- I U {(X ---> .y, w)}
until I does not change
return I
The part I do not understand is FIRST(Bz). Is this the same as FOLLOW(X)?
It would be great if somebody could rewrite this in C style pseudocode to help me understand this further. Here is some pseudocode for the type of thing I have atm....the actual C++ code is too involved for a forum posting:
STATE Closure(STATE I)<br />
{<br />
bool updated = false;<br />
do<br />
{<br />
updated = false;<br />
for(int i = 0; i < I.itemcount; i++)<br />
{<br />
ITEM *pItem = I.items[i];<br />
int prev_prod_count = I.prod_count;<br />
<br />
if(pItem->phase < item.production.right_length)<br />
{<br />
right_token = item->prod.right(item.phase);<br />
for(vector<PRODUCTION>::iterator itProd = grammar->begin(); itProd != grammar.end(); itProd++)<br />
{<br />
if(itProd->left_side == right_token)<br />
{<br />
SYMBOLSET *pBeta = NULL;<br />
if(item.phase + 1 < item.right_length)<br />
{<br />
pBETA = FIRST[item.prod.right[item.phase + 1]];<br />
if(pBETA->count == 0)<br />
pBETA = FIRST[item.look_ahead];<br />
}<br />
else<br />
pBETA = FIRST[item.look_ahead];<br />
<br />
foreach(symbol in pBeta)<br />
{<br />
item.append(*ItProd, 0, symbol);<br />
}<br />
}<br />
}<br />
}<br />
if(I.prod_count != prev_prod_count)<br />
updated = true;<br />
}<br />
}<br />
<br />
return I;<br />
}
Any help would be greatly appreciated!
Lea Hayes
|
|
|
|
|
Hi,
Would the following be true?
int right_pos = B;
SymbolSet *pSymbolSet = EmptySet();
do
{
pSymbolSet = Union(pSymbolSet, FIRST(right_pos));
right_pos++;
}
while(NULLABLE[right_pos]);
Because given the grammar:
Z' --> Z $
Z ---> X Y Z
Z --->
Z ---> d
X ---> Y
X ---> a
Y --->
Y ---> c
The rule production Z ---> X Y Z has two nullable non-terminals (X and Y), so I am guessing that Z would need to be included within the set w : {Bz}?
I have tried implementing this and it seems to work as I expected....but I wanted to verify if I have in fact understood the algorithm correctly so that I don't encounter a nasty suprise further down the line.
Best regards,
Lea Hayes
|
|
|
|
|
Using VC 6, is it possible to create VS macros that are unique to a project? What I mean by "VS macros" is the macros that are created, edited and run using "Tools | Macro" in VC 6 and documented in Macros[^]. The macros are in DSM files and have access to the Developer Studio Objects[^].
I can create a DSM file in the project but the only way I know to execute a macro in the DSM file is to load the file, which is done globally and for all projects and all workspaces. I want the macros in the project's DSM file to be used only for the project it is in.
I expect that someone is going to say that I should use a macro with a VBS or JS extension. Let me say ahead of time that if you think that will work, it is highly likely you are not familiar with VC 6 enough to understand. I will likely ignore replies suggesting I use macros that will be executed by WScript or CScript.
|
|
|
|
|
I don't know about the thema, so I can not help you a lot. But if you LOAD ... is there an "unload"??
I mean somthing like with the DLL, it can be there... but it is reached (in dinamic linking) only when LoadLibrary is called, and so far as FreeLibrary is not called.
Is it possible to do that in your question?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Please don't guess like this.
|
|
|
|
|
I am sorry if you didn't like it but, sometimes, "silly/simple" guesses from non-prof people can give you the idea to the solution.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Not when they are so much of a guess; that is a nice way of saying innacurate. You are accomplishing nothing except clutter this thread; I will ignore you from now on.
|
|
|
|
|
Hi,
Is there a way for me to automatically call an original member function from an overloaded function?
Like let's say I have a class, Class, which is inherited from BaseClass. BaseClass has member function "OnSave" and Class has its own version of "OnSave." Is there a way I can automatically have Class's OnSave call BaseClass's OnSave whenever it is called?
I don't want to do something like:
BaseClass::OnSave();
I want it to automatically call its inherited OnSave without me having to put that line of code in.
Thanks!
KR
|
|
|
|
|
KellyR wrote: I want it to automatically call its inherited OnSave without me having to put that line of code in.
You need to specifically/explicitly call the base class implementation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Calling base class version of function is your or rather implementation "need".
There is not such implicit mechanism available for that and can not be provided due to resaon stated in my first argument.
|
|
|
|
|
drugs are bad !
|
|
|
|
|
Agreed!!
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
|
KellyR wrote: BaseClass::OnSave();
IFAIK this is the only way to call the base class member.
Regards,
Paresh.
|
|
|
|
|
I want to animate an object(lets say a square that continualy rotates around)
and then able to select it and drag it to a differnt posistion with a mouse/keyboard
I have a very basic understanding of mfc, my guess to go about this
is to use a loop in the ondraw section with the settimer function
but I get a bit confused on how the mouse/keyboard listner will be implemented
would anybody be kind enough on giving me a quick explaination or soloution to the above mentioned.
thank you
Simon
Simon
-- modified at 18:11 Tuesday 6th November, 2007
|
|
|
|