c++ Applications to the web with Thinfinity VirtualUI

Compiling and Testing Your C++ / MFC Application with Thinfinity VirtualUI

Picture of Hernán Costa
Hernán Costa

Solution Engineer

Compiling and Testing Your C++ / MFC Application with Thinfinity VirtualUI

Introduction

As developers, we’ve all encountered legacy applications that, while still functional, feel trapped in time. If you’ve worked with Microsoft Foundation Class (MFC) applications, you know they’re robust and reliable but often confined to desktop environments. In today’s world, where users expect to access applications from anywhere, being limited to a desktop can feel like a significant hurdle.In this article, we’ll explore the advantages of making your legacy MFC applications web-accessible. We’ll delve into the common types of MFC applications you might be dealing with and discuss practical strategies for modernizing them. Whether you’re working in an Independent Software Vendor (ISV) or an enterprise setting, this guide is tailored to help you navigate the transformation smoothly.

Understanding the Challenge

What is MFC, and Why Does It Matter?

The Microsoft Foundation Classes (MFC) is a C++ library developed by Microsoft to facilitate the development of desktop applications for the Windows operating system. MFC provides a set of functions, constants, data types, and classes that encapsulate the Windows API, making it easier for developers to create applications with graphical user interfaces and advanced graphics capabilities.

Historical Context

MFC was introduced in 1992 alongside Microsoft’s C/C++ 7.0 compiler for 16-bit versions of Windows. Over time, it has evolved with updates to support new features such as the ribbon interface introduced in Microsoft Office 2007. Despite the introduction of newer frameworks like .NET and Windows Presentation Foundation (WPF), MFC remains in use due to its established presence and compatibility with existing applications

Key Features of MFC

  • Object-Oriented Framework: MFC is designed as an object-oriented framework, allowing developers to use principles like abstraction, encapsulation, polymorphism, and inheritance. This makes it easier to manage complex programming tasks and create modular and reusable code.
  • Windows API Abstraction: MFC simplifies Windows programming by providing a higher-level abstraction over the Windows API. This allows developers to focus on high-level application features without dealing with low-level Windows-specific details.
  • Document/View Architecture: MFC supports the document/view architecture, which separates application data (the document) from its user interface (the view). This architecture is particularly useful for applications that require multiple views of the same data or complex data manipulation.
  • Predefined Controls and Components: MFC includes classes for common UI controls such as buttons, list boxes, and tree controls. It also supports advanced UI elements like ribbons and docking panes, which can be customized to enhance user interaction.
  • Compatibility and Extensibility: MFC ensures compatibility with various versions of Windows, allowing applications to be forward compatible with newer releases. It also provides extensibility through class derivation, enabling developers to add application-specific functionality.

Limitations of MFC Applications

As developers, we often inherit these applications. They’re packed with business logic and have been battle-tested over the years. However, they come with challenges:

  • Limited Accessibility: Users need to be at their desktops to use the application.
  • Deployment Headaches: Rolling out updates requires touching every machine.
  • Integration Limitations: Connecting with modern web services isn’t straightforward.

Types of MFC Applications You Might Be Working With

You might be dealing with applications like:

  • Enterprise Resource Planning (ERP) Systems
  • Customer Relationship Management (CRM) Tools
  • Industrial Automation Software
  • Financial Analysis and Trading Platforms
  • Medical and Imaging Applications

These applications are mission-critical, and any changes need to be handled with care.


Why Make MFC Applications Web-Accessible?

From a Developer’s Perspective

  • Enhanced User Accessibility: Users can access the application from any device with a browser. No more “I can’t get to that until I’m back at my desk” excuses.
  • Simplified Deployment: Update your application in one place. Users always have the latest version.
  • Improved Scalability: Web applications can handle more users more efficiently.
  • Modern User Experience: Give your application a facelift without rewriting everything.
  • Integration Opportunities: Easily connect with web services, APIs, and other modern technologies.

Addressing Common Developer Concerns

  • Preserving Existing Functionality: You don’t have to rewrite your entire application.
  • Minimizing Risk: By avoiding a full rewrite, you reduce the chances of introducing new bugs.
  • Time Efficiency: Get your application modernized faster than starting from scratch.

Strategies for Modernization

Option 1: The Complete Rewrite

Let’s be honest—rewriting an entire application is a massive undertaking. It can be tempting to start fresh with modern frameworks, but this comes with risks:

  • Time-Consuming: It could take months or even years.
  • Risk of New Bugs: A new codebase means new potential for errors.
  • Resource Intensive: You’ll need significant development resources.

Option 2: Traditional Virtualization Tools

Another approach is to use traditional virtualization tools. These tools encapsulate your application in a Windows session and stream the entire desktop environment to the user.

