Multiple import
-
Hi all, I have a question on multiple import. The following describe my scenerio: I have first created a dll, which contains a COM object with the following idl: interface A : public IUnknown { HRESULT MethodA(); }; Later, I have created a second dll, which contains a COM object that make use of the first dll. Therefore, in the second dll's idl file, I did the following: import A.dll interface B : public IUnknown { HRESULT MethodB( [in] A* foo ); }; The problem comes when I wrote a client to test out both servers. Since my client needs to create A to pass it to the method in B, I need to include both dlls in my client file: #import A.dll; #import B.dll; void main() { // first create A // then create B // next, pass A into B } The problem arises when I tried to compile the client program. I got a redefinition of A. Does anybody know what I should do? Thanks, Sunny
-
Hi all, I have a question on multiple import. The following describe my scenerio: I have first created a dll, which contains a COM object with the following idl: interface A : public IUnknown { HRESULT MethodA(); }; Later, I have created a second dll, which contains a COM object that make use of the first dll. Therefore, in the second dll's idl file, I did the following: import A.dll interface B : public IUnknown { HRESULT MethodB( [in] A* foo ); }; The problem comes when I wrote a client to test out both servers. Since my client needs to create A to pass it to the method in B, I need to include both dlls in my client file: #import A.dll; #import B.dll; void main() { // first create A // then create B // next, pass A into B } The problem arises when I tried to compile the client program. I got a redefinition of A. Does anybody know what I should do? Thanks, Sunny