Hello,
I've a ATL Project and try to generate a Interop Solution to use c++ Code in c#.
Solong i create an .idl Class which generate a header and codefile. In the PrinterKernel.idl i have to use an include of ljtypes.h which contains a lot of definitions (typedef enum, typedef struct).
This file is also included in other files.
I Also create an simple ATL Object with the wizard LJRip.
Here I get 8 compile errors:
PrinterKernel.cpp
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(93): error C2371: 'va_list' : redefinition; different basic types
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\vadefs.h(57) : see declaration of 'va_list'
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(141): error C2011: 'localeinfo_struct' : 'struct' type redefinition
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\crtdefs.h(2008) : see declaration of 'localeinfo_struct'
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(149): error C2011: 'localerefcount' : 'struct' type redefinition
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\crtdefs.h(2014) : see declaration of 'localerefcount'
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(157): error C2011: 'threadlocaleinfostruct' : 'struct' type redefinition
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\crtdefs.h(2021) : see declaration of 'threadlocaleinfostruct'
1> niosthread.cpp
1> LJRip.cpp
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(93): error C2371: 'va_list' : redefinition; different basic types
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\vadefs.h(57) : see declaration of 'va_list'
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(141): error C2011: 'localeinfo_struct' : 'struct' type redefinition
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\crtdefs.h(2008) : see declaration of 'localeinfo_struct'
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(149): error C2011: 'localerefcount' : 'struct' type redefinition
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\crtdefs.h(2014) : see declaration of 'localerefcount'
1>e:\projektevisualstudio2013\e62_tunk\fep\ljetfuture\printerkernel\PrinterKernel.h(157): error C2011: 'threadlocaleinfostruct' : 'struct' type redefinition
1> C:\Program Files (x86)\Windows CE Tools\SDKs\SDK ATL\sdk\crt\Include\crtdefs.h(2021) : see declaration of 'threadlocaleinfostruct'
PrinterKernel.idl:
- import "oaidl.idl";
- import "ocidl.idl";
- import "atliface.idl";
- #include "ljtypes.h"
- [
- object,
- uuid(9EA558BB-E8CE-4584-BC5C-3D1B6FAFC104),
- dual,
- nonextensible,
- helpstring("ILJRip Interface"),
- pointer_default(unique)
- ]
- interface ILJRip : IDispatch{
- [id(1), helpstring("method GetObjData")] HRESULT GetObjData([out, retval] lj_object_struct* ObjectData);
commemo.h:
- #ifndef COMMEMO_H
- #define COMMEMO_H
- //-----------------------------------------------------------------------------
- #include <windows.h>
- #include <stdafx.h>
- #include "baselib.h"
- #include "ConstantDefinitions.h"
- #include "ripbase.h"
- #include "atlstr.h"
- #include <vector>
- #include <queue>
- #include <string>
- #include <stdio.h>
- #include "ljtypes.h" // <-- Receive 8 Errors
- //#include "PrinterKernel.h" // <-- Receive 24 Fehler ???
LJRip.h:
- #ifndef LJRIP_H
- #define LJRIP_H
- #pragma once
- #ifdef STANDARDSHELL_UI_MODEL
- #include "resource.h"
- #endif
- #ifdef POCKETPC2003_UI_MODEL
- #include "resourceppc.h"
- #endif
- #ifdef SMARTPHONE2003_UI_MODEL
- #include "resourcesp.h"
- #endif
- #ifdef AYGSHELL_UI_MODEL
- #include "resourceayg.h"
- #endif
- #include "PrinterKernel.h"
- //#include "ljtypes.h"
But all headers are "locked" with an #ifndef LJTYPES_H #define LJTYPES_H.
I hope, i give enough informations
Can anybody give me some help?