Hi,
i want to write a DLL which is called from MS Access (VBA)or MS Excel (VBA).
First i place a class with public and private member. Next i place a second class with... Then i define simple Functions (not class related) to call from outside (VBA).
My Problem is if those functions will be called there is no information to what kind of class functions they will invoke to get data or other stuff (Not visible from the "VBA" point of view.
My questions:
Every Function call from outside has to create the class within the dll do some stuff and collect the data and destroy the class. I think this is an overhead.
To create functions "CreateOSInfo" which creates the COSInfo (c++) is error prone cause nobody knows what kind of function is related to one class.
Should i creates classes and if so how do i get this done...
...
class COSInfo {
public:
COSInfo(void);
~COSInfo();
//member section started
private:
const char* m_OsNames[MAX_OS_NAMES];
const char* m_FkNames[MAX_FK_NAMES];
const char* OSVersionString;
public:
void OSVersion();
long OSVersionLength();
};
class XXXY{
};
class ZZZA{
};
COSInfo* OSInfo = NULL;
extern "C" ACCSYSTEM32_API void __stdcall CreateOSInfoInstance(void);
extern "C" ACCSYSTEM32_API void __stdcall Release(void);
extern "C" ACCSYSTEM32_API void __stdcall RealOSVersionA(LPSTR lpOsVersion, int nMaxCount);
extern "C" ACCSYSTEM32_API void __stdcall RealOSVersionW(LPWSTR lpOsVersion, int nMaxCount);
|
Explanation:
RealOSVersionA belongs to "COSInfo". So what if func1, func2 belongs to COSInfo". Do i have to put "If (OSInfo != NULL) OSInfo = new COSInfo();
in every exported function which runs internally COSInfo?
And func2, func5, which belongs to class XXXY and func11, func12 which belongs to class ZZZA. From the VBA point of view i have no idea which exported function runs which class. So i thinks forget this class stuff and do it without classes.
Greetz
Franky