Wishing to use UWP instead of MFC for an app with a legacy DLL driver (Industrial PC)

IV 0 Reputation points
2023-05-09T12:24:14.6033333+00:00

Hi,
Back to developing on Windows after a few years, for a simple app (motion control in a manufacturing environment), I would like to move on from MFC I was using back then, and adopt UWP (also because I'll need to interface with databases, and wanted to adopt modern tools).
But I'm stuck with the following basic issue: I need to use a legacy DLL - a good old one with __declspec(dllimport) __stdcall C-style functions to access a dedicated hardware.

When I create a new MFC project, all is easy and smooth...
But when I start from a C++ UWP platform, my test program cannot start:

  • I am able to add the (x64) .h, .lib and .dll files to the project, and everything links ok.
  • but when I try to run (debug) the app, the app won't start, and I get the following error message:

"Unable to activate Windows Store app '.......' The SAMPLE.exe process started, but the activation request failed with error 'The target process aborted before activation completed.

Is there an easy solution? Or is it not possible to use a legacy DLL in this way? (I have no access to the DLL's source code)

Universal Windows Platform (UWP)
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,542 questions
{count} votes