Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays
From: Aaron (Aaron_at_discussions.microsoft.com)
Date: 10/25/04
- Next message: Bob Hollness: "Pausing and cancelling Print Jobs???"
- Previous message: Fred Nelson: "Newby Question : Update to Sub Main in vb.net"
- In reply to: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Next in thread: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Reply: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Reply: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 25 Oct 2004 08:35:13 -0700
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" <Aaron@discussions.microsoft.com> wrote in message news:<35BF79D1-1226-4AA4-BEFE-26038FB9A359@microsoft.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.
> > > >
>
- Next message: Bob Hollness: "Pausing and cancelling Print Jobs???"
- Previous message: Fred Nelson: "Newby Question : Update to Sub Main in vb.net"
- In reply to: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Next in thread: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Reply: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Reply: tcarvin: "Re: ANY COM Interop GURUS out there!? - Nested Structs with arrays"
- Messages sorted by: [ date ] [ thread ]