|
if you have solution, can you send me the source code to xiayi@ustc.edu?
please contact:
max_xiayi@hotmail.com
|
|
|
|
|
Hello!
I'm currently building an application which uses a kind of "magnifying lens" to zoom into a displayed DIB. I use the mouse to move this "magnifying lens", but I think the mouse pointer is quite annoying while zooming in, so I want to make it disappear.
Does anyone know a nice and convenient way to switch the mouse pointer on and off?
Thanks a lot in advance!
Matthias
|
|
|
|
|
Yes I know the code for it.
|
|
|
|
|
Use LoadCursor() if you pass NULL the mouse pointer will be turned off.
To turn it back on again (standard arrow) use IDC_ARROW.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
You could use the ShowCursor function.
|
|
|
|
|
Hi All,
I have a client application which is sometimes displaying the message "An unknown error occurred while accessing an unnamed file" before crashing.This message is being displayed very randomly and i could simulate this only once.
The scenario was like this:
1) The client and server are running in seaparate machines connected over a network.
2)Send some request commands to server and before the response is obtained,disable the network on client's side.
The message "An unknown error occurred while accessing an unnamed file" was displayed and on clicking ok the application crashed.There is no log of this crash also.Can some one tell me whether this related to CArchive and what should i do to avoid this or what protection code should i add to avoid crash.
The function CSocket::OnClose() is getting called immediately when the network is being diabled.But this function is not getting called when the above message is displayed and in such situation the application is crashing.
Thanks in advance
Regards
Raghu
|
|
|
|
|
Have you tried putting try and catch around your socket code?
In doing so you may be able to get a better idea of the exception.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi Folks!
I have a question, i have a quite normal MFC Applikation and i want to have the Functions of the Project in a DLL. Is it possible to konvert the Project into a DLL? When yes, how can i make this?
I hope somebody can help me!
Thanks,
Grettings Ronny
|
|
|
|
|
It is probably better to generate a DLL and then add the function into the newly generated code.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
hi,
now i should get the param from the dll function,i just could gain the symbol(function name) in dll(and i can't make sure which language have been used to create the dll),but how to gain the fucntion's parameters in dll file?
thanks!
|
|
|
|
|
I have a list<basic_string> which only contains 2 items.
I have found tons of examples of iterating the list, but none for only dealing with 2 items.
How do I get the string values from the first and second element?
Thanks
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
I have found tons of examples of iterating the list, but none for only dealing with 2 items.
Well, you could of course iterate the list also with 2 items in it...
Hockey wrote:
How do I get the string values from the first and second element?
std::list<std::wstring> strings;
strings.push_back(L"string 1");
strings.push_back(L"string 2");
cout << strings.at(0) << L" and " << strings.at(1); Might output string 1 and string2, if you are lucky.
--
The Blog: Bits and Pieces
|
|
|
|
|
Cool i'll try it
Thanks
How do I print my voice mail?
|
|
|
|
|
Didn't work for what i'm trying to do
typedef std::list<std::basic_string<TCHAR> > string_list;
string_list m_lsFiles; // List of selected file(s)
Later on somewheres deep within my code I call:
MessageBox(0, m_lsFiles.at(0), m_lsFiles.at(1), MB_OK);
How do I print my voice mail?
|
|
|
|
|
try:
MessageBox(0, m_lsFiles.front(), m_lsFiles.back(), MB_OK); A list is not a random access container, so you can not retrive elements with an index number.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hah! What did I think of! I've been using to std::vector too much lately.
--
The Blog: Bits and Pieces
|
|
|
|
|
I think I did try that...but i'll try again to be sure
PJ Arends wrote:
A list is not a random access container, so you can not retrive elements with an index number.
I'm a total newbie to STL, but I just realized that
Thanks again
How do I print my voice mail?
|
|
|
|
|
Tried it and I get this error???
'MessageBoxA' : cannot convert parameter 2 from 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' to 'const char *'
How do I print my voice mail?
|
|
|
|
|
Combine what I said about using front() and back() with what Johan said below about using c_str() to get a char* from a string.
MessageBox(0, m_lsFiles.front().c_str(), m_lsFiles.back().c_str(), MB_OK); Do not give up on STL. It is quite cool once you get use to it.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
BINGO!!! It worked
Thank you kindly sir
PJ Arends wrote:
Do not give up on STL. It is quite cool once you get use to it.
it seems really cool, just frustrating when working on a due project....when I just want to get done what needs to be done
Thanks again!!!
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
Didn't work for what i'm trying to do
Well, then, you should have stated what you were trying to do...
To get a pointer to a character buffer containing the text of the string object you use std::wstring::c_str(), as in
MessageBox(0, m_lsFiles.at(0).c_str(), m_lsFiles.at(1).c_str(), MB_OK);
--
The Blog: Bits and Pieces
|
|
|
|
|
I'm getting this error now
error C2039: 'at' : is not a member of 'list<class std::basic_string<char,struct="" std::char_traits<char="">,class std::allocator<char> >,class std::allocator<class std::basic_st<="" i="">
WTF am I doing wrong??
I'm really starting to dislike STL
Thanks for the help
How do I print my voice mail?
|
|
|
|
|
As PJ pointed out, std::list is not a random access container, which means it does not provide indexed access to items. I've been working too much with std::vector...
--
The Blog: Bits and Pieces
|
|
|
|
|
I am slightly confused by your question. When iterating the list, what difference does it make how many items are in it, be it 0, 2, or 100?
Show some code of what you have so far.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
It just didn't make sense to use a for loop or while, whatever to only get at the first and last item in the list....there will always only be two under this one condition...
How do I print my voice mail?
|
|
|
|