|
Thaks all for your help.
I am so stupid. I forgot include "windows.h" after that it is working.
Thanks.
Regards,
Daavena.
|
|
|
|
|
i have 4 flex grids in my application. how can i use a single horizontal bar to scroll all the flexgrids together? i am aware that we can use scroll bars within the flexgrids. but i wnat it externally? please give me some leads
|
|
|
|
|
Where are those flexgrid placed ? In a view, on a dialog, ... ?
Basically, what you will have to do is handle to WM_HSCROLL and WM_VSCROLL messages that are set to the parent, move the grid accordingly and adapt the scrollbars correctly.
You'll have to configure the toolbars yourself (set the range, the size of the 'gripper', ...).
EDIT: you can check this article[^], it will give you some clues as what to do.
|
|
|
|
|
i am using a dialog based application for this. i will check it with the logic that u gave me and will certanily go thru the document which u added in ur post. thanks for the reply
|
|
|
|
|
Hi all,
I have a edit box and a button and on button click event i am placing a particular text in edit box.....
Now suppose if i am having "ab" in edit box and i place my cursor between a and b then after pressing button the text should display in between a and b.....(i.e i should get cursor position and whereever the cursor is the text should be appended there only)....
How can i do this....
Thanks in advance
|
|
|
|
|
|
i don't want to replace i want to append new text with older text but the text should be appended where the cursor is placed....
|
|
|
|
|
You want to append text or insert text in the middle? They are two different things!
For appending, you could use GetWindowText() followed by a SetWindowText()
For inserting, you could use ReplaceSel(), as Cedric already pointed out.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Did you follow the link and read the information ?
Did you understand this sentence ?
If there is no current selection, the replacement text is inserted at the current cursor location.
Isn't that what you are looking for ?
|
|
|
|
|
Ya actually sorry i didn't read whole sentence.....
thanks...
i'll try it
|
|
|
|
|
sounds like a case of the /. "google makes us dumber" syndrome
|
|
|
|
|
In a Win32 console application a timer should call a member function of a C++ class.
But how can I make the API function SetTimer to call this member function?
Thanks in advance.
|
|
|
|
|
Pass the class pointer as the argument of the timer callback function.
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
|
|
|
|
|
SetTimer() doesn't take a member function as an argument.
You can, however, use a static member function with the right signature:
class MyClass
{
...
static void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
...
};
You can pass &MyClass::TimerProc to SetTimer().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: SetTimer() doesn't take a member function as an argument.
I was afraid of that.
Thanks anyway.
|
|
|
|
|
Steffen Lange wrote: I was afraid of that.
Why is that a problem?
You can pass a function pointer, it just can't be a non-static class
member function.
If making the method static is the problem, you could use a multimedia timer[^]
instead. The multimedia timers let you have a pointer passed to
the callback which you can cast to a pointer to an object of your
class...
class MyClass
{
...
static void CALLBACK MyTimerProc(UINT uID, UINT uMsg, DWORD_PTR dwUser, DWORD dw1, DWORD dw2);
...
public:
void SomeFuncThatCreatesATimer();
};
void SomeFuncThatCreatesATimer()
{
...
::timeSetEvent(..., ..., &MyClass::MyTimerProc, this, TIME_PERIODIC);
...
}
void CALLBACK MyClass::MyTimerProc(UINT uID, UINT uMsg, DWORD_PTR dwUser, DWORD dw1, DWORD dw2)
{
MyClass *pThis = (MyClass *)dwUser;
...access non-static MyClass members using pThis...
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
I have a view that includes a dialog window from which the user can select different options. I do not want the user to be able to close that window. When the view changes, that dialog window will close automatically. However, I noticed that when the window is displayed, if the user hits the "escape key" esc, the window disappears. How do I prevent that from happening?
Thanks
|
|
|
|
|
Handle OnCancel() (IDCANCEL) in the dialog box.
comment the base class call CDialog::OnCancel().
Regards,
Sandip.
|
|
|
|
|
|
|
I have a CListCtrl, each row has a specified color.
CListCtrl myList;
myList.SetRowColor(j, crRows.GetAt(j));
Then I need to insert some new rows, the latest is at top. Here is source code
CArray<colorref> crRows;
CArray<cstring> newData;
int nNew = newData.GetCount();
for (int i=0; i<nnew; i++="" )="" {<br="" mode="hold" />
CString txt = newData.GetAt(i);
myList.InsertItem(0, txt);
COLORREF aColor = GetRowColor(txt);
crRows.InsertAt(0, aColor)
int nCnt = myList.GetItemCount();
for (int j = 0; j<ncnt; j++="" )="" {<br="" mode="hold" /> myList.SetRowColor(j, crRows.GetAt(j));
}
}
</cstring></colorref>
I works, but because of 2 loop for, the performance speed is very slow, so I have to improve it
Does anyone know what should I do in this case??
Thanks in advance
|
|
|
|
|
Instead of for loop you can just maintain a stack so no movements required.
Does it makes sense.
Regards,
Sandip.
|
|
|
|
|
thank for your reply
but actually, i'm afraid that I don't understand how to maintain a stack??
|
|
|
|
|
why you want to maintain STL is there you just have to use it
Regards,
Sandip.
|
|
|
|
|
STL? is that Standard Template Library?
sorry SandipG, I really don't understand what you mean. Can you explain more detail,
|
|
|
|