PC Review


Reply
Thread Tools Rate Thread

ANY COM Interop GURUS out there!? - Nested Structs with arrays of

 
 
=?Utf-8?B?QWFyb24=?=
Guest
Posts: n/a
 
      22nd Oct 2004
I've got a doozie of a problem! I and others have been trying to figure this
out for too long and I've come to the conclusion that I should probably look
for some support..

Ok, I have a COM component written in C++ (I don't have the source just the
binary) and am referencing it from VB. I would say about 99% of the
functionality exposed by this COM component works fine from vb .net but I am
having a problem calling a method which has a parameter that is a struct
defined in the COM component. This struct has a member which is a struct
which contains an array of another struct. When I call the method I receive a
TypeLoadException with very little detail (thats about it) Here is the MSIL
for the structures.. The members who are causing the problems (i am about 99%
sure) are the members that end in "list"

'I have removed all of the members of the following struct who I feel are
defined correctly (i removed about 19 members of this struct). This is done
for the sake of simplicity

..class public sequential ansi sealed beforefieldinit tcsGroupAttributes_t
extends [mscorlib]System.ValueType
{
..pack 4
..size 0
..field public valuetype Nokia.TCSapi.tcsSubscriberAddress_t groupAddress
..field public valuetype Nokia.TCSapi.tcsOrgBlockAttributes2List_t
entryRightsList //THIS GUYS THE PROBLEM! 99% SURE!
} // end of class tcsGroupAttributes_t

' Here is the definition of tcsOrgBlockAttributes2List
..class public sequential ansi sealed beforefieldinit
tcsOrgBlockAttributes2List_t
extends [mscorlib]System.ValueType
{
..pack 2
..size 0
..field public unsigned int16 length
..field public marshal( fixed array [75]) valuetype
Nokia.TCSapi.tcsOrgBlockAttributes2_t[] orgBlockAttributes2List
} // end of class tcsOrgBlockAttributes2List_t

'Here is the definition of tcsOrgBlockAttributes2_t

..class public sequential ansi sealed beforefieldinit tcsOrgBlockAttributes2_t
extends [mscorlib]System.ValueType
{
..pack 2
..size 0
..field public marshal( fixed array [6]) unsigned int16[] orgBlockId
..field public marshal( fixed array [32]) unsigned int8[] orgBlockMnemonic
} // end of class tcsOrgBlockAttributes2_t

Ok, Here is the signature of the method that I am calling
(tcsGroupAttributesMask structure is straightforward and similiar objects
work in other calls so this structure is not the problem. Its the
tcsGroupAttributes)

..method public hidebysig newslot abstract virtual
instance int32 Create([in] valuetype Nokia.TCSapi.tcsGroupAttributes_t&
groupAttributes,
[in] valuetype Nokia.TCSapi.tcsGroupAttributesMask_t& groupAttributesMask,
[in] int16 cookie) runtime managed internalcall
{
}

This is an incredibley difficult problem and much respect to anyone that can
help or solve this. I have googled the ** out of this and have read nearly
every resource out there discussing COM interop. I have tried editing the
disassembled il and setting the member valuetypes to IntPtrs but then I get a
MissingFieldException.. Appreciate any help in advance!

Aaron


 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      22nd Oct 2004
Aaron,

>This struct has a member which is a struct
>which contains an array of another struct.


That's unfortunately not supported by the marshaler. See

http://dotnetinterop.com/faq/?q=StructWithStructArray



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
=?Utf-8?B?QWFyb24=?=
Guest
Posts: n/a
 
      23rd Oct 2004
First of all, thanks for the response Mattias! I notice you consistently
help us problem ridden posters and let me just say we really appreciate the
time you take helping us.

