Category : dllexport

I’m experienced with C# but pretty new to C++ I made a C++ library for getting/setting system volume which I use in C# for displaying volume in the tasktray as a numerical value and adjusting volume with scrollwheel on taskbar. dllmain.cpp: #include "pch.h"; #define DLLExport __declspec(dllexport) extern "C" { IAudioEndpointVolume* GetEndpointVolume() { HRESULT hr; IMMDeviceEnumerator* ..

Read more

As a result, it turned out to pass through int [], with char[] it doesn’t work: dll: file string_emplary.cpp #include "pch.h" #include "string_emplary.h" #include <iostream> #include <string> void FillArrayInt(int a[], int n) { const char* b = &"Emplary"[0]; for (size_t i = 0; i < n; i++) { a[i] = b[i]; } } void bool_input(char ..

Read more

I am currently attempting to rebuild and update a Project written in Rust (more specifically it’s an SKSE64 plugin for Skyrim: https://github.com/lukasaldersley/sse-mod-skyrim-search-se forked from qbx2) The last problem I’m facing is the library now requires a struct to be exported from our library for version checking. I have attempted many probably stupid ways to implement ..

Read more

I am having trouble marshalling data between a C# Unity 2D application and an existing C++ DLL. // ============================================================================ // "General Output" Function (GPO) // ============================================================================ bool _GetFPGAOCount(unsigned char *ucCount); bool _SetFPGAOIdx(unsigned long uIdx, bool bFlag); bool _SetFPGAOAll(bool bFlag); bool _SetFPGAOutput(unsigned long ulData1,unsigned long ulData2); bool _GetFPGAOIdx(unsigned long uIdx, bool *bFlag); bool _GetFPGAOutput(unsigned long* ulData1,unsigned ..

Read more

I am having trouble marshalling data between a C# Unity 2D application and an existing C++ DLL. // ============================================================================ // "General Output" Function (GPO) // ============================================================================ bool _GetFPGAOCount(unsigned char *ucCount); bool _SetFPGAOIdx(unsigned long uIdx, bool bFlag); bool _SetFPGAOAll(bool bFlag); bool _SetFPGAOutput(unsigned long ulData1,unsigned long ulData2); bool _GetFPGAOIdx(unsigned long uIdx, bool *bFlag); bool _GetFPGAOutput(unsigned long* ulData1,unsigned ..

Read more

In MSVC, When I write a class with a std::unordered_map member like below, class DLLEXPORT TTT { std::unordered_map<int, int> _map; }; a C4251 warning is given: warning C4251: ‘TTT::_map’ : class ‘std::unordered_map<_Kty,_Ty>’ needs to have dll-interface to be used by clients of class ‘TTT’ … where DLLEXPORT macro is in normal pattern, which is expand ..

Read more