Home All Groups Group Topic Archive Search About

convert idl to c# or tlb

Author
8 Nov 2006 4:51 PM
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

Author
8 Nov 2006 5:17 PM
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/default.asp?url=/library/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).

--
Patrice

"VeNoM00" <venom.zero.z***@gmail.com> a écrit dans le message de news:
1163004700.613920.156***@k70g2000cwa.googlegroups.com...
Show quoteHide quote
> 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
>
Author
8 Nov 2006 5:42 PM
VeNoM00
no, /newtlb is the default:

/newtlb            Generate new format type libraries (default)

i tried to specify it explitly but nothing...

Patrice wrote:

Show quoteHide quote
> 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/default.asp?url=/library/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).
>
> --
> Patrice
>
> "VeNoM00" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> 1163004700.613920.156***@k70g2000cwa.googlegroups.com...
> > 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
> >
Author
8 Nov 2006 5:53 PM
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" <venom.zero.z***@gmail.com> a écrit dans le message de news:
1163007729.369453.24***@k70g2000cwa.googlegroups.com...
no, /newtlb is the default:

/newtlb            Generate new format type libraries (default)

i tried to specify it explitly but nothing...

Patrice wrote:

Show quoteHide quote
> 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/default.asp?url=/library/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).
>
> --
> Patrice
>
> "VeNoM00" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> 1163004700.613920.156***@k70g2000cwa.googlegroups.com...
> > 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
> >
Author
8 Nov 2006 6:09 PM
VeNoM00
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

Patrice wrote:

Show quoteHide quote
> 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" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> 1163007729.369453.24***@k70g2000cwa.googlegroups.com...
> no, /newtlb is the default:
>
> /newtlb            Generate new format type libraries (default)
>
> i tried to specify it explitly but nothing...
>
> Patrice wrote:
>
> > 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/default.asp?url=/library/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).
> >
> > --
> > Patrice
> >
> > "VeNoM00" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> > 1163004700.613920.156***@k70g2000cwa.googlegroups.com...
> > > 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
> > >
Author
8 Nov 2006 6:26 PM
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" <venom.zero.z***@gmail.com> a écrit dans le message de news:
1163009344.620565.36***@m73g2000cwd.googlegroups.com...
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

Patrice wrote:

Show quoteHide quote
> 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" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> 1163007729.369453.24***@k70g2000cwa.googlegroups.com...
> no, /newtlb is the default:
>
> /newtlb            Generate new format type libraries (default)
>
> i tried to specify it explitly but nothing...
>
> Patrice wrote:
>
> > 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/default.asp?url=/library/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).
> >
> > --
> > Patrice
> >
> > "VeNoM00" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> > 1163004700.613920.156***@k70g2000cwa.googlegroups.com...
> > > 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
> > >
Author
8 Nov 2006 6:39 PM
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:

Show quoteHide quote
> 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" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> 1163009344.620565.36***@m73g2000cwd.googlegroups.com...
> 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
>
> Patrice wrote:
>
> > 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" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> > 1163007729.369453.24***@k70g2000cwa.googlegroups.com...
> > no, /newtlb is the default:
> >
> > /newtlb            Generate new format type libraries (default)
> >
> > i tried to specify it explitly but nothing...
> >
> > Patrice wrote:
> >
> > > 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/default.asp?url=/library/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).
> > >
> > > --
> > > Patrice
> > >
> > > "VeNoM00" <venom.zero.z***@gmail.com> a écrit dans le message de news:
> > > 1163004700.613920.156***@k70g2000cwa.googlegroups.com...
> > > > 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
> > > >
Author
8 Nov 2006 7:29 PM
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

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
8 Nov 2006 8:39 PM
VeNoM00
That's not a problem: i'm creating a browser. This mime filter will
affect just my process

Mattias Sjögren ha scritto:

Show quoteHide quote
> >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
>
> --
> Mattias Sjögren [C# MVP]  mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.