I've a native C++ DLL that I want to convert into a managed DLL using the C++\CLI mixed-mode feature. I've written some code. The compilation of the DLL is fine, but the compilation of the executable that exploits the DLL fails with the
error C3767 candidate function(s) not accessible
relative to the DLL's function I want to export. The structure of the code is the following
// -- DLL Header managedTest.h
namespace managedTest
{
public ref class managedDLL
{
public:
// -- Native function to export
void SomeFunction(int a, USER-DEFINED TYPE &b);
}
}
// -------------------------------------------------------------------------
// -- DLL cpp file managedTest.cpp
#include "managedTest.h"
void managedTest::managedDLL::SomeFunction(int a, USER-DEFINED TYPE &b)
{
do something;
}
//--------------------------------------------------------------------------
// -- Implementation file that recalls the DLL
using namespace managedTest;
int main(void)
{
managedDLL^ test = gcnew managedDLL;
test->SomeFunction(a, b); // -- Here I have the error!
}
I have read something about the calling of a function across a managed-unmanaged boundary, but I still can't find a solution to this problem. I'm almost sure the problem is related to making public the USER-DEFINED TYPE.
Could someone help me understand what is the problem? Thank you in advance.