***
I posted this in the interop newsgroup, but I'm not sure
if it'd get answered there. I didn't want to cross post
and possible bug everyone, so sorry if I made a faux-paus.
***
I'm writing a .NET component to expose to COM and I'm trying to emulate
an existing COM interface from a previous product.
Basically, the current COM allows for something like this (in VB6):
bizObj("title") = "foo"
bizObj has a default property Fields which returns an AdoField20
object which has a default property Value. So you can see that it
cascades down the tree, basically.
I'm almost there, but the problem is, tlbexp and/or regasm /tlb don't
properly handle default indexers that return a reference type.
What I need is this (in IDL):
[id(0x00000000), propput]
HRESULT Item( [in] VARIANT index, [in] VARIANT value);
But Tlbexp spits out:
[id(0x00000000), propputref]
HRESULT Item( [in] VARIANT index, [in] VARIANT pRetVal);
The propputref is what's killing me, I'm pretty sure, instead of a
propput.
I read somewhere a post by an MS employee basically saying that this
is the case and you're SOL.
Has anyone come up with any type of clever way around this?
Is there a go-nuclear option like manipulating the IDL manually
or something if I'm willing to throw my hands up?
This doesn't have to be super elegant, just as long as it works.
It's legacy support code, so it'll be going away in a couple years
and won't be maintained (it's an EOL product out of the gate).
I've used oleview to decompile the IDL, modify it, MIDL it, then
regtlb it but things just go downhill quick. It seems that it's also
a problem with the CCW.
Can I do some custom marshalling wizardry or something?
Please help!
Thanks,
-Chad