Regarding my issue, I don't have the source code for the COM component so am
unable to change the type definitions for the Struct members. This dll does
not export these methods either, so, if I understand PInvoke correctly, I am
unable to use PInvoke since the method isn't exported. So, knowing what I
know now from the info contained in the link you referred to, if I were able
to flatten the struct members (get rid of array references, which I would
like to do anyways since I am always just passing in 1) this method would
complete S_OK. <- :s

So the question now is, is it possible to _redefine_ a structure which is
declared in the namespace of the COM component? So I would be able to call
'pseudo code
Structure MyNewlyRedefinedGroupAttribute
....
.... ' redefine the array structure to be non-arrays
end structure
Dim myNewlyRedefinedGroupAttributes as MyNewlyRedefinedGroupAttribute

Be able to use my redefined flattened structure without getting
"There is no interface that accepts these parameters
(myapp.MyNewlyRedefinedGroupAttribute, Nokia.TCSapi.tcsGroupAttributesMask_t,
int16)"

Create(myNewlyRedefinedGroupAttributes, groupAttributesMask, cookie)

Is it possible to just edit the IL and reassemble or will I get that
"missingfieldexception"?

Thanks in advance Mattias!

Aaron
"Mattias Sjögren" wrote:

> Aaron,
>
> >This struct has a member which is a struct
> >which contains an array of another struct.

>
> That's unfortunately not supported by the marshaler. See
>
> http://dotnetinterop.com/faq/?q=StructWithStructArray
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
>

 
Reply With Quote
 
=?Utf-8?B?QWFyb24=?=
Guest
Posts: n/a
 
      25th Oct 2004
In other words, how do I go about _flattening_ my structure when I don't have
the source code for the COM component to change the c++ source and do a
recompile. Can I do something with the IL or a switch to the TLBIMP.exe? Any
help appreciated!

"Aaron" wrote:

> First of all, thanks for the response Mattias! I notice you consistently
> help us problem ridden posters and let me just say we really appreciate the
> time you take helping us.
>
> Regarding my issue, I don't have the source code for the COM component so am
> unable to change the type definitions for the Struct members. This dll does
> not export these methods either, so, if I understand PInvoke correctly, I am
> unable to use PInvoke since the method isn't exported. So, knowing what I
> know now from the info contained in the link you referred to, if I were able
> to flatten the struct members (get rid of array references, which I would
> like to do anyways since I am always just passing in 1) this method would
> complete S_OK. <- :s
>
> So the question now is, is it possible to _redefine_ a structure which is
> declared in the namespace of the COM component? So I would be able to call
> 'pseudo code
> Structure MyNewlyRedefinedGroupAttribute
> ...
> ... ' redefine the array structure to be non-arrays
> end structure
> Dim myNewlyRedefinedGroupAttributes as MyNewlyRedefinedGroupAttribute
>
> Be able to use my redefined flattened structure without getting
> "There is no interface that accepts these parameters
> (myapp.MyNewlyRedefinedGroupAttribute, Nokia.TCSapi.tcsGroupAttributesMask_t,
> int16)"
>
> Create(myNewlyRedefinedGroupAttributes, groupAttributesMask, cookie)
>
> Is it possible to just edit the IL and reassemble or will I get that
> "missingfieldexception"?
>
> Thanks in advance Mattias!
>
> Aaron
> "Mattias Sjögren" wrote:
>
> > Aaron,
> >
> > >This struct has a member which is a struct
> > >which contains an array of another struct.

> >
> > That's unfortunately not supported by the marshaler. See
> >
> > http://dotnetinterop.com/faq/?q=StructWithStructArray
> >
> >
> >
> > Mattias
> >
> > --
> > Mattias Sjögren [MVP] mattias @ mvps.org
> > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> > Please reply only to the newsgroup.
> >

 
Reply With Quote
 
=?Utf-8?B?QWFyb24=?=
Guest
Posts: n/a
 
      25th Oct 2004
One last thing.. Does anyone know what the pack and size attributes represnt?

