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
  1. Home
  2. General Programming
  3. Visual Basic
  4. E_NoInterface Error

E_NoInterface Error

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiohelptutorial
4 Posts 2 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.
  • B Offline
    B Offline
    BINOVAR
    wrote on last edited by
    #1

    Hi All, I upgraded a project from VB to VB.net ( ActivexDll). After converting while debugging I am getting an error "E_nointerface". Can any one please tell me why do we get this error? Through goggling I found some results telling it may be due to threading conflicts. If so please tell me how to set threading in VB.Net.( In VB I found that threading mode is set to "Apartment" in project properties similarly how do we do it in Visual studio 2003 )

    D 1 Reply Last reply
    0
    • B BINOVAR

      Hi All, I upgraded a project from VB to VB.net ( ActivexDll). After converting while debugging I am getting an error "E_nointerface". Can any one please tell me why do we get this error? Through goggling I found some results telling it may be due to threading conflicts. If so please tell me how to set threading in VB.Net.( In VB I found that threading mode is set to "Apartment" in project properties similarly how do we do it in Visual studio 2003 )

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Well, I think you'd have a hard time converting this project using the Conversion Wizard. Something like this is usually going to be rewritten by hand. You can check out this article[^] about using the STAThread and MTAThread attributes. And, if you're starting a new thread, you can set the apartment state by setting the Thread object's ApartmentState property before you Start the thread.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      B 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Well, I think you'd have a hard time converting this project using the Conversion Wizard. Something like this is usually going to be rewritten by hand. You can check out this article[^] about using the STAThread and MTAThread attributes. And, if you're starting a new thread, you can set the apartment state by setting the Thread object's ApartmentState property before you Start the thread.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        B Offline
        B Offline
        BINOVAR
        wrote on last edited by
        #3

        Thanks Dave for your reply. I tried the following 1)&lt;STAThread()&gt; _ and <MTAThread()> _ before the class is intialized. Is it the correct place ? 2)System.Threading.Thread.CurrentThread.ApartmentState = Threading.ApartmentState.STA But still no luck. I verified after changing threading model in Registry. It is getting reflected and the Guid is matching with my code. Any more suggestion please.

        D 1 Reply Last reply
        0
        • B BINOVAR

          Thanks Dave for your reply. I tried the following 1)&lt;STAThread()&gt; _ and <MTAThread()> _ before the class is intialized. Is it the correct place ? 2)System.Threading.Thread.CurrentThread.ApartmentState = Threading.ApartmentState.STA But still no luck. I verified after changing threading model in Registry. It is getting reflected and the Guid is matching with my code. Any more suggestion please.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          BINO VARGHESE wrote:

          )<STAThread()> _ and <mtathread()> _ before the class is intialized. Is it the correct place ?

          From your description, and not being able to see any code, I seriously doubt it. Those attributes don't go on classes.

          BINO VARGHESE wrote:

          2)System.Threading.Thread.CurrentThread.ApartmentState = Threading.ApartmentState.STA

          That won't work as you can't change the apartment state after a thread is started. Somehow, I don't even think your starting a new thread. There are no other suggestions. Without knowing anything about your code, what it looks like, what this component is doing, there's really nothing I can say.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          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