Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Not Supported Exception

Not Supported Exception

Scheduled Pinned Locked Moved Visual Basic
csharpc++helpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rbrad12345
    wrote on last edited by
    #1

    Hello everyone, I'm making a call to a native DLL on a PocketPC 2003 device via pinvoke. I have the call working fine in an eVB demo but it is returning a Not Supported Exception error when I call it in VB.NET. I'm trying to find some docs on how/why the Not Supported Exception error is thrown but can not find anything useful. Can anyone point me in the right direction? Thanks! Ryan Bradley

    R 1 Reply Last reply
    0
    • R rbrad12345

      Hello everyone, I'm making a call to a native DLL on a PocketPC 2003 device via pinvoke. I have the call working fine in an eVB demo but it is returning a Not Supported Exception error when I call it in VB.NET. I'm trying to find some docs on how/why the Not Supported Exception error is thrown but can not find anything useful. Can anyone point me in the right direction? Thanks! Ryan Bradley

      R Offline
      R Offline
      rbrad12345
      wrote on last edited by
      #2

      This problem evolved through a couple of different error messages. The NotSupportedException was thrown when I passed a System.String ByRef to a BSTR in the non-COM DLL. I finally realized that I needed to use a StringBuilder. This resulted in a Native Exception (0xc0000005). Memory wasn't being marshalled properly between the unmanaged stack and the managed heap. Originally I was using <DllImport("")> and passing StringBuilder ByRef (resulting in Native Exception). I finally got this to work using Declare Function "" and passing StringBuilder ByVal. I've read through the CF Core Reference and numerous web sites but have not found the defaults that are different between using DllImport and Declare Function. I did find that MarshalAs is not possible in CF 1.1. I'm stumped why but it works. Dysfunctional: <DllImport("ReaderDll")> _ Public Function Read(ByVal strbData as StringBuilder) as Integer End Function Functional: Public Declare Function "Read" Lib "ReaderDll" (ByVal strbData as StringBuilder) as Integer Ryan Bradley

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups