|
What could possible be wrong when CFtpConnection::GetFile(…) returns 5 (Access is denied). I know the file exists and I’ve got the right URL.
Thanks for tips
_____________________________
...and justice for all
APe
|
|
|
|
|
Hello Everyone,
A question related Form design with C++ in Visual Studio .NET 2003.
Scenario
I've one Form, let's call it MyForm, with various controls on it. There's a Panel on this Form on which the user can draw and edit a polygon. Now, the mouse event methods were becoming quite large, so it seemed like a nice idea to write a custom class (MyPanel) which is a child of "System::Windows::Forms::Panel". In this class I for example redefine the "OnMouseMove", "OnMouseDown" and "OnMouseUp".
Next, I changed one line in the "InitializeComponent" method of MyForm; that is, I changed:
"this->panel1 = new System::Windows::Forms::Panel();"
into
"this->panel1 = new Guillotine::CCanvas(this);"
Results & Problem
Now, the above works fine when I compile and run the application. However, I'm in real trouble when I start using the Form Designer. The Form Designer removes all the code related to the Panel, thus clearly does not accept any adaptations to the "InitializeComponent" method of MyForm.
NOTE: The MyPanel class can not be written as a stand-alone control, and then imported through a dll, since it "talks" to various other controls on MyForm!
Question
I realize that InitializeComponent is *not* to be adapted (according to the text preceding this method). However, the above change seems very natural, and the adaptation of the "InitializeComponent" is marginal. My question is whether I can let the Form Designer know that everything is ok with MyPanel (my self defined Panel class), and that the Designer can accept this child of Panel as a Panel?
Looking forward to possible approaches to tackle this problem (or on explanations why I should definitely *not* do this )!
|
|
|
|
|
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
|
|
|
|