|
I want the shortcut is work from within my application,please tell me how can i do this.
please tell me with example if possible
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
In Resource Tab->Accelerator..
Enter the ID of Dialog box and give shortcut key for that.
Anu
|
|
|
|
|
i m try this but its not working
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
You can use the WM_SETHOTKEY message.
See the documentation on MSDN.
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Can you explain with example please.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
You can find an example here. If this isn't quite what you're looking for then you could just use the RegisterHotkey() function - however this defines a system-wide hotkey (documentation here). If this fails, look at keyboard accelerators here.
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Expecting favourable reply.
|
|
|
|
|
Super Hornet wrote: Expecting favourable reply
Explecting explicit and clear question, with code snippets and all that i need to understand the point with ambiguity...
|
|
|
|
|
char *ReverseString(char *pszString)
{
if (pszString)
{
int ilength = strlen(pszString) + 1;
for (int iIndex = ilength; iIndex > 0; iIndex--)
{
pszString[i] = pszString[i-1];
}
pszString[0] = '\0';
return &pszString[ilength];
}
else
{
return NULL;
}
}
int main()
{
char szString[] = "hello world";
cout << "String before reversing " << szString;
szString = ReverseString(szStirng);
cout << "\n String after reversing " << szString;
}
Is the above code correct???
|
|
|
|
|
hum... bad habits lead to bad code...
you're using C++, so use it entierely.
first of all, abandon the C-style strings (char*), it's just a pain to use when you can make use of the string class.
here is another solution:
std::string ReverseString(const std::string& str) {
std::string strTmp;
std::string::const_reverse_iterator iter;
for (iter = str.rbegin(); iter != rend(); --iter) {
strTmp += *iter;
}
return strTmp;
}
you could also use the swap technic:
std::string ReverseString(const std::string& str) {
std::string strTmp = str;
size_t len = strTmp.length();
for (size_t i = 0; iter < len/2; i++) {
strTmp[i] = str[len-i];
strTmp[len-i] = str[i];
}
return strTmp;
}
or even more powerful, using the STL algorithms (thanks jijo raj):
std::string ReverseString(const std::string& str) {
return std::reverse(str.begin(), str.end());
}
now in your main, just call it:
int main(int argc, char* argv[]) {
std::string s = "Hello World";
std::cout << "Before reversing : " << s <<endl;
std::cout << "After reversing : " << ReverseString(s) << endl;
}
modified on Wednesday, August 6, 2008 6:00 AM
|
|
|
|
|
You can further optimize it by using std::reverse() algorithm...
string Str = _T("Hello");
reverse( Str.begin(), Str.end());
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
damn it, i was sure such a functor was existing somewhere, but i couldn't put a hand on it though.
thanks for the notice.
|
|
|
|
|
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Dosen't string have a reserve() function?
|
|
|
|
|
Naveen wrote: Dosen't string have a reserve() function?
reserve() ? what for ?
|
|
|
|
|
ops My bad. sorry I miss read the reserve as reverse.
|
|
|
|
|
|
Super Hornet wrote: Is the above code correct???
That all depends on what you were trying to accomplish. The use of cout appears to be the only thing C++ that I see.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I have CListCtrl with 4 coloumn, I want to cerate CEdit and CButton control in 3 and 4 colomn. How can I do that?
And How can I handle these control on resize any colomn.
|
|
|
|
|
|
See here[^] and here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi all,
I want to check internet connection on particular pc... that is on which ever pc i run my code it should tell that net connection is there or not and on particular intervals it should check for internet connection....
How can i implement this through coding??
Thanks in advance
|
|
|
|
|
|
I tried using it, included intshcut.h header file but still linker is giving error netconnectDlg.obj : error LNK2001: unresolved external symbol __imp__InetIsOffline@4
Debug/netconnect.exe : fatal error LNK1120: 1 unresolved externals
how to remove this
|
|
|
|
|