In this video, Chris Pels creates a managed Windows Forms control to use in a C++ application, and teaches you how to capture events from the Windows Forms control in your C++ application.
The following text is a software generated transcript of the video. Click on a minute link to jump to a location within the video
Minute 0
Hi this is crisp else in this video were to learn how to create a rich client application with the Microsoft foundation class library first thing you need to do is create net user control sold at a new project or solution here and that project will create a Visual Basic gate Windows forms control Library default may know him when used control year by default you control one is fine for this purpose and we won in two controls this will add a text box here and let s also had a button backdrop of button on to use him for one and the only thing we have to do special here is to make sure that this button in text box are declared public which is not the case by default nor do that will
Minute 1
The show all files and open up the user control one designer gowns the bottom here and there is the declaration of our two controls lets change friend here to public and also this one of should be all set here let s just build this or that we ve done everything right and build succeeds will set that will move on to Ivan except next we went creating an FC host application slated new project or solution here this time of integrated Visual C project and will use the MFC application template lets call this MFC one click okay and will get the MFC application Wizard
Minute 2
A based application s select that Eminem and defaults for the rest of as its own click on finish and there we have far and a CF Asian addressing the media is a static text placeholder that will actually host parties control that reaches creating civil book here and there is a static text placeholder on the dialog window by default and this can resize that he approximately the same size as our user control and then we re going to get rid of the caption on a fitness slightly differently here is IDC_41 1 16 headstock true that we need forward to the properties for the project and
Minute 3
Person we want to do is with the general configuration properties and instead of no CLR support than one change that to have CLR support and then out here we won at her reference to the project decree if you need a video for the use of controls at a new reference select projects of Windows control Library one select okay next A1 add in includes for Windows forms for and swapped the STD affects down here right after this includes we want to add a new on and we want to add the AFX Win forms H helps make note that this is for NSC Windows forms support everyone in the code to create and manage control
Minute 4
Open up in C1 theology and we won editing text in section for life a series of Sebring forms control and one woman trade is from our Windows control class library and we want to create an instance of the user control is one and the little dad is in control one adding implementation for the managed control over here to see a one dialogue and the man to the dialogue section in and out what we want to add a managed control checks and controls and need a pointer to its
Minute 5
Data exchange acts and then the resource ID of control and is I see CTR L1 and then we re going to use a reference_us control while power should be all set to test out our project switches make sure that MS you want as our son a project which it is so will build the solution and when it s done will started out bad CFR Windows control Library use control is posted in the NFC application dialog window and we go started up without debugging and there is art net managed control from the Windows control Library one project hosted in our MFC dialog window and excellent and it do is enable Lars
Minute 6
Plus plus class to receive a call back from a managed event raised from the Windows form control and actually want to do is add patch and on click event handler to the button control using a delegate to open up the source file here and go down to in a dialogue where we won at the event handler and person need to get our control and then we want the button element and we want to attach this to the click event next weekend at the event handler and we used the delegate and we want pass in the event handler and we ll call it on click
Minute 7
Annexing the need to do is define a delicate matter and be on click definition over here to the dialog header file first led the delicate matter than the first man we need is begin delicate that and we want to create this for our class which is CNN see who won Theo G next we need the event delegate entry and here are tips for Xeon click event and can pass ace them object
Minute 8
And then with a system event cards and lessening the need for that matter definition is this the end that we could not see no need a definition for the enclave and so will add that here and it gets insists them to an object called a sender and it also gets that uses them event cards
Click here to go to original video page
Sunday, August 24, 2008
Video: How Do I: Create a Rich Client Application with MFC?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment