Существует рабочий шаблон из VStudio, который импортирует эти библиотеки DLL в заголовок файл и включите этот заголовок в другой исходный файл. Код показан ниже:
Код: Выделить всё
#pragma once
// Exclude rarely-used stuff from Windows headers
#define VC_EXTRALEAN
// MFC core and standard components
#include
// MFC extensions
#include
//Import files are found in Program Files\Olympus NDT\FocusData 1.0. Add this directory to
//the C++ Additional Include Directories in project settings
#import "FocusDefinition.dll"
#import "FocusDataFile.dll"
#import "FocusData.dll"
//To apply XP visual style
#if _MSC_VER > 1200
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
#endif
Код: Выделить всё
#include
#define VC_EXTRALEAN
#import "FocusDefinition.dll"
#import "FocusDataFile.dll"
#import "FocusData.dll"
#if _MSC_VER > 1200
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
#endif
using namespace std;
int main()
{
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78754851/how-to-use-dll-in-vscode-when-dll-is-the-only-file-available-no-lib-no-hpp[/url]
Мобильная версия