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. Web Development
  3. ASP.NET
  4. System.Threading.ThreadAbortException

System.Threading.ThreadAbortException

Scheduled Pinned Locked Moved ASP.NET
c++helpquestion
2 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.
  • W Offline
    W Offline
    wb
    wrote on last edited by
    #1

    I have a problem I don't understand. I have a native C++ DLL that exports a createXY function. This one creates an Object of type XY. :) Then I build a wrapper in Managed C++

    public __gc class clsNGramWrapper
    {
    protected:
    ISimpleIndexBuilder * _IB;
    public:
    clsNGramWrapper();
    ~clsNGramWrapper();
    bool addDocument(System::String * strDoc);
    ArrayList * search(System::String * str);

    };
    public \_\_gc class clsSearchResult
    {
    public:
    	System::String \* \_sText;
    	double			 \_dRelevance;
    };
    

    and the constructor looks like this:

    clsNGramWrapper::clsNGramWrapper() {
    HMODULE hDLL = ::LoadLibrary("./nGram.dll");
    UINT err = GetLastError();
    typedef ISimpleIndexBuilder*(*builderFunc)(void);
    builderFunc createSI = (builderFunc)::GetProcAddress(hDLL, "createSimpleIndexBuilder");
    _IB = createSI();
    }

    ISimpleIndexBuilder is a class with only some pure virtual methods. In the ASP App, I create an instance of the wrapper int the PageLoad Event. After PageLoad I get an ThreadAbortException, the Application is closed and I loose all the Session and Application State objects. :sigh: What I done wrong? Maybe the wrapper thing?

    M 1 Reply Last reply
    0
    • W wb

      I have a problem I don't understand. I have a native C++ DLL that exports a createXY function. This one creates an Object of type XY. :) Then I build a wrapper in Managed C++

      public __gc class clsNGramWrapper
      {
      protected:
      ISimpleIndexBuilder * _IB;
      public:
      clsNGramWrapper();
      ~clsNGramWrapper();
      bool addDocument(System::String * strDoc);
      ArrayList * search(System::String * str);

      };
      public \_\_gc class clsSearchResult
      {
      public:
      	System::String \* \_sText;
      	double			 \_dRelevance;
      };
      

      and the constructor looks like this:

      clsNGramWrapper::clsNGramWrapper() {
      HMODULE hDLL = ::LoadLibrary("./nGram.dll");
      UINT err = GetLastError();
      typedef ISimpleIndexBuilder*(*builderFunc)(void);
      builderFunc createSI = (builderFunc)::GetProcAddress(hDLL, "createSimpleIndexBuilder");
      _IB = createSI();
      }

      ISimpleIndexBuilder is a class with only some pure virtual methods. In the ASP App, I create an instance of the wrapper int the PageLoad Event. After PageLoad I get an ThreadAbortException, the Application is closed and I loose all the Session and Application State objects. :sigh: What I done wrong? Maybe the wrapper thing?

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, The ThreadAbortException exception is thrown when the execution of the page is ended unexpectedly(the current thread of the web application is aborted). Can you put the code of the wrapper class in the try/catch block to see what actually is happening?

      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