COM Expertise needed: COM Callbacks

John Chapman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 27 00:51:26 PDT 2017


On Wednesday, 26 April 2017 at 23:04:53 UTC, Nierjerson wrote:
> On Wednesday, 26 April 2017 at 15:30:37 UTC, John Chapman wrote:
>> On Tuesday, 25 April 2017 at 18:39:56 UTC, Nierjerson wrote:
>>> [...]
>>
>> When you use DISPATCH_PROPERTYPUT you need to set cNamedArgs 
>> and rgdispidNamedArgs like so:
>>
>>   int dispidNamed = DISPID_PROPERTYPUT;
>>   params.cNamedArgs = 1;
>>   params.rgdispidNamedArgs = &dispidNamed;
>>
>> You should also call AddRef on any COM objects you add to your 
>> paramVars array.
>
>
> Did you try this? I tried and same issue. Are you sure the 
> above is required? I'm not using any "named" args so not sure 
> why it should matter?

 From the documentation 
(https://msdn.microsoft.com/en-us/library/windows/desktop/ms221479(v=vs.85).aspx):

"When you use IDispatch::Invoke() with DISPATCH_PROPERTYPUT or 
DISPATCH_PROPERTYPUTREF, you have to specially initialize the 
cNamedArgs and rgdispidNamedArgs elements of your DISPPARAMS 
structure"

Thought it might help.



More information about the Digitalmars-d-learn mailing list