It works. Thanks. Basically, I tried with IntPtr and it worked. Now, I
the memory. Is that right?
"Tahir Sultan" wrote:
> 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.
>
>
>
>
>
>
>
> "Mattias Sjögren" wrote:
>
> > Tahir,
> >
> > >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.
> >
> > Well the only other option I can think of is to change the parameter
> > type to an IntPtr and do the copying yourself.
> >
> > But using an array should work if done right.
> >
> >
> > Mattias
> >
> > --
> > Mattias Sjögren [MVP] mattias @ mvps.org
> >
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com > > Please reply only to the newsgroup.