exercise five you're going to develop a managed code application for your os design in this exercise you will use visual studio.net 2003 in order to create a c-sharp managed application targeting your os design we add some controls and event handling code to your application and then we build an application deploy and debug the application in your target design in order to basically start this application first you have to make sure that the platform builder manager has already launched the uh basically image into your target design as you see right now my image works no problem these are available applications that are ready to be executed on my target designer in order to present the window of my target design i'm using remote tools called zoom in in order to get connected to my apex platform as you realize and actually i can just get connected to the default setting right here or i can just choose my apex platform device and choose the configuration to be ce shell and kiddle services i test the communication and as you see gets connected click ok and ok and ok and then i can get connected to my apex platform device that i've already launched into my ebooks and as you see windows is running now the first thing you have to do you have to make sure that you have basically an ip assigned to the ip address of your target designer so what i'd like to do i'd like to show you how to do this we're going to go and select basically the network options that i have in here we're going to double click on it and we're going to see the configuration of the ip address is already set to a particular ip address as you see we are setting a static ip address for our device so we can communicate so my option here is already set the first thing we need to do is basically go ahead and launch visual studio 2003 in this scenario i've already launched visual studio 2003. what i like to do from the file menu i'd like to select a new project you could choose either visual basic or c sharp it doesn't really matter the code will work either way if i choose c sharp i choose a smart device application and basically what i like to do i like to choose a location here for my project to be created and i'd like to call my application to be called hello apex basically managed code that would be the name of my project i click ok and that automatically launches this particular screen i choose windows c and i choose windows application click ok that automatically creates a windows form application for me the first thing i need to do i need to basically set some properties as you see by default this is form one as a name i i'd like to change the caption to be like apex app demo c sharp for example as you see the title of your form has changed a little bit you can resize your form the way you desire in this scenario you can basically resize your form the way you want it change it a little bit the way you like to appear on the screen i make it a little bit smaller for this particular demonstration and what i like to do from the toolbox i like to just basically drag a button right in here and from the property window i call it for example hello or say hello for example and on the name i call this btn say hello as the name of my button all i need to do now i need to double click on this particular button automatically brings the code editor for me and as you realize all i need to do i need to type in a message box that show and i can basically specify a text for example i can call it hello from apex infotech remember that c sharp is a case sensitive language versus vb that it is not so whichever language your application developers are familiar with they can use in order to go and basically create dotnet applications for your target designer so i'd like to also demonstrate vb.net application so you can see both languages can basically be deployed to your application what i'd like to do now from the deployment device i need to choose windowsc.net device and i select device options either from the toolbar or from the basically tools i can basically go ahead and choose uh the options here under configuration manager on the build menu i can choose configuration manager and that automatically shows this is a debug configuration that it would be built or you could just go with the you know basically a release version of this application but in either case you have to go to the device option on the project also you can go to the hello manage code properties and set some of these informations in here you could select device and as you see it's going to place your application on the program files on your target design also part of the configuration properties you can select the build and as you see they show you that you have basically the debug option and the debugging you can choose different options in here and the common properties also on the general you can choose a different settings here for your device option as well so in either case i choose the device option in here and i make sure that i choose the tcp ip to be set to the ip address of my target device that's very important you have to be able to communicate so in this scenario i've already set this option use a specific api just that would be the ip address of your e-box and you can basically pay attention to this particular operation as you see if i connect automatically on the status bar on my uh basically uh visual studio 2003 says that device is connected however part of visual studio.net 2003 there is a utility for extension utility actually part of windows c.net extension utilities that you need to go and install the smart device authentication utility now is added if you recall part of the original demonstration uh we have already added uh basically that particular option here on the compact framework we have already added the smart device authentication utility on our target device and as you see visualization.net requires this utility which is right here uh actually on the tools menu of your visual suit.in 2003 you have a smart device utility available what i like to do i like to basically launch that particular utility from my device so what i need to do i need to go to run and uh on my target designer and i need to type in sd authentication utility device this is basically the name of the program that you need to run and by doing that by clicking ok on the target designer you can actually see this and this ip address is whatever ip address we have said originally on your target designer all you need to do is select start on this particular screen and as you see the start button becomes faded so from visual studio 2003 you can select a smart device authentication utility and choose the same ip address that you saw here so all i need to do type in 192.168.2.2 say setup device so this way now we can communicate from visual studio.net 2003 to our ebooks remember that this particular screen is going to probably show you a you know a message or some warning just ignore them just click ok you are set make sure you don't close this if you close it the communication will be basically a loss if as you realize if i click close basically the communication is lost and we cannot communicate and deploy our application so what i need to do i need to basically go back to my uh target and launch this sd authentication utility device again and click on start again in order to basically be able to communicate deploy my application to my ebooks so make sure you do not close this particular option 192 168 2.2 set up the device this status has to always be connected and you should minimize this in order to go ahead and test your application so what i like to do now i like to build my solution you shouldn't get any error whatsoever as you see zero error and you could simply deploy your solution to the target designer by clicking on deploy solution so as you realize i choose the actual device click deploy and as you see it copies everything into my application designer and if i select run automatically executes my application to basically target so if i click say hello on my target you see that the message box appears on the screen that would be hello from apex infotech so let's go ahead and add some debugging capabilities to our application so what i like to do i like to press and if i'd like to basically put a break point in here by right clicking and pressing an insert breakpoint you could also press f9 in order to place a breakpoint and uh let's stop our application and as you see i've put a breakpoint in here and i can basically run this application again and this time my application gets launched again and if i click on say hello once again it will basically launch back here to my application and i can step into my code and by stepping into my code automatically you realize that the message box appeared so you can not only deploy your application but also you can debug it right from in here and as you realize as soon as i click ok it comes back to my screen i can basically use my debugger window so in this demonstration you saw how to create and manage application using c sharp uh part of your particular project so what i'd like to do now i'd like to also show you that if you have vb.net application developers i call it for example apex say hi vb demo and click ok and choose windows c again this time brings up visual basic.net environment very similar screens and as you realize the power of visual studio.net 2003 allows you to go and create uh you know application for windows ce either from vb.net or c-sharp so on the text message i say apexvb.net for ce 5.0 and what i like to do pretty much the same thing this time i put a text box and show you a little bit more of the event driven programming and what i'd like to do called my text box to be for example txt name and my button to be for example greet and on the button i type in btn for example say hi and all i need to do here this time i have to know vb.net language so i say either message box or again the same thing like message box here that you learned in c sharp and specify for example hello and we're going to go and concatenate basically this hello with the value coming out of text property of my text box and that way we can basically go ahead and test it if i select build solution again i can basically make sure that the device is set and is already communicating if i connect it as you see the device got connected uh don't forget that you need to always and always have this smart device authentication utility to be on i already set it on i just added the new project so i don't have to redo a smart device authentication on both uh basically uh target designer and my visual studio.net i don't have to do that because i didn't close my visual i can simply go ahead and deploy my solution make sure that it gets deployed to my c device not the emulator and as you see i have to check to see what has failed it says the error operation could not be completed so what i can do i can close this if you see these errors these are part of basically uh problems that we still face uh part of visual studio that in 2003 and communication with the platform manager so all i need to do i need to set the device authentication again if you face that problem all you need to do basically do this again click on start in here and launch that particular smart device authentication utility one more time so hopefully that will fix the problem if i set up the device the device should be connected there you go don't forget don't close it just minimize it and this time if i deploy it it shouldn't fail and i should be able to communicate that as you see it did successfully complete it so if you face some problems just simply close it and redo the whole work but usually you shouldn't be able to hopefully in future service packs and other versions of visual studio.net will take care of this problem as well now let's go ahead and put a breakpoint in here and run our application once again deploy it and this time i'm going to go and refresh my windows ce and as you see vb.net application got created and i type in my name and all i need to do is select greet and as you see it jumps automatically to the line that is supposed to concatenate hello with my first name so all i need to do just continue to the rest of execution and as you see the message box appears so in this demonstration you realize how to create visual studio.net manage application and download and deploy it to your windows ce located in the target designer not to mention that there are so much to talk about as far as learning visual c-sharp or visual basic.net as well as the platform builder itself available remote tools that you might have here in visual studio.net as well as the platform builder remote tools there are so many other classes so many other labs that i invite you to come and take care of it i hope this entire demonstration helped you in order to get us started and work with the platform builder as well as the visual studio in 2003 hopefully this opens new windows of opportunity for your company or yourself in order to endeavor new opportunities for your job market thank you and good luck to your project thank you