CF 2.0 using interop with DCOM

  • Thread starter Thread starter troy anderson
  • Start date Start date
T

troy anderson

I am trying to be able to create a DCOM interface and invoke a method within
Compact Framework 2.0. I am able to create the coclass. However, I keep
getting error 80004002 when I invoke any method or property on my DCOM
interface. I tried this with an inprocess COM interface and it works fine.
What am I missing. BTW, I am using standard OLE data types (BSTR's).

Thanks
 
I figured it out; I needed the proxy/stub DLL. Not sure why; when I tested
the DCOM component with ASP I did not need it in that env.

This leads to another question. VS2005 MIDL compiler does not generate any
usable proxy/stub code nor project. When I try to use the _p.c and
dlldata.c files I get a lot of hard to understand errors; I set the common
macro defs and linker settings but I still am unable to build. My solution
was to launch eVC++ 4.0 and compile the IDL of my VS2005, take the _i.c,
_p.c and dlldata.c files and use the eVC++ 4.0 Readmeps.txt file to setup my
VS2005 proxy/stub project. There has got to be something better.

Does anyone know the compiler and linker settings to get the proxy/stub code
generated by VS2005 MIDL compiler to build correctly?

Thanks.
 
Well I figured out the source of my compile errors when using VS2005 MIDL
compiler to generate the proxy/stub code. For some reason new ATL projects
have this line in .idl file
import "atliface.idl";

This import ends up including a atliface.h file that has causes compilation
errors with .c files. I removed this code and was able to use the
proxy/stub code generated by VS2005.
 
ATL is a C++ template class llibrary so it assumes that all files using
atliface.h will be C++ and not C.
 
I know that... but why does MS ATL wizard import this resource in the IDL
which causes the MIDL compiler generate a _p.c file with this atliface.h?
One would think that the wizard would generate code that works...
 
Back
Top