Re: Using an OCX class from a non-MFC, non-GUI app?
A. W. Dunstan <no@spam.thanks> wrote:
Is it possible to call methods in a class provided in an OCX from a
non-MFC, non-GUI application?
Short answer: yes.
Some controls will let you use them like a regular non-visual COM object =
- just create one and start calling its methods. Others insist on being =
properly hosted (otherwise any method call fails). Still, you can host =
these on a hidden window.
I'd like to keep the code as portable as possible, too. While this
device (or at least it's software) only works under Windows, if we go
with a different camera all the rest of the code would run on Linux
just fine.
So, define your own Camera class with a generic interface, then =
implement it as needed for different cameras.
I tried listing the .ocx file as one of the "Additional Dependencies"
for the linker
That's not how you use COM components. There are probably hundreds of =
COM tutorials just one Google search away.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925