Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / April 2006

Tip: Looking for answers? Try searching our database.

COM InterOp - InterOp assembly marking a char **buffer as System.IntPtr instead of out System.IntPtr

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sanjeev@securlinx.com - 10 Apr 2006 20:32 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.