c++ – Can’t #import old DLLs into Visual Studio 2022


We have a VS 2013 C++ project that imports old DLLs from OSISoft PI (pisdk.dll, pitimeserver.dll, pisdkcommmon.dll).

#import "pisdkcommon.dll" no_namespace
#import "PITimeServer.dll" no_namespace 
#import "pisdk.dll" no_namespace

After re-targeting the solution to the latest with VS 2022, it shows build errors for each of the 3 DLLs:

Cannot read type library file: ‘PITimeServer.dll’: Error loading type library/DLL.

and

cannot open source file “<path to>/pisdkcommon.tlh”

Dumpbin shows they are dependent on VCRUNTIME140:

Dump of file PISDK.dll

File Type: DLL

Image has the following dependencies:

    Secur32.dll
    sdktrace.dll
    WS2_32.dll
    KERNEL32.dll
    USER32.dll
    ADVAPI32.dll
    ole32.dll
    OLEAUT32.dll
    MSVCP140.dll
    CONCRT140.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-multibyte-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    IPHLPAPI.DLL
    pdh.dll
    VERSION.dll
    NTDSAPI.dll
    CRYPT32.dll
    RPCRT4.dll
    WINTRUST.dll
    loadperf.dll

We’ve tried changing the Windows SDK version and platform toolset to previous versions, but maybe the correct version is not installed? Platform Toolset in General Properties shows v120, v120_xp and v143.

Also tried adding different versions of Microsoft SDKs to the PATH from C:\\Program Files (x86)\\Microsoft SDKs\\Windows with some different results, but no solution.

Leave a Reply

Your email address will not be published. Required fields are marked *