|
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...
|
|
|
|
|
How can i restrict resizing of my application at run time?
|
|
|
|
|
kiranin wrote: How can i restrict resizing of my application at run time?
Handle WM_GETMINMAXINFO .
|
|
|
|
|
This work only when we using maximize button,
but what am i asking is when we r about to change the size with the mouse
by dragging........ at that situation it is to be fixed
|
|
|
|
|
kiranin wrote: This work only when we using maximize button,
but what am i asking is when we r about to change the size with the mouse
by dragging........ at that situation it is to be fixed
I don't know why you say this... It's working perfectly here though...
LRESULT CResizeDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if( message == WM_GETMINMAXINFO )
{
LPMINMAXINFO lpMM = ( LPMINMAXINFO )lParam;
<code>lpMM->ptMinTrackSize.x = 200;
lpMM->ptMinTrackSize.y = 200;
return 0;
}
return CDialog::WindowProc(message, wParam, lParam);
}
|
|
|
|
|