..class public sequential ansi sealed beforefieldinit
tcsOrgBlockAttributes2List_t
extends [mscorlib]System.ValueType
{
.pack 2
.size 0
.field public unsigned int16 length
.field public marshal([ + 0]) valuetype
Nokia.TCSapi.tcsOrgBlockAttributes2_t[] orgBlockAttributes2List
} // end of class tcsOrgBlockAttributes2List_t


In addition, I just want this call to the COM component to work, no matter
how hackey it is. I can make it pretty l8r.

"Aaron" wrote:

> I've got a doozie of a problem! I and others have been trying to figure this
> out for too long and I've come to the conclusion that I should probably look
> for some support..
>
> Ok, I have a COM component written in C++ (I don't have the source just the
> binary) and am referencing it from VB. I would say about 99% of the
> functionality exposed by this COM component works fine from vb .net but I am
> having a problem calling a method which has a parameter that is a struct
> defined in the COM component. This struct has a member which is a struct
> which contains an array of another struct. When I call the method I receive a
> TypeLoadException with very little detail (thats about it) Here is the MSIL
> for the structures.. The members who are causing the problems (i am about 99%
> sure) are the members that end in "list"
>
> 'I have removed all of the members of the following struct who I feel are
> defined correctly (i removed about 19 members of this struct). This is done
> for the sake of simplicity
>
> .class public sequential ansi sealed beforefieldinit tcsGroupAttributes_t
> extends [mscorlib]System.ValueType
> {
> .pack 4
> .size 0
> .field public valuetype Nokia.TCSapi.tcsSubscriberAddress_t groupAddress
> .field public valuetype Nokia.TCSapi.tcsOrgBlockAttributes2List_t
> entryRightsList //THIS GUYS THE PROBLEM! 99% SURE!
> } // end of class tcsGroupAttributes_t
>
> ' Here is the definition of tcsOrgBlockAttributes2List
> .class public sequential ansi sealed beforefieldinit
> tcsOrgBlockAttributes2List_t
> extends [mscorlib]System.ValueType
> {
> .pack 2
> .size 0
> .field public unsigned int16 length
> .field public marshal( fixed array [75]) valuetype
> Nokia.TCSapi.tcsOrgBlockAttributes2_t[] orgBlockAttributes2List
> } // end of class tcsOrgBlockAttributes2List_t
>
> 'Here is the definition of tcsOrgBlockAttributes2_t
>
> .class public sequential ansi sealed beforefieldinit tcsOrgBlockAttributes2_t
> extends [mscorlib]System.ValueType
> {
> .pack 2
> .size 0
> .field public marshal( fixed array [6]) unsigned int16[] orgBlockId
> .field public marshal( fixed array [32]) unsigned int8[] orgBlockMnemonic
> } // end of class tcsOrgBlockAttributes2_t
>
> Ok, Here is the signature of the method that I am calling
> (tcsGroupAttributesMask structure is straightforward and similiar objects
> work in other calls so this structure is not the problem. Its the
> tcsGroupAttributes)
>
> .method public hidebysig newslot abstract virtual
> instance int32 Create([in] valuetype Nokia.TCSapi.tcsGroupAttributes_t&
> groupAttributes,
> [in] valuetype Nokia.TCSapi.tcsGroupAttributesMask_t& groupAttributesMask,
> [in] int16 cookie) runtime managed internalcall
> {
> }
>
> This is an incredibley difficult problem and much respect to anyone that can
> help or solve this. I have googled the ** out of this and have read nearly
> every resource out there discussing COM interop. I have tried editing the
> disassembled il and setting the member valuetypes to IntPtrs but then I get a
> MissingFieldException.. Appreciate any help in advance!
>
> Aaron
>
>

 
Reply With Quote
 
tcarvin
Guest
Posts: n/a
 
      25th Oct 2004
Couldn't you just alter the typelib for your COM component? You can use a tool
like OLE View to extract the type lib from the COM component, which you could
then modify and rebuild. Be forewarned, I haven't tried this specifically.

