Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting 32 bit bitmap image to 24 bit bitmap image Pin
Bob Stanneveld30-Jun-10 20:16
Bob Stanneveld30-Jun-10 20:16 
GeneralInterprocess communication question... Pin
karam_chand3-Sep-04 0:16
karam_chand3-Sep-04 0:16 
GeneralCSockets Windows 2003 Pin
shiraztk2-Sep-04 23:40
shiraztk2-Sep-04 23:40 
GeneralRe: CSockets Windows 2003 Pin
jan larsen3-Sep-04 1:46
jan larsen3-Sep-04 1:46 
GeneralRe: CSockets Windows 2003 Pin
shiraztk3-Sep-04 2:11
shiraztk3-Sep-04 2:11 
GeneralRe: CSockets Windows 2003 Pin
shiraztk3-Sep-04 20:06
shiraztk3-Sep-04 20:06 
GeneralCFtpConnection::GetFile(…) returns Access is denied Pin
anderslundsgard2-Sep-04 23:26
anderslundsgard2-Sep-04 23:26 
GeneralIn-program Custom Panel through Inheritance Pin
Karel Appel2-Sep-04 23:15
Karel Appel2-Sep-04 23:15 
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 Wink | ;) )!
Questionhow to disable device(better "sound device" ) under 98/me Pin
max_xiayi2-Sep-04 22:47
max_xiayi2-Sep-04 22:47 
GeneralMaking the mouse pointer disappear Pin
Matthias19782-Sep-04 22:44
Matthias19782-Sep-04 22:44 
GeneralRe: Making the mouse pointer disappear Pin
Anonymous2-Sep-04 22:57
Anonymous2-Sep-04 22:57 
GeneralRe: Making the mouse pointer disappear Pin
Antony M Kancidrowski2-Sep-04 22:57
Antony M Kancidrowski2-Sep-04 22:57 
GeneralRe: Making the mouse pointer disappear Pin
Graham Bradshaw2-Sep-04 23:47
Graham Bradshaw2-Sep-04 23:47 
GeneralError message and then application crashing.Help Pin
Raghunandan S2-Sep-04 21:34
Raghunandan S2-Sep-04 21:34 
GeneralRe: Error message and then application crashing.Help Pin
Antony M Kancidrowski2-Sep-04 23:01
Antony M Kancidrowski2-Sep-04 23:01 
QuestionMFC Application in MFC DLL possible? Pin
RonnyS2-Sep-04 21:33
RonnyS2-Sep-04 21:33 
AnswerRe: MFC Application in MFC DLL possible? Pin
Antony M Kancidrowski3-Sep-04 2:34
Antony M Kancidrowski3-Sep-04 2:34 
Generaldll problem:how to gain the fucntion's parameters in dll file Pin
williamchou2-Sep-04 20:51
williamchou2-Sep-04 20:51 
GeneralSTL quickie Pin
alex.barylski2-Sep-04 19:47
alex.barylski2-Sep-04 19:47 
GeneralRe: STL quickie Pin
Johann Gerell2-Sep-04 20:37
Johann Gerell2-Sep-04 20:37 
GeneralRe: STL quickie Pin
alex.barylski2-Sep-04 20:50
alex.barylski2-Sep-04 20:50 
GeneralRe: STL quickie Pin
alex.barylski2-Sep-04 20:53
alex.barylski2-Sep-04 20:53 
GeneralRe: STL quickie Pin
PJ Arends2-Sep-04 21:02
professionalPJ Arends2-Sep-04 21:02 
GeneralRe: STL quickie Pin
Johann Gerell2-Sep-04 21:13
Johann Gerell2-Sep-04 21:13 
GeneralRe: STL quickie Pin
alex.barylski2-Sep-04 21:14
alex.barylski2-Sep-04 21:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.