By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

convert idl to c# or tlb

P: n/a
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

Nov 8 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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/de...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" <ve*************@gmail.coma écrit dans le message de news:
11**********************@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

Nov 8 '06 #2

P: n/a
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/de...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" <ve*************@gmail.coma écrit dans le message de news:
11**********************@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
Nov 8 '06 #3

P: n/a
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" <ve*************@gmail.coma écrit dans le message de news:
11*********************@k70g2000cwa.googlegroups.c om...
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/de...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" <ve*************@gmail.coma écrit dans le message de news:
11**********************@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

Nov 8 '06 #4

P: n/a
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" <ve*************@gmail.coma écrit dans le message de news:
11*********************@k70g2000cwa.googlegroups.c om...
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/de...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" <ve*************@gmail.coma écrit dans le message de news:
11**********************@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
>
Nov 8 '06 #5

P: n/a
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" <ve*************@gmail.coma écrit dans le message de news:
11*********************@m73g2000cwd.googlegroups.c om...
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" <ve*************@gmail.coma écrit dans le message de news:
11*********************@k70g2000cwa.googlegroups.c om...
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/de...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" <ve*************@gmail.coma écrit dans le message de news:
11**********************@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
>

Nov 8 '06 #6

P: n/a
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:
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 couldbe
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" <ve*************@gmail.coma écrit dans le message de news:
11*********************@m73g2000cwd.googlegroups.c om...
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" <ve*************@gmail.coma écrit dans le message de news:
11*********************@k70g2000cwa.googlegroups.c om...
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/de...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" <ve*************@gmail.coma écrit dans le message de news:
11**********************@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 knowif
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 everythingis
ok! What can i do?
thanks in advance
Nov 8 '06 #7

P: n/a
>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/archiv...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.
Nov 8 '06 #8

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

Mattias Sjögren ha scritto:
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/archiv...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.
Nov 8 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.