[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

OLE - early binding without library file ?

Hi all,
1. I am developing an MFC application and need to use an OLE Automation Server, that was written using OWL (Borland C++). The problem is that I do not have any .tlb, .dll, .odl files, or something like that. All I got is the .exe file of the server.
Can I still use it with early binding using MFC wizard?
I am quite a beginner in this area, so excuse me if I use incorrect keywords or mix-up something.
2. Assuming I will get the C++ sources of the server, how do I export a type-library or some equivalent to be used later with the MFC (for example by "adding new class from a type library" in the Class Wizard) ?

thanks,
    Dagan
0
dagan
Asked:
dagan
  • 3
  • 3
1 Solution
 
chensuCommented:
Simply use CoCreateInstance to get the interfaces and call the methods.
0
 
daganAuthor Commented:
Thanks, but if I get it right CoCreateInstance() does not allow early binding. I want to create my own wrapping class to hide all the calls to the OLE server (the InvokeHelper(..) calls).
Actually I found out how to create a type library from Borland (you simply compile it with -typelib flag), but it caused some compatibility problems.
That's because the MFC Wizard (I think) didn't recognize all var types defined in the server (especially the BYTE) and did not create a wrapping method to many of the functions.
So it's basically a Borland vs MFC question:

How should I let the MFC Wizard add a class from a type-library (*.olb) defined in Borland C, while using ALL var types?

(was that clear?)
0
 
chensuCommented:
Using IDispatch is late binding. Using other interfaces directly is early binding. InvokeHelper uses IDispatch.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
daganAuthor Commented:
ehmm...
I guess I should learn a little more about that subject. Anyway I am over that. What leaves me with the question of creating a .olb file from Borland C, which will be fully understood by MFC Wizard.
Meanwhile I'll do some job by hand using Cut&Paste technologies to complete the missing funcs...
0
 
daganAuthor Commented:
chensu, please propose an answer...
0
 
chensuCommented:
Thank you.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now