Recently I would like to start building a .dll maths library with Visual C++ Express 2010.
I would like to use the .dll as library reference for BOTH Excel VBA
& C#
applications. I expect it will work in both 32bit/64bit
Window. The .dll should also be able to be used by other PC after build.
Am I correct to start by using Win32 Project? (it seems I cannot use
ATL / MFC
in Express version)Do I need to specify in the .dll 2 different sets of interface for VBA & C# to load functions? (VBA require using __stdcall)
Any deployment settings for using the .dll in other PC? (need any regsvr32 cmd process?)
Any beginner example for making a C++ DLL to export a class? (e.g. VBA / C# can instantiate a new class from this dll) ...
Because I am not sure if I can instantiate ClassA & ClassB in VBA / C# with below .header file in the c++ .dll:
#pragma once
#ifdef DLLDIR_EX
#define DLLDIR __declspec(dllexport) // export DLL information
#else
#define DLLDIR __declspec(dllimport) // import DLL information
#endif
class DLLDIR ClassA
{
public:
void AMethod1();
void AMethod2();
};
class DLLDIR ClassB
{
public:
void BMethodi();
void BMethodii();
};