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. C#
  4. Amazing error from VisualStudio.NET

Amazing error from VisualStudio.NET

Scheduled Pinned Locked Moved C#
helpcsharpdotnetdebuggingtutorial
6 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.
  • I Offline
    I Offline
    Inam
    wrote on last edited by
    #1

    I am using VisualStudio.NET 2002 with .NET Framework 1.0 Actually i am developing a program in which i have to use Browser Control. I have used it on a control which facilitate me in providing wizard. Actually it is a wizard control on which i have used WebBrowser Control. Now i have start it both bu using Debug and without debu it is alright. Now i have created a form in which i call this wizard. Now if i run this program without using debug it will run alright but if i run it with start using debug it will give me error that cannot instantiate Active X control. What can be the problem please guide me ThanX in advance Regards INAM Inam

    L 1 Reply Last reply
    0
    • I Inam

      I am using VisualStudio.NET 2002 with .NET Framework 1.0 Actually i am developing a program in which i have to use Browser Control. I have used it on a control which facilitate me in providing wizard. Actually it is a wizard control on which i have used WebBrowser Control. Now i have start it both bu using Debug and without debu it is alright. Now i have created a form in which i call this wizard. Now if i run this program without using debug it will run alright but if i run it with start using debug it will give me error that cannot instantiate Active X control. What can be the problem please guide me ThanX in advance Regards INAM Inam

      L Offline
      L Offline
      LongRange Shooter
      wrote on last edited by
      #2

      The browser control, while incorporated as a .NET control, is just a wrapper for the COM-intense MSHTML object. You should check the properties of your project to ensure you have the following properties set: Under Debugging: Enable Unmanaged Debugging You may still have problems if you do not have the symbols installed for the OS....just a heads up. _____________________________________________ Of all the senses I could possibly lose,
      It is most often the one called 'common' that gets lost.

      I 1 Reply Last reply
      0
      • L LongRange Shooter

        The browser control, while incorporated as a .NET control, is just a wrapper for the COM-intense MSHTML object. You should check the properties of your project to ensure you have the following properties set: Under Debugging: Enable Unmanaged Debugging You may still have problems if you do not have the symbols installed for the OS....just a heads up. _____________________________________________ Of all the senses I could possibly lose,
        It is most often the one called 'common' that gets lost.

        I Offline
        I Offline
        Inam
        wrote on last edited by
        #3

        Sir Thanks for ur reply Sir but i want to know that from where i can change my properties of Debugging to Enable Managed Debugging and How can i check that if i have the symbols installed or not. and if they are not how can i installed them. I will be thankful to u for giving me time Regards minamkhan Inam

        L 1 Reply Last reply
        0
        • I Inam

          Sir Thanks for ur reply Sir but i want to know that from where i can change my properties of Debugging to Enable Managed Debugging and How can i check that if i have the symbols installed or not. and if they are not how can i installed them. I will be thankful to u for giving me time Regards minamkhan Inam

          L Offline
          L Offline
          LongRange Shooter
          wrote on last edited by
          #4

          Inam wrote: where i can change my properties of Debugging to Enable Managed Debugging Inam wrote: This falls under the topic of 'basic things you should know before you begin to think about writing code'. Pull up the properties for each project in your solution that is using unmanaged code. Go to Configuration Properties Tab, Debugging. Set Enable Unmanaged Debugging to true. How can i check that if i have the symbols installed Well, for the OS it is really dependant on whether you build your machine or if you have a managed desktop. For the former - you used to be able to select install symbols during the install process. For the latter -- you probably do not have symbols installed. Also, you need to reinstall symbols for the OS with each service pack and hot fix. Check MSDN or the main Windows website for installing the symbols. You should also be able to get the symbols from the Win32 SDK.\ The obvious tell tale sign that you do not have symbols installed is if the unmanaged code craps out, and VS says 'An exception occured within unmanaged code, but no symbols were installed....' _____________________________________________

          I 1 Reply Last reply
          0
          • L LongRange Shooter

            Inam wrote: where i can change my properties of Debugging to Enable Managed Debugging Inam wrote: This falls under the topic of 'basic things you should know before you begin to think about writing code'. Pull up the properties for each project in your solution that is using unmanaged code. Go to Configuration Properties Tab, Debugging. Set Enable Unmanaged Debugging to true. How can i check that if i have the symbols installed Well, for the OS it is really dependant on whether you build your machine or if you have a managed desktop. For the former - you used to be able to select install symbols during the install process. For the latter -- you probably do not have symbols installed. Also, you need to reinstall symbols for the OS with each service pack and hot fix. Check MSDN or the main Windows website for installing the symbols. You should also be able to get the symbols from the Win32 SDK.\ The obvious tell tale sign that you do not have symbols installed is if the unmanaged code craps out, and VS says 'An exception occured within unmanaged code, but no symbols were installed....' _____________________________________________

            I Offline
            I Offline
            Inam
            wrote on last edited by
            #5

            I have set the Enable unmanaged debugging to true but the same error comes . Actuallt the error when catch through exception is " System.Threading.ThreadStateException could not instantiate ActiveX control 'GUID of Control ' because the current thread is not in a single threded appartment at System.windows.Forms.AxHost ctor(String clsId,Int32 flags). " Thanx in advance Regards minamkhan Inam

            L 1 Reply Last reply
            0
            • I Inam

              I have set the Enable unmanaged debugging to true but the same error comes . Actuallt the error when catch through exception is " System.Threading.ThreadStateException could not instantiate ActiveX control 'GUID of Control ' because the current thread is not in a single threded appartment at System.windows.Forms.AxHost ctor(String clsId,Int32 flags). " Thanx in advance Regards minamkhan Inam

              L Offline
              L Offline
              LongRange Shooter
              wrote on last edited by
              #6

              Make certain that you are using the .NET wrapper that is in the design toolbox and not doing your own ActiveX control. You have a Win32 form which (as the exception states) is apartment threaded. Unless you use specific thread types that are apartment-aware, then you will get that exception. It sounds like the control on your form is trying to start a thread of its' own which is a no-no in a Winform. This really goes beyond COM, unmanaged debugging, etc. as it is the implementation of the control, not the actual execution of the unmanaged code. _____________________________________________ Of all the senses I could possibly lose,
              It is most often the one called 'common' that gets lost.

              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