Compact 2013 Ebook

16.5 Deploy & test an app
Created by djones on 6/18/2013 10:53:48 AM

1. Build the SDK native code application

2. From the other instance of Visual Studio 2012

a. Run the OS.

b. Start CoreCon on the device as per the previous section.

3. In the SDK project’s property pages Debug settings, enter the IP address of the device as determined in step 3. In the previous section.

4. Set a breakpoint on the first  _tprintf line of code.

Note: If you do not enter the IP address you will be prompted for it when you first attempt to deploy or run the app. If you want to change the IP address, just repeat step 3.

5. Check that deployment works from the application’s context menu in Solution Explorer:
Right-click on the project in Solution Explorer, select Deploy as in Figure 16.2.

6. Press F5 to run the application. Press F10 to step through the app.
Note the output on the device when you step over the _tprintf statement.

7. Run the application again using the various Debug menu options and the run icon (green triangle).

8. Run the application from the application’s context menu in Solution Explorer:
Right-click on the project in Solution Explorer, Debug—>Start New Instance as in Figure 16.2.

9. Step into the application from the application’s context menu in Solution Explorer:
Right-click on the project in Solution Explorer, Debug—>Step into New Instance as in Figure 16.2. You don’t need to have set a breakpoint for this.

10. Modify the code to print out the local time (as in chapter 15) as in Listing 1.2 and Listing 1.3. Build and test the application.

clip_image002

Figure 16.2: Deploy and Debug application context menus

int wmain(int argc, wchar_t *argv)
{
	_tprintf(_T("The time is: "));
	//Get the system time
	SYSTEMTIME st;
	GetLocalTime(&st);
	//Get DateTime
	TCHAR dateTime[100];  //The buffer for the DateTime string
	_stprintf
		(dateTime,
		_T("Time  %02d:%02d:%02d Date [DD/MM/YYYY] %02d/%02d/%04d\n"),
		st.wHour,st.wMinute,st.wSecond, st.wDay, 
		st.wMonth, st.wYear
		);
	_putts(dateTime);
	TCHAR ch;
	_tprintf(_T("Press enter to continue:\n"));
	_getts(&ch);
	return 0;
}

Listing 16.2: The SDK Console app to display local time: wmain( )

Add the following to the bottom of stdafx.h

#include < windows.h >

Listing 16.3: The SDK Console app to display local time: stdafx.h additions

Note: Because this application not part of the OS project we can’t use the debug macros such as RETAILMSG etc.


NEXT: 16.6 Create an SDK DLL

print

Click here to provide feedback and input

  Comments

There is no comment.

Return
Turkish porno izle video site in rokettubeporno izle