Tom

"Aaron" <(E-Mail Removed)> wrote in message news:<35BF79D1-1226-4AA4-BEFE-(E-Mail Removed)>...
> In other words, how do I go about _flattening_ my structure when I don't have
> the source code for the COM component to change the c++ source and do a
> recompile. Can I do something with the IL or a switch to the TLBIMP.exe? Any
> help appreciated!
>
> "Aaron" wrote:
>
> > First of all, thanks for the response Mattias! I notice you consistently
> > help us problem ridden posters and let me just say we really appreciate the
> > time you take helping us.
> >
> > Regarding my issue, I don't have the source code for the COM component so am
> > unable to change the type definitions for the Struct members. This dll does
> > not export these methods either, so, if I understand PInvoke correctly, I am
> > unable to use PInvoke since the method isn't exported. So, knowing what I
> > know now from the info contained in the link you referred to, if I were able
> > to flatten the struct members (get rid of array references, which I would
> > like to do anyways since I am always just passing in 1) this method would
> > complete S_OK. <- :s
> >
> > So the question now is, is it possible to _redefine_ a structure which is
> > declared in the namespace of the COM component? So I would be able to call
> > 'pseudo code
> > Structure MyNewlyRedefinedGroupAttribute
> > ...
> > ... ' redefine the array structure to be non-arrays
> > end structure
> > Dim myNewlyRedefinedGroupAttributes as MyNewlyRedefinedGroupAttribute
> >
> > Be able to use my redefined flattened structure without getting
> > "There is no interface that accepts these parameters
> > (myapp.MyNewlyRedefinedGroupAttribute, Nokia.TCSapi.tcsGroupAttributesMask_t,
> > int16)"
> >
> > Create(myNewlyRedefinedGroupAttributes, groupAttributesMask, cookie)
> >
> > Is it possible to just edit the IL and reassemble or will I get that
> > "missingfieldexception"?
> >
> > Thanks in advance Mattias!
> >
> > Aaron
> > "Mattias Sjögren" wrote:
> >
> > > Aaron,
> > >
> > > >This struct has a member which is a struct
> > > >which contains an array of another struct.
> > >
> > > That's unfortunately not supported by the marshaler. See
> > >
> > > http://dotnetinterop.com/faq/?q=StructWithStructArray
> > >
> > >
> > >
> > > Mattias
> > >
> > > --
> > > Mattias Sjögren [MVP] mattias @ mvps.org
> > > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> > > Please reply only to the newsgroup.
> > >

 
Reply With Quote
 
=?Utf-8?B?QWFyb24=?=
Guest
Posts: n/a
 
      25th Oct 2004
> Be forewarned, I haven't tried this specifically.

Hehe, sounds fun, I'll give it a shot!
Thx for the response man.

 
Reply With Quote
 
=?Utf-8?B?QWFyb24=?=
Guest
Posts: n/a
 
      25th Oct 2004
OLEView allowed me to view the types but not edit/rebuild. Any other
suggestions?

I tried editing the IL file, but once I change the field definitions for a
struct, I get a MissingFieldException after reassembling/deploying/running my
app. I tried changing the valuetype myobject[] struct members to pointers
(native int) and thats when I get a *runtime* error of missingFieldException
(although it does compile). Anyways, any other ideas?

"tcarvin" wrote:

