A. W. Dunstan
2010-02-12 18:23:09 UTC
Is it possible to call methods in a class provided in an OCX from a non-MFC,
non-GUI application?
I have a console mode app (C++, VS 2008 v9.0, XP SP3) that needs to talk to
some special hardware (an infrared camera). The vendor provides software to
do so, but they've provided it as a .h file and a .ocx file. Unfortunately
it mixes both GUI components and camera communication all in one class. I
don't want to use the GUI part at all - just the camera control methods.
Can this be done? If so, how?
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.
I tried listing the .ocx file as one of the "Additional Dependencies" for
the linker (I put it's directory in the Additional Library Directories, too)
but building the software gives me an error message that says "fatal error
LNK1107: invalid or corrupt file: cannot read at 0x2B8", listing the
offending .ocx as the file in question.
Any ideas? Thanks in advance.
--
Al Dunstan, Software Engineer
OptiMetrics, Inc.
3115 Professional Drive
Ann Arbor, MI 48104-5131
"There are two ways of constructing a software design. One way is to make
it so simple that there are obviously no deficiencies. And the other way
is to make it so complicated that there are no obvious deficiencies."
- C. A. R. Hoare
non-GUI application?
I have a console mode app (C++, VS 2008 v9.0, XP SP3) that needs to talk to
some special hardware (an infrared camera). The vendor provides software to
do so, but they've provided it as a .h file and a .ocx file. Unfortunately
it mixes both GUI components and camera communication all in one class. I
don't want to use the GUI part at all - just the camera control methods.
Can this be done? If so, how?
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.
I tried listing the .ocx file as one of the "Additional Dependencies" for
the linker (I put it's directory in the Additional Library Directories, too)
but building the software gives me an error message that says "fatal error
LNK1107: invalid or corrupt file: cannot read at 0x2B8", listing the
offending .ocx as the file in question.
Any ideas? Thanks in advance.
--
Al Dunstan, Software Engineer
OptiMetrics, Inc.
3115 Professional Drive
Ann Arbor, MI 48104-5131
"There are two ways of constructing a software design. One way is to make
it so simple that there are obviously no deficiencies. And the other way
is to make it so complicated that there are no obvious deficiencies."
- C. A. R. Hoare