Good day!
It is required to make ActiveX on c # c using C ++ library. How to do on with # ActiveX on the net many examples of good and different. But I did not find how to make a DLL for use with c # examples.
Using approach # 2, http://www.windows-tech.info/17/b11ab287a75874da.php approach # 2, created the project cppAx Visual C ++ | Win32 | Win32, put check marks DLL and Export symbols. Added a static library header to the project. The following file has been generated.
// cppAx.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include "cppAx.h" #include "MyStatLib.h" // This is an example of an exported variable CPPAX_API int ncppAx=0; // This is an example of an exported function. CPPAX_API int fncppAx(void) { return 42; } // This is the constructor of a class that has been exported. // see cppAx.h for the class definition CcppAx::CcppAx() { return; }
Further it seems to be necessary to declare exported functions from a static library. But I do not know. Even if in this form I compile and try in another project to reference the resulting DLL, I get
A reference to XXX.dLL could not be added. Please make sure you have a valid assembly or COM component.
Thanks in advance for your help!