> Couldn't you just alter the typelib for your COM component? You can use a tool
> like OLE View to extract the type lib from the COM component, which you could
> then modify and rebuild. Be forewarned, I haven't tried this specifically.
>
> Tom
>
> "Aaron" <(E-Mail Removed)> wrote in message news:<35BF79D1-1226-4AA4-BEFE-(E-Mail Removed)>...
> > In other words, how do I go about _flattening_ my structure when I don't have
> > the source code for the COM component to change the c++ source and do a
> > recompile. Can I do something with the IL or a switch to the TLBIMP.exe? Any
> > help appreciated!
> >
> > "Aaron" wrote:
> >
> > > First of all, thanks for the response Mattias! I notice you consistently
> > > help us problem ridden posters and let me just say we really appreciate the
> > > time you take helping us.
> > >
> > > Regarding my issue, I don't have the source code for the COM component so am
> > > unable to change the type definitions for the Struct members. This dll does
> > > not export these methods either, so, if I understand PInvoke correctly, I am
> > > unable to use PInvoke since the method isn't exported. So, knowing what I
> > > know now from the info contained in the link you referred to, if I were able
> > > to flatten the struct members (get rid of array references, which I would
> > > like to do anyways since I am always just passing in 1) this method would
> > > complete S_OK. <- :s
> > >
> > > So the question now is, is it possible to _redefine_ a structure which is
> > > declared in the namespace of the COM component? So I would be able to call
> > > 'pseudo code
> > > Structure MyNewlyRedefinedGroupAttribute
> > > ...
> > > ... ' redefine the array structure to be non-arrays
> > > end structure
> > > Dim myNewlyRedefinedGroupAttributes as MyNewlyRedefinedGroupAttribute
> > >
> > > Be able to use my redefined flattened structure without getting
> > > "There is no interface that accepts these parameters
> > > (myapp.MyNewlyRedefinedGroupAttribute, Nokia.TCSapi.tcsGroupAttributesMask_t,
> > > int16)"
> > >
> > > Create(myNewlyRedefinedGroupAttributes, groupAttributesMask, cookie)
> > >
> > > Is it possible to just edit the IL and reassemble or will I get that
> > > "missingfieldexception"?
> > >
> > > Thanks in advance Mattias!
> > >
> > > Aaron
> > > "Mattias Sjögren" wrote:
> > >
> > > > Aaron,
> > > >
> > > > >This struct has a member which is a struct
> > > > >which contains an array of another struct.
> > > >
> > > > That's unfortunately not supported by the marshaler. See
> > > >
> > > > http://dotnetinterop.com/faq/?q=StructWithStructArray
> > > >
> > > >
> > > >
> > > > Mattias
> > > >
> > > > --
> > > > Mattias Sjögren [MVP] mattias @ mvps.org
> > > > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> > > > Please reply only to the newsgroup.
> > > >

>

 
Reply With Quote
 
tcarvin
Guest
Posts: n/a
 
      26th Oct 2004
Sorry I wasn't clear. You can use OLE View to capture the IDL source (copy-n-
paste). You can then edit it, and then recompile it using MIDL. It is the
TypeLib that Visual Studio uses to map to the component's signitures. Of
course, you have to be sure to not actually break one of those signitures, just
"bend" it a little. Like flattening your array to let .NET call it. It doesn't
change the actual data layout in memory so the COM component will be none the
wiser.

I hope that helps,
Tom

"Aaron" <(E-Mail Removed)> wrote in message news:<72CFB534-2285-4691-AE36-(E-Mail Removed)>...
> OLEView allowed me to view the types but not edit/rebuild. Any other
> suggestions?
>
> I tried editing the IL file, but once I change the field definitions for a
> struct, I get a MissingFieldException after reassembling/deploying/running my
> app. I tried changing the valuetype myobject[] struct members to pointers
> (native int) and thats when I get a *runtime* error of missingFieldException
> (although it does compile). Anyways, any other ideas?
>
> "tcarvin" wrote:
>
> > Couldn't you just alter the typelib for your COM component? You can use a tool
> > like OLE View to extract the type lib from the COM component, which you could
> > then modify and rebuild. Be forewarned, I haven't tried this specifically.
> >
> > Tom
> >
> > "Aaron" <(E-Mail Removed)> wrote in message news:<35BF79D1-1226-4AA4-BEFE-(E-Mail Removed)>...
> > > In other words, how do I go about _flattening_ my structure when I don't have
> > > the source code for the COM component to change the c++ source and do a
> > > recompile. Can I do something with the IL or a switch to the TLBIMP.exe? Any
> > > help appreciated!
> > >
> > > "Aaron" wrote:
> > >
> > > > First of all, thanks for the response Mattias! I notice you consistently
> > > > help us problem ridden posters and let me just say we really appreciate the
> > > > time you take helping us.
> > > >
> > > > Regarding my issue, I don't have the source code for the COM component so am
> > > > unable to change the type definitions for the Struct members. This dll does
> > > > not export these methods either, so, if I understand PInvoke correctly, I am
> > > > unable to use PInvoke since the method isn't exported. So, knowing what I
> > > > know now from the info contained in the link you referred to, if I were able
> > > > to flatten the struct members (get rid of array references, which I would
> > > > like to do anyways since I am always just passing in 1) this method would
> > > > complete S_OK. <- :s
> > > >
> > > > So the question now is, is it possible to _redefine_ a structure which is
> > > > declared in the namespace of the COM component? So I would be able to call
> > > > 'pseudo code
> > > > Structure MyNewlyRedefinedGroupAttribute
> > > > ...
> > > > ... ' redefine the array structure to be non-arrays
> > > > end structure
> > > > Dim myNewlyRedefinedGroupAttributes as MyNewlyRedefinedGroupAttribute
> > > >
> > > > Be able to use my redefined flattened structure without getting
> > > > "There is no interface that accepts these parameters
> > > > (myapp.MyNewlyRedefinedGroupAttribute, Nokia.TCSapi.tcsGroupAttributesMask_t,
> > > > int16)"
> > > >
> > > > Create(myNewlyRedefinedGroupAttributes, groupAttributesMask, cookie)
> > > >
> > > > Is it possible to just edit the IL and reassemble or will I get that
> > > > "missingfieldexception"?
> > > >
> > > > Thanks in advance Mattias!
> > > >
> > > > Aaron
> > > > "Mattias Sjögren" wrote:
> > > >
> > > > > Aaron,
> > > > >
> > > > > >This struct has a member which is a struct
> > > > > >which contains an array of another struct.
> > > > >
> > > > > That's unfortunately not supported by the marshaler. See
> > > > >
> > > > > http://dotnetinterop.com/faq/?q=StructWithStructArray
> > > > >
> > > > >
> > > > >
> > > > > Mattias
> > > > >
> > > > > --
> > > > > Mattias Sjögren [MVP] mattias @ mvps.org
> > > > > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> > > > > Please reply only to the newsgroup.
> > > > >

> >

 
Reply With Quote
 
=?Utf-8?B?QWFyb24=?=
Guest
Posts: n/a
 
      26th Oct 2004
*gulp* K I'll try it.. *he said with a nervous twitch

<>

"tcarvin" wrote:

