Cannot generate TLB file from IDL file to build interop assembly.

B

Ben Rush

Hello world,

I want to make a *.tlb file from a *.idl file so that I can generate
an interop assembly, but I failing. I have the exact same problem as
laid out by the thread:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=e4644bc9d34d9f6e&rnum=24

I want to generate a *.tlb file from a *.idl file, but no *.tlb file
is generated (only corresponding *.c and *.h files). In fact, I'm
using the same *.idl file as discussed in this thread:
downloadmgr.idl.

The comment by the MVP in the thread, where he says he's able to make
the *.tlb file has made this all the more frustrating for me.

Does anyone out there have any experience with this situation? Did
this situation get solved?

It's really quite a frustrating situation; thanks in advance,

Ben
 
R

Rob Teixeira [MVP]

If you have VC installed with VS, then use the .NET command prompt from the
Tools menu in your windows Start menu. This should open a command window
that has the proper paths set so midl can find the dlls it needs, and the C
linker.
Otherwise, you can just copy those files to the same directory as midl and
run from there.

-Rob Teixeira [MVP]
 
B

Ben Rush

Yup, I've already done that numerous times. Example -

=========================================================================
E:\Program Files\Microsoft SDK\include>dir downloadmgr*
Volume in drive E is DATA
Volume Serial Number is D1D8-CFB9

Directory of E:\Program Files\Microsoft SDK\include

01/22/2004 12:12 2,753 downloadmgr.idl
1 File(s) 2,753 bytes
0 Dir(s) 8,564,387,840 bytes free

E:\Program Files\Microsoft SDK\include>midl /tlb downloadmgr.tlb
downloadmgr.idl

Microsoft (R) 32b/64b MIDL Compiler Version 6.00.0361
Copyright (c) Microsoft Corporation 1991-2002. All rights reserved.
Processing .\downloadmgr.idl
downloadmgr.idl
Processing .\unknwn.idl
unknwn.idl
Processing .\wtypes.idl
wtypes.idl
Processing .\basetsd.h
basetsd.h
Processing .\guiddef.h
guiddef.h
Processing .\ocidl.idl
ocidl.idl
Processing .\oleidl.idl
oleidl.idl
Processing .\objidl.idl
objidl.idl
Processing .\oaidl.idl
oaidl.idl
Processing .\servprov.idl
servprov.idl
Processing .\urlmon.idl
urlmon.idl
Processing .\msxml.idl
msxml.idl
Processing .\oaidl.acf
oaidl.acf
Processing .\ocidl.acf
ocidl.acf
64 bit Processing .\downloadmgr.idl
downloadmgr.idl
64 bit Processing .\unknwn.idl
unknwn.idl
64 bit Processing .\wtypes.idl
wtypes.idl
64 bit Processing .\basetsd.h
basetsd.h
64 bit Processing .\guiddef.h
guiddef.h
64 bit Processing .\ocidl.idl
ocidl.idl
64 bit Processing .\oleidl.idl
oleidl.idl
64 bit Processing .\objidl.idl
objidl.idl
64 bit Processing .\oaidl.idl
oaidl.idl
64 bit Processing .\servprov.idl
servprov.idl
64 bit Processing .\urlmon.idl
urlmon.idl
64 bit Processing .\msxml.idl
msxml.idl
64 bit Processing .\oaidl.acf
oaidl.acf
64 bit Processing .\ocidl.acf
ocidl.acf

E:\Program Files\Microsoft SDK\include>dir downloadmgr*
Volume in drive E is DATA
Volume Serial Number is D1D8-CFB9

Directory of E:\Program Files\Microsoft SDK\include

01/24/2004 17:22 6,191 downloadmgr.h
01/22/2004 12:12 2,753 downloadmgr.idl
01/24/2004 17:22 3,648 downloadmgr_i.c
01/24/2004 17:22 9,031 downloadmgr_p.c
4 File(s) 21,623 bytes
0 Dir(s) 8,564,363,264 bytes free

E:\Program Files\Microsoft SDK\include>

=========================================================================

And this was done from the visual studio command prompt by going to Start >
All Programs > Microsoft Visual Studio .Net 2003 > Visual Studio.Net Tools

I have installed the IE 6.0 SDK as well as the Microsoft Core and Internet
Development SDKs. I had heard somewhere that if the .idl file doesn't have a
library statement in it, then a .tlb file won't get generated. The
definition of the downloadmgr.idl, as I have it, is -

//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright 1995-2000 Microsoft Corporation. All Rights Reserved.
//
//--------------------------------------------------------------------------

cpp_quote("//=--------------------------------------------------------------
------------=")
cpp_quote("// downloadmgr.h")
cpp_quote("//=--------------------------------------------------------------
------------=")
cpp_quote("// (C) Copyright 2000 Microsoft Corporation. All Rights
Reserved.")
cpp_quote("//")
cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT
WARRANTY OF")
cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
LIMITED TO")
cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
A")
cpp_quote("// PARTICULAR PURPOSE.")
cpp_quote("//=--------------------------------------------------------------
------------=")
cpp_quote("")
cpp_quote("#pragma comment(lib,\"uuid.lib\")")
cpp_quote("")
cpp_quote("//---------------------------------------------------------------
------------=")
cpp_quote("// Internet Explorer Download Manager Interfaces")
cpp_quote("")
cpp_quote("// --------------------------------------------------------------
------------------")
cpp_quote("// GUIDS")
cpp_quote("// --------------------------------------------------------------
------------------")
cpp_quote("// {988934A4-064B-11D3-BB80-00104B35E7F9}")
cpp_quote("DEFINE_GUID(IID_IDownloadManager, 0x988934a4, 0x064b, 0x11d3,
0xbb, 0x80, 0x0, 0x10, 0x4b, 0x35, 0xe7, 0xf9);")
cpp_quote("#define SID_SDownloadManager IID_IDownloadManager")

#ifndef DO_NO_IMPORTS
import "unknwn.idl";
import "ocidl.idl";
import "oleidl.idl";
import "oaidl.idl";
#endif

interface IDownloadManager;
[
helpstring("IDownloadManager interface"),
object,
uuid(988934A4-064B-11D3-BB80-00104B35E7F9), // IID_IDownloadManager
pointer_default(unique),
local
]
interface IDownloadManager : IUnknown
{
HRESULT Download(
[in] IMoniker *pmk, // Identifies the object to be
downloaded
[in] IBindCtx *pbc, // Stores information used by the
moniker to bind
[in] DWORD dwBindVerb, // The action to be performed during the
bind
[in] LONG grfBINDF, // Determines the use of URL encoding
during the bind
[in] BINDINFO *pBindInfo, // Used to implement
IBindStatusCallback::GetBindInfo
[in] LPCOLESTR pszHeaders, // Additional headers to use with
IHttpNegotiate
[in] LPCOLESTR pszRedir, // The URL that the moniker is
redirected to
[in] UINT uiCP // The code page of the object's display
name
);
};

Thanks for your response, though.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top