[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    Re: Making MIDL Generate a Type Library
From:       Scott Sanders <ssanders () HOME ! NET>
Date:       1997-10-30 20:37:21
[Download RAW message or body]


Hi Randy,

I know that ATL generated MIDL scripts work in this was (this is what has
been bugging me)... I must be doing something wrong. My version of MIDL is
the latest (from the downloadable platform SDK). To illustrate here is a
glimpse at my MIDL file (the names have been changed to protect the
innocent):

        import "objidl.idl";
        import "urlmon.idl";
        import "wtypes.idl";

        /**** Interfaces ********************************************************/
        [ object, uuid(51694020-93AF-11CF-B80D-444553540000),
pointer_default(unique) ]
        interface IInterface1 : IUnknown
        {
                ...
        };

        typedef IInterface1 *PINTERFACE1;

        [ object, uuid(51694021-93AF-11CF-B80D-444553540000),
pointer_default(unique) ]
        interface IInterface2 : IInterface1
        {
                ...
        };

        typedef IInterface2 *PINTERFACE2;

[ uuid(51694100-93AF-11CF-B80D-444553540000), version(1.0) ]
library ILibrary
{
        importlib("stdole32.tlb");

        interface IInterface1;
        interface IInterface2;
};

----------
If I move each of the interface definitions inside of the library statement a
TLB is generated but proxy/stub generation fails. As it is, the proxy/stub
works but it won't generate a type library.

Scott Sanders
Rasterix, Inc.

On Thursday, October 30, 1997 12:08 PM, Randy Bowen [SMTP:rbowen@AUTOIII.COM]
wrote:
> Scott,
>
> Hmmm...  I just created a new ATL project, pasted the sample bits from my
> email into it, and generated a type library that OLEVIEW reads just fine.
> Could there be something more mundane happening -- e.g., an old version of
> MIDL.  (I'm using version 3.01.76.)
>
> Other than that, I can't think of anything obvious.  (Sorry.)
>
> --Randy
>
> -----Original Message-----
> From: Scott Sanders <ssanders@HOME.NET>
> To: ATL@LISTSERV.MSN.COM <ATL@LISTSERV.MSN.COM>
> Date: Thursday, October 30, 1997 10:56 AM
> Subject: Re: Making MIDL Generate a Type Library
>
>
> >Hi Randy,
> >
> >I do... this does not work for me. All of my interfaces are referenced
> inside
> >of the library statement and no type library is generated.
> >
> >Scott
> >
> >On Thursday, October 30, 1997 9:12 AM, Randy Bowen
> [SMTP:rbowen@AUTOIII.COM]
> >wrote:
> >> Scott,
> >>
> >> To get your interfaces into the type library, you simply need to
> reference
> >> them in the library section.  For example:
> >>
> >> <<<<<<<<<<<<<<<<
> >> import "oaidl.idl";
> >> import "ocidl.idl";
> >>
> >> [ uuid(...), object ]
> >> interface IMyIface : IUnknown
> >> {
> >>      HRESULT DoNothingMuch(void);
> >> }
> >>
> >> [ uuid(...), version(1.0) ]
> >> library MYLIB
> >> {
> >>      importlib("stdole32.tlb");
> >>      importlib("stdole2.tlb");
> >>
> >>      interface IMyIface;
> >> };
> >> >>>>>>>>>>>>>>>>>
> >>
> >> If the structures you've defined are used as parameters in the
> >interface(s),
> >>
> >> they will automatically be included in the type library.  If they are
> >> not
> >> explicitly referenced, you can force their inclusion be typedef'ing an
> >> alias
> >> in the library section.  Modifying the previous example:
> >>
> >> <<<<<<<<<<<<<<<<
> >> import "oaidl.idl";
> >> import "ocidl.idl";
> >>
> >> [ uuid(...), object ]
> >> interface IMyIface : IUnknown
> >> {
> >>      typedef struct _tagMYSTRUCT {
> >>           DWORD dwThis;
> >>           DWORD dwThat;
> >>      } MYSTRUCT;
> >>
> >>      HRESULT DoNothingMuch(void);
> >> }
> >>
> >> [ uuid(...), version(1.0) ]
> >> library MYLIB
> >> {
> >>      importlib("stdole32.tlb");
> >>      importlib("stdole2.tlb");
> >>
> >>      typedef MYSTRUCT LIBMYSTRUCT;
> >>
> >>      interface IMyIface;
> >> };
> >> >>>>>>>>>>>>>>>>>
> >>
> >>
> >> Randy Bowen
> >> Manager, Software Development
> >> Autologic Information International, Inc.
> >> rbowen@autoiii.com
> >>
> >>
> >> -----Original Message-----
> >> From: Scott Sanders <ssanders@HOME.NET>
> >> To: ATL@LISTSERV.MSN.COM <ATL@LISTSERV.MSN.COM>
> >> Date: Wednesday, October 29, 1997 6:23 PM
> >> Subject: Making MIDL Generate a Type Library
> >>
> >>
> >> >Hi,
> >> >
> >> >I'm using ATL to generate several components that all implement some
> >> >common
> >> >custom interfaces. I created a IDL file to define the custom interfaces
> >> >and
> >> >want to use it to generate a type library and proxy stub DLL.
> Originally,
> >> >I
> >> >defined structures and interfaces within the library statement and was
> >> >able
> >> >to generate the type library fine. The proxy/stub would not compile
> >> >this
> >> way,
> >> >however. After searching the documentation and following its advice -
> this
> >> >article in particular: "Generating a Proxy DLL and a Type Library From
> >> >a
> >> >Single IDL File", I moved the interface and structure definitions
> outside
> >> the
> >> >library statement, placing only a group of interface statements inside
> the
> >> >library statement. Now the proxy/stub files are emitted but no type
> >> library.
> >> >Any ideas would be greatly appreciated!
> >> >
> >> >Scott Sanders
> >> >Rasterix, Inc.
> >> >
> >> >P.S. I've seen ATL generate files in this way (with it working).. but
> >> >those
> >> >IDL files have coclass statements.
> >> >
> >> >----------------------------------------------------------------
> >> >Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
> >> >contains important info including how to unsubscribe.  Save time,
> >> >search
> >> >the archives at http://microsoft.ease.lsoft.com/archives/index.html
> >> >
> >>
> >> ----------------------------------------------------------------
> >> Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
> >> contains important info including how to unsubscribe.  Save time, search
> >> the archives at http://microsoft.ease.lsoft.com/archives/index.html
> >
> >----------------------------------------------------------------
> >Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
> >contains important info including how to unsubscribe.  Save time, search
> >the archives at http://microsoft.ease.lsoft.com/archives/index.html
> >
>
> ----------------------------------------------------------------
> Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
> contains important info including how to unsubscribe.  Save time, search
> the archives at http://microsoft.ease.lsoft.com/archives/index.html

----------------------------------------------------------------
Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://microsoft.ease.lsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic