SafeArrayTypeMisMatchException
Yogesh Shetty <[email protected]> Thu, 20 Jun 2002 13:13:08 +0530
| Newsgroups | gmane.comp.windows.devel.dotnet.general |
|---|---|
| Message-ID | <[email protected]> |
I have posted this article in this list but not got an reply... I have got a solution from Advance-dot net... This is FYI.. And subsequent use... -----Original Message----- From: Yogesh [ <mailto:[email protected]> mailto:[email protected]] On Behalf Of Yogesh S Sent: Thursday, June 20, 2002 12:37 PM Subject: SafeArrayTypeMisMatchException Hi, Extremely sorry...thx a lot.. It worked... But can u explain the reason behind such multi-faceted behaviour ...When the same compoennt is called thru VB it works but when called thru .NET it fails...That means I have to go and replace SafeArrayCreateVector with SafeArrayCreateVectorEx every where it is referenced in my component.. -----Original Message----- From: Moderated discussion of advanced .NET topics. [ <mailto:[email protected]> mailto:[email protected]] On Behalf Of George Hendel Sent: Wednesday, June 19, 2002 8:01 PM To: <mailto:[email protected]> [email protected] Subject: Re: [ADVANCED-DOTNET] SafeArrayTypeMisMatchException Instead of lpSafeByteArray = SafeArrayCreateVector (VT_UI1, 0, sizeof (MessageHeader) + (lnAccessListCnt * sizeof (tagUserAccessControlList))); try lpSafeByteArray = SafeArrayCreateVectorEx (VT_UI1, 0, sizeof (MessageHeader) + (lnAccessListCnt * sizeof (tagUserAccessControlList)), 0); George -----Original Message----- From: Yogesh Shetty [ <mailto:[email protected]> mailto:[email protected]] Sent: Wednesday, June 19, 2002 12:13 AM To: <mailto:[email protected]> [email protected] Subject: [ADVANCED-DOTNET] SafeArrayTypeMisMatchException I am facing a problem while invoking a com ( developed in VC++) method from .NET, I have enclosed below both VC++ & .NET Code, when i invoke this component from VB 6.0 it works fine and both the out parameter pvarAccessList & pvarErrorMsg gets filled and returned properly. pvarAccessList returns a byte array and pvarErroMsg returns a string ... But when invoked thru .NET it gives error msg "SafeArrayTypeMisMatchException Specified Array was not of expected type"... My head is getting sore from too much debugging... can any one shed some light on this... ................................ ................................ Regards Yogesh Shetty Team COE Financial Technologies (India) Ltd. URL: < <http://www.ftindia.com> http://www.ftindia.com> <http://www.ftindia.com> www.ftindia.com mailto : < <mailto:[email protected]> mailto:[email protected]> <mailto:[email protected]> [email protected] contact : +91 22 6164145 You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at <http://discuss.develop.com> http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.