473,473 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
Nov 21 '05 #1
17 1833
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.
Nov 21 '05 #2
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.

Nov 21 '05 #3
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.

Nov 21 '05 #4
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

Nov 21 '05 #5
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
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.

Nov 21 '05 #6
> Be forewarned, I haven't tried this specifically.

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

Nov 21 '05 #7
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
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.
>

Nov 21 '05 #8
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" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
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.
> >

Nov 21 '05 #9
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" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
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.
> >

Nov 21 '05 #10
*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" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
> 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.
> > >

Nov 21 '05 #11
*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" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
> 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.
> > >

Nov 21 '05 #12
I tried posting a followup a day ago, so I'll try again:

OLE View will let you capture the IDL from the TypeLib. You can cut and
paste that into another file, modify it, and then use MIDL to recreate the
TypeLib.

Regards,
Tom (NO***********@lycos.com)
"Aaron" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
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.
> >

Nov 21 '05 #13
I know what Pack is at least. It refers to the "alignment" of data when it
does not fall on integer boundries. VB6 always used 4 byte alignment such
that a structure that contained:

A As Byte
B As Byte
C As Long

would in memory look like this:

A As Byte
B As Byte
Pad1 As Byte
Pad2 As Byte
C As Long

In .NET you can control this.

HTH,
Tom

PS - I responded to your other OLE View question as well, but I can't seem to
find it via groups.google.com. If you didn't get it, email me.
"Aaron" <Aa***@discussions.microsoft.com> wrote in message news:<10**********************************@microso ft.com>...
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

Nov 21 '05 #14
Ok, I used OleView to get the IDL, then I changed the array from being an
array to a non-array (I made Variable[172] look like Variable). I use MIDL
to create a tlb file. I then use tlbimp to make it a dll. Now I get a
COMException when I call the method. Anyone have any ideas? Is there a
workaround to this behaviour->
http://dotnetinterop.com/faq/?q=StructWithStructArray ?

"tcarvin" wrote:
I tried posting a followup a day ago, so I'll try again:

OLE View will let you capture the IDL from the TypeLib. You can cut and
paste that into another file, modify it, and then use MIDL to recreate the
TypeLib.

Regards,
Tom (NO***********@lycos.com)
"Aaron" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
> 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.
> > >

Nov 21 '05 #15
Mattias, how do I flatten the array when I just have the il and not the
source code.? When I make the struct member a non-array, it gives me a COM
Exception? Would it help to edit IDL.?

"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.

Nov 21 '05 #16
Aaron,

Sorry for the long delay, I didn't notice a response in this thread.

You said you "made made Variable[172] look like Variable".

Can you post the IDL before and after for the change you made?

Tom

PS - I'm hoping a real Interop expert (which I will make no claim to be)
will post here if what I have proposed won't work.

"Aaron" <Aa***@discussions.microsoft.com> wrote in message news:<EA**********************************@microso ft.com>...
Ok, I used OleView to get the IDL, then I changed the array from being an
array to a non-array (I made Variable[172] look like Variable). I use MIDL
to create a tlb file. I then use tlbimp to make it a dll. Now I get a
COMException when I call the method. Anyone have any ideas? Is there a
workaround to this behaviour->
http://dotnetinterop.com/faq/?q=StructWithStructArray ?

"tcarvin" wrote:
I tried posting a followup a day ago, so I'll try again:

OLE View will let you capture the IDL from the TypeLib. You can cut and
paste that into another file, modify it, and then use MIDL to recreate the
TypeLib.

Regards,
Tom (NO***********@lycos.com)
"Aaron" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
> > 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.
> > > >
>

Nov 21 '05 #17
Hey np dude,

I solved it by creating a wrapper dll in c++ and then converting the
structures. Thanks for your help man!

Aaron

"tcarvin" wrote:
Aaron,

Sorry for the long delay, I didn't notice a response in this thread.

You said you "made made Variable[172] look like Variable".

Can you post the IDL before and after for the change you made?

Tom

PS - I'm hoping a real Interop expert (which I will make no claim to be)
will post here if what I have proposed won't work.

"Aaron" <Aa***@discussions.microsoft.com> wrote in message news:<EA**********************************@microso ft.com>...
Ok, I used OleView to get the IDL, then I changed the array from being an
array to a non-array (I made Variable[172] look like Variable). I use MIDL
to create a tlb file. I then use tlbimp to make it a dll. Now I get a
COMException when I call the method. Anyone have any ideas? Is there a
workaround to this behaviour->
http://dotnetinterop.com/faq/?q=StructWithStructArray ?

"tcarvin" wrote:
I tried posting a followup a day ago, so I'll try again:

OLE View will let you capture the IDL from the TypeLib. You can cut and
paste that into another file, modify it, and then use MIDL to recreate the
TypeLib.

Regards,
Tom (NO***********@lycos.com)
"Aaron" <Aa***@discussions.microsoft.com> wrote in message news:<72**********************************@microso ft.com>...
> 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" <Aa***@discussions.microsoft.com> wrote in message news:<35**********************************@microso ft.com>...
> > > 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.
> > > > >
> >

Nov 21 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: keefah | last post by:
Hi, I'm writing a C# web app that uses Outlook to send email. I use a reference to the Microsoft Outlook 11.0 Object Library, but it's giving me problems. I tracked down some stuff on the Net...
0
by: Shashank Date | last post by:
/* C# Gurus, I am trying to use interop marshalling to call SetCommTimeouts win32 API. But I keep getting the "Object reference not set to an instance of an object" error. Can anybody help...
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
7
by: Biao | last post by:
I have a web service writen by .NET: public string Greetings(string names) { string gs = new string; for (int i = 0; i < gs.Length; i++) gs = string.Format("Hello, {0}", names);
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
6
by: Vijay | last post by:
Hi, I am faced with the following common managed/unmanaged C++ interop problem: - I have a .NET form that acts as a front end GUI to a processing engine in the background. The processing...
2
by: Philip Daniels | last post by:
I am doing some work with a client API via COM interop. I have reached the situation where after this call to their API: object someObj = con.Peek(1); "someObj" contains some type of COM...
1
by: Reg | last post by:
Hello, I have a WCF Web Service using wsHttpDualBinding because I need a callback to Java client. I read Mr. A.Gupta's blog that if WCF Service uses wsHttpDualBinding for interop working is...
0
by: Kaysetoaster | last post by:
Hi Gurus I wrote a "Active X" UserControl DLL in VB.NET and placed it on a iis 6 webserver. I embeded it with the object tag and the communication to functions and propertys in the vb.net...
2
by: Brad Isaac | last post by:
Hi, I have a working app that uses interop.outlook.dll to export items to Outlook calendar. I downloaded the Primary Interop Assemblies for Office 2k7 today and still cannot get a working...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.