PDA

Click to See Complete Forum and Search --> : How to creat my own .OLB file?


brenaaro
Oct 10th, 2002, 04:02 PM
Can anyone point me to any tips/tutorials/etc that I would need to create my own .OLB file for a VB application? I don't even know what language I would use to write it, though I'm guessing C++...

CornedBee
Oct 11th, 2002, 06:12 AM
Is OLB some kind of type library?
Those would be written in IDL or ODL. (Interface/Object Definitions Language)

jim mcnamara
Oct 11th, 2002, 06:15 AM
Maybe he means an object library. like .so or .lib ?
I don't know about .OLB files except on VAX systems.

brenaaro
Oct 11th, 2002, 07:31 AM
Yes it's apparently a type library.

From MSDN I get:

type library

A file or component within another file that contains standard descriptions of exposed objects, properties, and methods that are available for Automation. Object library files (.olb) contain type libraries.


I'm trying to build one so I can pass a user-defined type from my VB app to an ActiveX dll. I'm assuming that by referencing an object library in both my app and the dll, I won't have a problem.

So about IDL/ODL. What would I use to program/compile it?

CornedBee
Oct 11th, 2002, 07:37 AM
ActiveX DLLs usually have big problems with user-defined types. All parameters to ActiveX are VARIANTs, so they can't contain UDTs.

You write IDL (ODL was replaced by IDL) the same way as any other language: in a text editor. I think VC++ supports syntax highlighting for IDL. You compile it using the MIDL compiler (comes with the platform SDK), it creates a set of C files and headers + a type library.
It might not be easy to replace a given type library. You need to know several inside things about the DLL (such as vtable order, internal objects, dual interface or no, all of them things you would normally not know).

brenaaro
Oct 11th, 2002, 07:44 AM
Hmm , that is true. I do not know that yet. I guess I'll try to find some sort of work around for now.

Thanks for the feedback.

jim mcnamara
Oct 11th, 2002, 09:34 AM
What are you trying to accomplish?

brenaaro
Oct 11th, 2002, 09:42 AM
Well, it's kind of strange.

Several months ago I had created an ActiveX dll, and declared a public user-defined-type in the main class module. But when I wanted my application to pass an object of that UDT to a public function in the DLL, it would not let me.

Now however, I am doing the same thing with a different dll and different application..and it's working.

I had thought it wouldnt work which was why I started this thread..but I just tried it 10 minutes ago and it seems to be working ok (so far)..I must have done something differently now than then..though I'm not sure what that might be..yet.