>I have already tried this solution but it did not work. What happened was I
>did not get the event at all. I mean the the AddModifyGroupIndication event
>never got fired. It could be that the actual groupList type is a pointer as
>defined on the actual interface and we are not allowed to marshal it to an
>array type. Please suggest any other solution.----Thanks.

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mattias,
I have tried many times but I am not getting AddModifyGroupIndication
event. I did the following changes to Interop.TCSAPILib.il file:
1. .method public hidebysig newslot abstract virtual
instance void AddModifyGroupIndication(
[in] unsigned int32 groupListSize,
[in] valuetype TCSAPILib.groupListStruct& groupList) runtime
managed internalcall
--> Replaced with
.method public hidebysig newslot abstract virtual
instance void AddModifyGroupIndication(
[in] unsigned int32 groupListSize,
[in] valuetype TCSAPILib.groupListStruct[] marshal([])
groupList) runtime managed internalcall
2. .method public virtual instance void
Invoke(
[in] unsigned int32 groupListSize,
[in] valuetype TCSAPILib.groupListStruct& groupList) runtime
managed
---> Replaced with
.method public virtual instance void
Invoke(
[in] unsigned int32 groupListSize,
[in] valuetype TCSAPILib.groupListStruct[] marshal([])
groupList) runtime managed
3. .method public virtual instance void
AddModifyGroupIndication(
unsigned int32 A_1,
valuetype TCSAPILib.groupListStruct& groupList A_2) cil
managed
---> Replaced with
.method public virtual instance void
AddModifyGroupIndication(
unsigned int32 A_1,
valuetype TCSAPILib.groupListStruct[] marshal([])
groupList A_2) cil managed
Then, I generated a new dll from this modified Interop.TCSAPILib.il files,
removed refernce to old dll and added a reference to this newly generated
dll. When, I hooked up this AddModifyGroupIndication event with modifed
parameter, I got the event signature with the following parameters in my C#
code:
uint groupListSize,
TCSAPILib.groupListStruct[] groupList
This event is getting fired by the Com Server but I do not get it. Could
you please identify if I am missing something OR I am doing wrong
modification to the Interop.TCSAPILib.il file.----Thanks.
> Tahir,
>
[quoted text clipped - 10 lines]
>
> Mattias
Tahir Sultan - 21 Sep 2005 16:41 GMT
Mattias,
It works. Thanks. Basically, I tried with IntPtr and it worked. Now, I
think IntPtr points to unmanaged heap and Com server is responsible to free
the memory. Is that right?
Thanks.
> Mattias,
>
[quoted text clipped - 69 lines]
> >
> > Mattias
Mattias Sjögren - 22 Sep 2005 22:18 GMT
>Now, I
>think IntPtr points to unmanaged heap and Com server is responsible to free
>the memory. Is that right?
Yes, since it's an in parameter the caller frees it.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Tahir Sultan - 23 Sep 2005 09:24 GMT
Thanks, Mattias.
> >Now, I
> >think IntPtr points to unmanaged heap and Com server is responsible to free
[quoted text clipped - 3 lines]
>
> Mattias