|Manuals

Compiling and Testing a C++ Application

Follow these steps to integrate a C++ application with Thinfinity VirtualUI:

1

Open Visual Studio and open the application’s project.

2

Add the path to the VirtualUI library in the Include Directories field, which can be found in the main menu under Project > Properties > Configuration Properties > VC++ Directories.

Compiling And Testing A C Application

3

Add Thinfinity.VirtualUI.cpp to the Source Files and Thinfinity.VirtualUI.h to the Header Files.

4

Include Thinfinity.VirtualUI.h in the application’s cpp:

#include "Thinfinity.VirtualUI.h"
5

Create a VirtualUI instance of the program and start it.

BOOL CMFCTestApp::InitInstance()
{
    INITCOMMONCONTROLSEX InitCtrls;
    InitCtrls.dwSize = sizeof(InitCtrls);
    InitCtrls.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&InitCtrls);
    CWinAppEx::InitInstance();
    if (!AfxOleInit())
    {
        AfxMessageBox(IDP_OLE_INIT_FAILED);
        return FALSE;
    }
    // Initialize VirtualUI
    VirtualUI vui;
    vui.Start();
    ...
}
6

Compile the program and run it in debug mode. You will see this message:

Compile Test Winforms App

If you select Start Web Browser, a web browser will open pointing to the application. The application will also open in desktop mode.

Alternatively, choose to not show the message and observe on the Windows Tray Bar that the Thinfinity VirtualUI Development Server icon will appear.

VirtualUI Tray Icon

Right-click on the icon, and then select Open Web Browser. A web browser window will open and your application will be running inside.

Note: When you run your application under an IDE, it automatically starts in web mode. To access the application, open your web browser and point to http://127.0.0.1:6080

7

Select Server Manager to access the Development Server Manager.

Read more