Re: How to import an source interface ? [message #17563 is a reply to message #17562] |
Thu, 28 October 1999 00:00  |
Alexander Nickolov
Messages: 1 Registered: October 1999
|
Junior Member |
|
|
Add a library block for your interface and then importlib() your type
library instead. You don't need to import the IDL in this case, but
you can if you wish - just move the import line to the begining
along with the other imports. Then it might be good idea to have
two IDLs for the interface, the first where you define it and you
import it in your new IDL, and the second where you import the
interface definition only to build a type library from it:
import "oaidl.idl";
import "ocidl.idl";
import "itf.idl"
[...]
library ItfLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
interface IMyItf;
};
--
===============================
Alexander Nickolov, MCSD
Panasonic Technologies Inc.
Speech Technology Laboratory
email: agnickolov@geocities.com
===============================
Michael Pokerschnig wrote in message
<7v9vm5$bnv$1@fleetstreet.Austria.EU.net>...
> Hi,
>
> I want to import an source interface wich I put in a separate .idl file to
> save retyping it all the time i need it.
> The MIDL compiles without any error, but if I look at the generated header
> file I cannot find the imported interface !
>
> why ?
> is there something wrong defined ?
>
> kind regards
> Mike.
>
>
> This is the interface which i put in the file CP.idl as it is my connection
> point:
> ------------------------------------------------------------ --
> [
> object,
> uuid(B6151303-82FA-11d3-8209-00508B03223A),
> ]
> interface ITest : IUnknown
> {
> [helpstring("method GetWidthMM")] HRESULT GetWidthMM([out] double*
> u_pdbWidth);
> };
> ------------------------------------------------------------ -
>
> the I try to import it in my .idl file of the COM object:
>
> ------------------------------------------------------------ -
> import "oaidl.idl";
> import "ocidl.idl";
>
> [
> object,
> uuid(B6151300-82FA-11d3-8209-00508B03223A),
> ]
> interface IFlop : IUnknown
> {
> [id(1), helpstring("method DoUI")] HRESULT DoUI();
> }
>
> [
> uuid(2B6BF8B6-8537-11D3-8209-00508B03223A),
> version(1.0),
> helpstring("Flop 1.0 Type Library")
> ]
> library FLOPLib
> {
> importlib("stdole32.tlb");
> importlib("stdole2.tlb");
>
> import "CP.idl"; // I import it exactly where it was when I first
> created this interface with the wizzard !
>
> [
> uuid(2B6BF8C4-8537-11D3-8209-00508B03223A),
> helpstring("FlopModul Class")
> ]
> coclass FlopModul
> {
> [default] interface IFlop;
> [default, source] interface ITest; // here i use the interface
> imported from CP.idl
> };
> };
> ------------------------------------------------------------ -
>
>
|
|
|