|
skyapie wrote: I'm using the OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) method to find out when a user uses a scrollbar
If this scrollbar is of this view only then it will not send WM_NOTIFY message. Handle WM_VSCROLL message
skyapie wrote: BOOL CBaseFormView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
NMHDR* pNMHDR = (NMHDR*)lParam;
if(pNMHDR->code == xxxxx)
{
//Do stuff
}
}
This code will work , if you want to handle scrolling of child window of this view, lets say scrolling in listcontrol present as child of this view.
|
|
|
|
|
Hi !
I'm compiling my project with warnings at level 3. I didn't change any warning-behavior with #pragma.
The problem is that I get many warning C4100 (unreferenced formal parameter) because of included headers. How can I get rid of these warnings for which I cannot do anything anyway ?
(btw : I've seen somewhere that warning C4100 is level 4, but it occurs at level 3, that's strange ! any hint about this ?)
Thanks for your help !
Jerome
|
|
|
|
|
|
You just want to disable th ewarning right use #pragma
#pragma warning( disable: 4100 )
Is that not working ???
Rinu Raj
|
|
|
|
|
Which IDE are you using ? IF you use VC2005, there is an option in project properties that lets you disable specific warnings. Go in 'C/C++' -> 'Advanced' -> 'Disable specific warnings'. Put the warning number (without the 'C').
And don't know if this feature exists in VC6 (I already searched for it but couldn't find it). I don't know for VC2003 (never used it).
using pragma won't help I suppose because you probably don't want to modify these header files. And they probably don't include stdafx.h.
|
|
|
|
|
Cedric Moonen wrote: using pragma won't help I suppose because you probably don't want to modify these header files. And they probably don't include stdafx.h
but he can always do this :
#pragma warning(disable:4100)
#include "the_header.h"
#pragma warning(default:4100)
|
|
|
|
|
Sure. But if he needs to include that file in several places, this can be a pain...
|
|
|
|
|
How to remove or changing from the default color to required color of the splitterbar between two panes?
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
I didnt find any useful info there
|
|
|
|
|
Is there any equivalent to sprintf() & co. for STL-Strings ? I really don't want to use a buffer to work around that.
|
|
|
|
|
For anyone who is interested, i found a good way. I use an ostringstream object to write my formated data to via standard stream operators. Then i use it's member function str() to return me a basic_string :
<br />
string teststring;<br />
ostringstream teststream;<br />
unsigned int testnumber = 1234;<br />
<br />
teststream << "The Number is " << testnumber << " !!!!" << endl;<br />
<br />
teststring = teststream.str();<br />
<br />
cout << teststring;<br />
|
|
|
|
|
Check out the Boost[^] library - it includes an excellent formatting class called boost::format .
Kicking squealing Gucci little piggy.
|
|
|
|
|
hi,
I am using keyboard to simulate mouse
GetCursorPos
SetCursorPos
function, and I'd like to ask
how can I simulate Click
(even into window doesn't belonging to my process)
thank you
Viliam
viliam
|
|
|
|
|
SendMessage - you can send the click messages to the window.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thankx I'll try
do you know how to find windows handle for current mouse position
(to send message to)
thank you
viliam
|
|
|
|
|
|
viliam wrote: how can I simulate Click
(even into window doesn't belonging to my process)
thank you
Viliam
Use SendInput .
|
|
|
|
|
For converting 'LPTSTR' to 'wchar_t *', we can use '_T()', Example :
MessageBox(_T("Some UniCode characters"));
Is there another way ? ... because I have wrote a long code and adding _T() to all strings is a little difficult!
Thanks.
|
|
|
|
|
Mohammad Rastkar wrote: For converting 'LPTSTR' to 'wchar_t *', we can use '_T()', Example :
MessageBox(_T("Some UniCode characters"));
Is there another way ? ... because I have wrote a long code and adding _T() to all strings is a little difficult!
Just add an L before the string. But then this is hard coding, and will cause problems in ANSI builds. It won't cause any problem if you are assigning directly to a LPCWSTR etc, but will cause problems if you are trying to use TCHAR versions like LPCTSTR .
For eg:
LPC<code>W</code>STR pBlahString = <code>L</code>"Blah Long string Blah Long string Blah Long string Blah Long string Blah Long string
Blah Long string Blah Long string Blah Long string Blah Long string Blah Long string Blah Long string Blah Long string
Blah Long string Blah Long string Blah Long string Blah Long string Blah Long string";
|
|
|
|
|
I just want get rid of adding _T() or L .
It's the importatnt part!
Thanks
|
|
|
|
|
Mohammad Rastkar wrote: I want to get rid of adding _T() or L ... its the important part!
That's mandatory!!
But still if you insist you can use CString .
CString strUnicode = "A string"; Internally CString does convert it to appropriate type. This depends on whether _UNICODE is defined or not.
|
|
|
|
|
No, there is no magic way to tell the compiler to make all ANSI strings Unicode, which is what you're asking for. The best solution I can think of is a regex search and replace across your code.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: I can think of is a regex search and replace across your code.
Ooops I got his question wrong!!
|
|
|
|
|
As far as I know adding an L infront of a quoted string is the only way of letting MSVC know it's supposed to be a wide char string...so i guess you'll have to add the L's or enclose with_T()'s
why dont you use the find and replace option in Visual Studio...using regular expressions you can replace all quoted string with their _T counter parts....
ie. Ctrl+H(replace dlg),
in Find what field enter: :q for VS .Net, \:q for VC6
in Replace with field enter: _T(\0)
ofcourse this means that all quoted strings found in the search domain will be enclosed with _T(), so you should be carfeful you don't apply this on resource files or manifest files etc....
another side affect would be that #include "File.h" will become #include _T("File.h")...you can remove those _T's yourself, or you can write another regular expression to remove _Ts form include files if they are too many...
|
|
|
|