Cons of Traditional Virtualization:

  • Encapsulation Limitations: The application runs within a full Windows session, which can limit performance due to the overhead of virtualizing the entire desktop environment.
  • Integration Challenges: Because the application is confined within a virtual session, integrating it with other web applications and services becomes difficult.
  • Resource Intensive: Virtualizing full desktop sessions consumes more server resources, affecting scalability and increasing costs.
  • User Experience: Users may experience latency and less responsive interfaces compared to native web applications.

Introducing Thinfinity VirtualUI: A Better Alternative

Why Choose Thinfinity VirtualUI?

Thinfinity VirtualUI virtualizes applications at a lower level than traditional virtualization tools. It allows you to webify your application with minimal code changes while expanding possibilities for session control and integration within your software ecosystem.

Advantages of Thinfinity VirtualUI

  • Minimal Code Changes Required: You don’t need to refactor or rewrite your application.
  • Enhanced Performance: By virtualizing at a lower level, it reduces overhead, leading to better performance compared to traditional virtualization.
  • Seamless Integration: Allows for better session control and integration with other applications and dependencies.
  • Path to Pure Web Transformation: Sets the stage for further modernization without the need for extensive refactoring.
  • Improved User Experience: Provides a more responsive and native-like experience within the web browser.

How Thinfinity VirtualUI Works

Thinfinity VirtualUI operates by intercepting GDI calls and translating them into HTML5, allowing your application to run inside any modern web browser. This approach means:

  • No Full Desktop Virtualization: Only the application is virtualized, not the entire desktop environment.
  • Resource Efficiency: Uses fewer server resources, improving scalability and reducing costs.
  • Better Integration: Easier to integrate with web services and other applications.

Implementing Thinfinity VirtualUI

Getting Started

While we won’t dive into a step-by-step tutorial here, the basic steps involve:

  1. Include the VirtualUI Header in Your Application:
    Add #include “VirtualUI.h” at the top of your main application file.

  2. Initialize the VirtualUI Class
    In your application’s initialization code, create and start an instance of the VirtualUI class:
    VirtualUI* virtualUI = new VirtualUI();virtualUI->Start();

  3. Compile Your Application
    Build your application to include the virtualization features.

  4. Publish Your Application
    Use Thinfinity Workspace to make your application accessible via a web browser.

For detailed instructions, you can refer to the How to Publish a New VirtualUI Application in Thinfinity Workspace tutorial.


Benefits Over Traditional Virtualization

By choosing Thinfinity VirtualUI over traditional virtualization tools, you gain:

  • Better Performance: Less overhead leads to faster application response times.
  • Improved Scalability: Efficient resource usage means you can support more users.
  • Enhanced Integration: Easier to connect your application with other web-based systems and services.
  • User-Friendly Experience: A more native feel within the browser enhances user satisfaction.
  • Future-Proofing: Sets up your application for further web transformation without starting from scratch.

Tips for a Smooth Transition

  • Test Thoroughly: Ensure your application works as expected in the web environment.
  • Optimize Performance: Identify any performance bottlenecks and address them.
  • Enhance Where Appropriate: Take advantage of web technologies to improve the user interface.
  • Keep Security in Mind: Implement necessary security measures to protect your application and data.

Conclusion

Modernizing a legacy MFC application doesn’t have to be a daunting task. From a developer’s perspective, Thinfinity VirtualUI offers a practical solution that saves time, reduces risk, and extends the life of your application.By virtualizing at a lower level than traditional tools, Thinfinity VirtualUI allows you to webify your application efficiently, enhancing performance and integration capabilities. It paves the way for a pure web transformation without the need for extensive refactoring.Making your application web-accessible not only meets the needs of today’s users but also positions your software for future growth and integration opportunities. It’s a win-win for both developers and users.

Next Steps

Ready to bring your MFC application into the modern age?

Get a Free Trial
Explore Thinfinity Workspace risk-free. Test our Cloud Management and RPAM features for enhanced security and control.

Have any questions?

Book a call today to learn more about how Thinfinity® can help your organization. We are always available to guide you and provide the best solution based on your specific needs.

Add Comment

Thinfinity_logo
Get a Demo
Experience how Universal ZTNA with Thinfinity integrates with VDI and DaaS for unmatched security and flexibility.
Thinfinity_logo

Get a Demo

Experience how Universal ZTNA with Thinfinity® integrates with VDI and DaaS for unmatched security and flexibility.

Blogs you might be interested in

<span>C++</span>, <span>Developer</span>, <span>Enterprises</span>, <span>HTML5 Conversion</span>, <span>Independent software Vendor (ISV)</span>, <span>Legacy Systems</span>, <span>MFC</span>, <span>Software Engineer</span>, <span>Thinfinity VirtualUI</span>, <span>Windows app to web</span>, <span>Windows to Web</span>, <span>WPF</span>