how to export an enum type in an ATL prject
-
my code:
class ATL_NO_VTABLE CSysLog :
.....
{
public:
[export]
enum EnumLogLevel
{
LogNone = 0,
LogError = 1,
LogWarning = 2,
LogInfo = 3,
LogDebug = 4,
LogDebug1 = 5,
LogDebug2 = 6,
LogDebug3 = 7,
LogDebug4,
};
......it takes errors likes: c1xx : error C3174: .... LINK : fatal error LNK1250: ... how to correct it?
-
my code:
class ATL_NO_VTABLE CSysLog :
.....
{
public:
[export]
enum EnumLogLevel
{
LogNone = 0,
LogError = 1,
LogWarning = 2,
LogInfo = 3,
LogDebug = 4,
LogDebug1 = 5,
LogDebug2 = 6,
LogDebug3 = 7,
LogDebug4,
};
......it takes errors likes: c1xx : error C3174: .... LINK : fatal error LNK1250: ... how to correct it?
Declare it in IDL e.g.
typedef [v1_enum] enum LogLevel // These are the possible levels of log
{
None = 1,
Error = 2,
Warning = 3
}LogLevel;Use it in an interface parameter if you need to export a method:
interface IMyErrors : IDispatch {
HRESULT GetCurrentError(LogLevel udtLevel,...
...Compile and and export as a type library or .dll or import the IDL into a .h file