> Sorry I wasn't clear. You can use OLE View to capture the IDL source (copy-n-
> paste). You can then edit it, and then recompile it using MIDL. It is the
> TypeLib that Visual Studio uses to map to the component's signitures. Of
> course, you have to be sure to not actually break one of those signitures, just
> "bend" it a little. Like flattening your array to let .NET call it. It doesn't
> change the actual data layout in memory so the COM component will be none the
> wiser.
>
> I hope that helps,
> Tom
>
> "Aaron" <(E-Mail Removed)> wrote in message news:<72CFB534-2285-4691-AE36-(E-Mail Removed)>...
> > OLEView allowed me to view the types but not edit/rebuild. Any other
> > suggestions?
> >
> > I tried editing the IL file, but once I change the field definitions for a
> > struct, I get a MissingFieldException after reassembling/deploying/running my
> > app. I tried changing the valuetype myobject[] struct members to pointers
> > (native int) and thats when I get a *runtime* error of missingFieldException
> > (although it does compile). Anyways, any other ideas?
> >
> > "tcarvin" wrote:
> >
> > > Couldn't you just alter the typelib for your COM component? You can use a tool
> > > like OLE View to extract the type lib from the COM component, which you could
> > > then modify and rebuild. Be forewarned, I haven't tried this specifically.
> > >
> > > Tom
> > >
> > > "Aaron" <(E-Mail Removed)> wrote in message news:<35BF79D1-1226-4AA4-BEFE-(E-Mail Removed)>...
> > > > In other words, how do I go about _flattening_ my structure when I don't have
> > > > the source code for the COM component to change the c++ source and do a
> > > > recompile. Can I do something with the IL or a switch to the TLBIMP.exe? Any
> > > > help appreciated!
> > > >
> > > > "Aaron" wrote:
> > > >
> > > > > First of all, thanks for the response Mattias! I notice you consistently
> > > > > help us problem ridden posters and let me just say we really appreciate the
> > > > > time you take helping us.
> > > > >
> > > > > Regarding my issue, I don't have the source code for the COM component so am
> > > > > unable to change the type definitions for the Struct members. This dll does
> > > > > not export these methods either, so, if I understand PInvoke correctly, I am
> > > > > unable to use PInvoke since the method isn't exported. So, knowing what I
> > > > > know now from the info contained in the link you referred to, if I were able
> > > > > to flatten the struct members (get rid of array references, which I would
> > > > > like to do anyways since I am always just passing in 1) this method would
> > > > > complete S_OK. <- :s
> > > > >
> > > > > So the question now is, is it possible to _redefine_ a structure which is
> > > > > declared in the namespace of the COM component? So I would be able to call
> > > > > 'pseudo code
> > > > > Structure MyNewlyRedefinedGroupAttribute
> > > > > ...
> > > > > ... ' redefine the array structure to be non-arrays
> > > > > end structure
> > > > > Dim myNewlyRedefinedGroupAttributes as MyNewlyRedefinedGroupAttribute
> > > > >
> > > > > Be able to use my redefined flattened structure without getting
> > > > > "There is no interface that accepts these parameters
> > > > > (myapp.MyNewlyRedefinedGroupAttribute, Nokia.TCSapi.tcsGroupAttributesMask_t,
> > > > > int16)"
> > > > >
> > > > > Create(myNewlyRedefinedGroupAttributes, groupAttributesMask, cookie)
> > > > >
> > > > > Is it possible to just edit the IL and reassemble or will I get that
> > > > > "missingfieldexception"?
> > > > >
> > > > > Thanks in advance Mattias!
> > > > >
> > > > > Aaron
> > > > > "Mattias Sjögren" wrote:
> > > > >
> > > > > > Aaron,
> > > > > >
> > > > > > >This struct has a member which is a struct
> > > > > > >which contains an array of another struct.
> > > > > >
> > > > > > That's unfortunately not supported by the marshaler. See
> > > > > >
> > > > > > http://dotnetinterop.com/faq/?q=StructWithStructArray
> > > > > >
> > > > > >
> > > > > >
> > > > > > Mattias
> > > > > >
> > > > > > --
> > > > > > Mattias Sjögren [MVP] mattias @ mvps.org
> > > > > > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> > > > > > Please reply only to the newsgroup.
> > > > > >
> > >

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrays of classes or structs, which is best =?Utf-8?B?TWFjY2E=?= Microsoft C# .NET 5 27th May 2006 07:35 AM
Arrays in structs cody Microsoft C# .NET 4 16th Mar 2005 04:26 PM
interop: passing C++ structs to C# dvanderboom@panatrack.com Microsoft Dot NET Compact Framework 3 25th Jan 2005 05:14 PM
Interfacing with an API - structs with arrays of structs. Dave A Microsoft Dot NET 1 29th Dec 2004 11:47 PM
C structs containing arrays to VB Chris Tacke, eMVP Microsoft Dot NET Compact Framework 3 26th Nov 2003 02:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:22 PM.