convert idl to c# or tlb

V

VeNoM00

Hi,
i need to use some classes defined inside urlmon.dll, i have its idl
and c++ (.h file) definitions and i need to convert one of them to C#
or to a type library (tlb). i also have urlmon.lib but i don't know if
it could be useful. I tried to use midl.exe to convert idl to tlb but
it dosen't creates any TLB file! just some c++ files like urlmon.h,
urlmon_i.c, dlldata.c and urlmon_p.c. And MIDL says that everything is
ok! What can i do?
thanks in advance
 
P

Patrice

This is just the default for the compiler. If you want a TLB file you'll
need to use the appropriate command line option. Don't remember but from the
doc I believe the /newtlb switch could be enought...

You'll find the MIDL documentation at :
http://msdn.microsoft.com/library/d...en-us/midl/midl/using_the_midl_compiler_2.asp

If it works it could be likely quicker than converting the IDL file to C#
(though the syntax have some similarity and is likely inspired from IDL).
 
V

VeNoM00

no, /newtlb is the default:

/newtlb Generate new format type libraries (default)

i tried to specify it explitly but nothing...
 
P

Patrice

Have you checked also that the IDL files contains a library statement ? I
would try with a simple dummy file to make sure...

Sorry for the poor help but it's been a while since I last used MIDL...

--
Patrice

"VeNoM00" <[email protected]> a écrit dans le message de (e-mail address removed)...
no, /newtlb is the default:

/newtlb Generate new format type libraries (default)

i tried to specify it explitly but nothing...
 
P

Patrice

This is the statement that defines a type library and it seems to be missing
from this IDL file.

Are you use you need a "class" from this file. If a STDAPI call, it could be
simpler after all ;-) to use DllImport to declare the function you need.

You may want also to explain what exactly you are trying to do in case
someone would have an alternate simpler way of doing this than using URLMon.

Good luck.

--
Patrice

"VeNoM00" <[email protected]> a écrit dans le message de (e-mail address removed)...
what's a library statement? how can i add it? if you are interested the
file is urlmon.idl
here's a link to a copy of that file:
http://www.rafb.net/paste/results/7Bb2Gz51.html
 
V

VeNoM00

i need to use the interface IInternteSession and many others... :/ i'm
trying to create a mime filter for ie in c# (actually in vb.net but the
language doesn't matter).

So... you haven't an idea of why midl doesn't work properly?

Patrice ha scritto:
 
M

Mattias Sjögren

i need to use the interface IInternteSession and many others... :/ i'm
trying to create a mime filter for ie in c# (actually in vb.net but the
language doesn't matter).

I wouldn't recommend doing that in managed code. The reason is the
same as for shell extensions. The filter may be loaded into processes
that don't expect managed code to run, or that may already have loaded
an incompatible version of the CLR.

http://blogs.msdn.com/junfeng/archive/2005/11/18/494572.aspx


Mattias
 
V

VeNoM00

That's not a problem: i'm creating a browser. This mime filter will
affect just my process

Mattias Sjögren ha scritto:
 

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