how to use an interface as a parameter in other atl objects?
-
:( first sorry for my poor english.. i have an "ATL simple object" interface like "IErrSupport" , and i want to use it as a parameter like: (ISomething) DoSomething(...,IErrSupport *pErr); ... (IOtherthing) DoOtherthing(...,IErrSupport *pErr); can anybody give me an example? thanks a lot.
-
:( first sorry for my poor english.. i have an "ATL simple object" interface like "IErrSupport" , and i want to use it as a parameter like: (ISomething) DoSomething(...,IErrSupport *pErr); ... (IOtherthing) DoOtherthing(...,IErrSupport *pErr); can anybody give me an example? thanks a lot.
(IOtherthing) DoOtherthing(...,IErrSupport *pErr);
Assuming that
pErr
points to an object that implementsIErrSupport
then you already have it. -
(IOtherthing) DoOtherthing(...,IErrSupport *pErr);
Assuming that
pErr
points to an object that implementsIErrSupport
then you already have it.i assumed like that ,but i don't know what to do . my step: 1. crete a new atl project, maybe it named TestA. 2. Add a class "A"; 3. IA Add methods like TestErr(IErrSupport *pErr); 4. compiling... .\TestA.idl(19) : error MIDL2025 : syntax error : expecting a type specification near "IErrSupport" .\TestA.idl(19) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation 5. add import "../ErrSupport/ErrSupport.idl"; to TestA.idl ,compiling... d:\errsupport\testa\testa_i.h(69) : fatal error C1083: Cannot open include file: 'ErrSupport.h': No such file or directory
-
i assumed like that ,but i don't know what to do . my step: 1. crete a new atl project, maybe it named TestA. 2. Add a class "A"; 3. IA Add methods like TestErr(IErrSupport *pErr); 4. compiling... .\TestA.idl(19) : error MIDL2025 : syntax error : expecting a type specification near "IErrSupport" .\TestA.idl(19) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation 5. add import "../ErrSupport/ErrSupport.idl"; to TestA.idl ,compiling... d:\errsupport\testa\testa_i.h(69) : fatal error C1083: Cannot open include file: 'ErrSupport.h': No such file or directory
astupidboy wrote:
fatal error C1083: Cannot open include file: 'ErrSupport.h': No such file or directory
That should give you a clue.
-
(IOtherthing) DoOtherthing(...,IErrSupport *pErr);
Assuming that
pErr
points to an object that implementsIErrSupport
then you already have it.any example?:(,i'm too stupid
-
astupidboy wrote:
fatal error C1083: Cannot open include file: 'ErrSupport.h': No such file or directory
That should give you a clue.
but there's no such file ... could you leave your email,and i send the project to you ?
-
but there's no such file ... could you leave your email,and i send the project to you ?
astupidboy wrote:
but there's no such file
Then you need to create it.
astupidboy wrote:
could you leave your email,and i send the project to you ?
Sorry, no, I'm not an ATL expert, and don't have the tools to build it.
-
astupidboy wrote:
but there's no such file
Then you need to create it.
astupidboy wrote:
could you leave your email,and i send the project to you ?
Sorry, no, I'm not an ATL expert, and don't have the tools to build it.
Um,i see ,thank you
-
i assumed like that ,but i don't know what to do . my step: 1. crete a new atl project, maybe it named TestA. 2. Add a class "A"; 3. IA Add methods like TestErr(IErrSupport *pErr); 4. compiling... .\TestA.idl(19) : error MIDL2025 : syntax error : expecting a type specification near "IErrSupport" .\TestA.idl(19) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation 5. add import "../ErrSupport/ErrSupport.idl"; to TestA.idl ,compiling... d:\errsupport\testa\testa_i.h(69) : fatal error C1083: Cannot open include file: 'ErrSupport.h': No such file or directory
You need to include the ErrSupport.idl into your project, so that the TLB and H are created by the MIDL compiler, in order that your import statement works you may need also need to add an importlib in your library block too, if you want to marshal that interface The above is a precis of some comments in some of my code from a few years ago, with the following link, that may provide more help - http://groups.google.com.au/group/microsoft.public.vc.atl/browse_thread/thread/7ca944c27b0288f4/9e1752e6feb4972a?lnk=st&q=import+common+idl#9e1752e6feb4972a[^]