Blog Stats
  • Posts - 45
  • Articles - 0
  • Comments - 16
  • Trackbacks - 20

 

.NET Interop services

I spent the better part of last week trying to figure out how to bring in an old C++ DLL into my .NET code. It was quite surprising to find that most documentation on the net was only regarding bringing in COM components. The remaining documentation seemed to have spawned from one source and pasted over and over again (this has been happening a lot to me lately, i guess it's from diferent sites pulling from the same resource). Anyways, it was fun to figure out how to reference an array of structs containing a byte[] to be imported. Here the trick that makes it work at least for me. 1)The function has to be defined as follows functionname([MarshalAs(UnManagedType.LPArray)][In, Out] Struct[] s) 2)The struct can be defined as Struct s{[MarshalAs(UnManagedType.ByValArray, SizeConst=1000)] public byte[] Data;} It turned out to be pretty easy in the end, the process just hurt though :)

Feedback

# re: .NET Interop services

Gravatar ulle ke pathe kuch aata bhi hai 3/26/2008 12:20 AM | rahul

# игры shooter скачать

Gravatar Великолепно. Стока полезного материала. Тока обновляйтесь больше ) 3/16/2009 9:35 PM | whommofonsush

# re: .NET Interop services

Gravatar .net hoàn toàn quy định. sống lâu interop dịch vụ. dài sống .net 4/17/2009 8:35 AM | Anh Dung

# Заказать мебель в интернете

Gravatar You have very good site!
Amor tussisque non celantur 6/16/2009 5:00 PM | gammamrketua

# Привет!

Gravatar Я смотрю, Вы рекламу охотно используете. Какую партнерку посоветуете для блога? 8/6/2009 9:50 PM | AlexCoreX

Post a comment





 

 

 

Copyright © Rishi Pande