I have the following problem if referencing a COM assembly from a C#
program.
The method GetImageFrame declared as
HRESULT GetImageFrame([in] long capDeviceIndex, [out] ULONG *pSize,
[out, size_is(,*pSize)] BYTE **ppImageBuf); in the COM IDL
is displayed as GetImageFrame(int, out uint, System.IntPtr)
I expected it to be GetImageFrame(int, out uint, out System.IntPtr)
I tried changing the IL code (using ildasm, changing the fn
declaration) and using ilasm to create the new assembly). I marked the
[out] native int ppImageBuf,
as [out] native int& ppImageBuf,
However, I do not see the changes in the function declaration after
referencing the new assembly.
Does someone have a clue?
Regards,
SK
Mattias Sjögren - 10 Apr 2006 21:31 GMT
>However, I do not see the changes in the function declaration after
>referencing the new assembly.
>
>Does someone have a clue?
Did you change all occurances of the signature? It may appear more
than once.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
sanjeev@securlinx.com - 11 Apr 2006 03:16 GMT
Yes, there are two occurances and I change both of them. I use the
ilasm tool to create the assembly.
The (Client) project is now referencing the old and new assembly. THe
new assembly however does not reflect the modified signatures.
SK
sanjeev@securlinx.com - 21 Apr 2006 17:21 GMT
> Yes, there are two occurances and I change both of them. I use the
> ilasm tool to create the assembly.
[quoted text clipped - 3 lines]
>
> SK
I corrected the problem that I had reported earlier. As I mentioned do
the following -
Change the IL code (using ildasm, changing the fn declaration) I
changed the
[out] native int ppImageBuf, TO
[out] native int& ppImageBuf,
Use ilasm to create a new assembly. Now in your .NET client project
refer to this new assembly after removing the reference to the old
assembly. (Because I had not removed to the reference to the old
assembly, I was still seeing it in the object browser and not the
changes I had expected to.)
SK