Does anybody know how to make sure the case doesn't change (regardless of
the method)?
[
object,
uuid(<snip>),
dual,
nonextensible,
pointer_default(unique),
helpstring("Series Definition object.")
]
interface ISeriesDefinition : IPackageDefinition
{
<snip>
[id(202), propget, helpstring("Quantity.")]
HRESULT Quantity([out, retval] int *quantity);
[id(202), propput, helpstring("Quantity.")]
HRESULT Quantity([in] int quantity);
<snip>
]
For technical reasons, TLB file format is physically incapable of
storing two strings that differ only in case. So when there are
conflicts, MIDL compiler has no choice but to pick one capitalization
variant and stick with it throughout.
So, avoid using strings in your IDL that differ only in case - just give
some other name to the parameter.
--
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
Are you saying that you can't have two interfaces in the same tlb with the
same property?
Cam
<snip>
Cam,
No, he's saying that when MIDL sees:
HRESULT Quantity([out, retval] int *quantity);
It will only store the string "Quantity" (the prop name) or the string
"quantity" (the argument name). Your prop name is losing the battle. To
fix your problem, you could use
HRESULT Quantity([out, retval] int *qty);
Craig
I have recently tested it and the issue exists with any string in the TLB
file. Each string is stored once regardless of which interface contains it.
Thus if you have two interfaces that share a string (either as a parameter or
property) they will all share the same capitilazation (Seemingly chosen from
the first encountered string).
I don't know, or care, if this is the way it is intended; however this is
the way I found it to be.
This is precisely my point. TLB file format stores all strings (method
names, interface names, parameter names - all of them) in a hash table
that is case-insensitive but case-preserving. Meaning that it preserves
the case of the string when it is first added to the table, but ignores
the case when looking for existing entries. So when you add a string
that only differs in case from the existing one, you just get back an
existing entry.