I would like to convert my .NET class .dll file into com component, so that
other people can use it from asp or vb6.0.
Any tutorial how to do this?
regards,
Guoqi Zheng
there are many pitfalls waiting but it can be done.
steps:
1. make sure that your public classes implement public interfaces
(interfaces are required for proper COM Interop).
2. add GuidAttribute() to classes and interfaces (you do not want to have a
new guid everytime you recompile your .NET code)
3. add a strong signature to the library (produce it with sn.exe -k, put the
file name into AssemblyKeyFile attribute) (required to register the library
in GAC)
4. add the library to the GAC (gacutil.exe)
5. register the library for COM interop with regasm.exe
all public types from your library are now registered for COM Interop but
you cannot add a reference to the library in vb6 because the file is still
..NET library.
6. use tlbexp to export your types to *.tlb file with tlbexp.exe.
7. add a reference to the tlb file in your vb6 project.
regards,
Wiktor Zychla