Re: Calling C# COM from C (not C++)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



As I already stated....C++ is not an option. The C code uses a third-part
compiler for interfacing with certain electronic devices. After searching
the Internet, I think the answer about interfacing with COM with C is a huge
huge huge pain!

Amil

"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:#L9qCxyRFHA.3096@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Amil" <AmilHanish@xxxxxxxxxxx> wrote in message
> news:%239a3MWpRFHA.2736@xxxxxxxxxxxxxxxxxxxxxxx
> >I have a managed C# COM object that I currently use fine with an ASP web
> > page. I want to call it from a legacy piece of C code. Does anyone
have
> > a
> > REAL example of how to call CoInitialize, CoCreateInstance, etc from C
> > (not
> > C++)? Any info on how to generate .h files from c# would be great.
> > Thanks.
> >
> > Amil
> >
> >
>
> Why not C++, Do you have a language issue or a compiler issue?.
> VC++ has an option to import a tlb file (f.i created by regasm.exe) and
> create the interface headers.
> You will have a hard time to create the header files by hand.
>
> Willy.
>
>


.



Relevant Pages

  • Re: Which lean C compiler for 32-bit OS development
    ... is a better fit than your analogy suggests - but it's not perfect. ... the calling conventions of the C compiler I choose. ... with my preferred assembler, Nasm and 2) such a course wouldn't remove ... design is stable I will look at interfacing to HLLs and compilers. ...
    (comp.lang.c)
  • Re: BLAS: dgemm
    ... But since you were relying on pre-F90 style 'implicit interfacing', ... your compiler could not tell you in advance that there was a problem. ... BLAS: http://www.netlib.org/blas/ ...
    (comp.lang.fortran)
  • Re: Ada array vs C pointer (call by reference)
    ... depends on compiler implementation. ... (which I am interfacing with) ... unknown switches and the author cannot be contacted. ... certainly no language requirement that the Ada compiler go delve into ...
    (comp.lang.ada)
  • Re: What I Think Delphi Needs to Do to Survive
    ... than just emitting machine code- there's also DLL's, import libraries, ... and interfacing to the Windows and the Windows Debug Kernel. ... Please recall that I only have to show that the compiler is a sufficiently important part of the mix, to make your initial analogy void. ...
    (borland.public.delphi.non-technical)