943,909 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2003
  • ASP.NET RSS
Aug 28th, 2008
0

how do you properly instantiate an activeX control on aspx

Expand Post »
hey... i currently making a web application, in VS 2008 - visual web developer 2008, for our final project and it makes use of an ocx which has methods to enable VOIP. What i did, since the control cannot be added to the tool box in order for it to be simply 'drag and drop'; i used aximp.exe to produce two dll's ATLH323Lib and AxATLH323Lib; i then referenced these two into my web application using Add Reference in the Solution Explorer.

My earlier error was that i always got an {ActiveX control 'fdd4c8c1-69c9-11d3-9dc8-525400e38cf9' cannot be instantiated because the current thread is not in a single-threaded apartment.} error when i did this... [code below]

asp.net Syntax (Toggle Plain Text)
  1. namespace WebVOIP
  2. {
  3.  
  4. public partial class _Default : System.Web.UI.Page
  5. {
  6. //flags to know status of caller
  7. static bool inComingCall;
  8. static bool onTheLine;
  9.  
  10. //variables in use
  11. static string newline = "\r\n";
  12.  
  13. //Objects that handles the VOIP capabilites of the site
  14.  
  15. private AxATLH323Lib.AxH323 ConnectionControl = new AxATLH323Lib.AxH323(); //ERROR points to this line
  16.  
  17. protected void Page_Load (object sender, EventArgs e)
  18. {
  19. ConnectionControl.Listen();
  20.  
  21. //ConnectionControl.ReceivingCall += new ATLH323Lib._IH323Events_ReceivingCallEventHandler(ConnectionControl_ReceivingCall);
  22. }
  23.  
  24. ....
  25.  
  26. }



Then i tried to do it like this ... [code below]

asp.net Syntax (Toggle Plain Text)
  1. namespace WebVOIP
  2. {
  3.  
  4. public partial class _Default : System.Web.UI.Page
  5. {
  6. //flags to know status of caller
  7. static bool inComingCall;
  8. static bool onTheLine;
  9.  
  10. //variables in use
  11. static string newline = "\r\n";
  12.  
  13. //Objects that handles the VOIP capabilites of the site
  14.  
  15. private AxATLH323Lib.AxH323 ConnectionControl;
  16.  
  17. protected void Page_Load (object sender, EventArgs e)
  18. {
  19. ConnectionControl = new AxATLH323Lib.AxH323();
  20. ConnectionControl.Listen();
  21.  
  22. //ConnectionControl.ReceivingCall += new ATLH323Lib._IH323Events_ReceivingCallEventHandler(ConnectionControl_ReceivingCall);
  23. }
  24.  
  25. ....
  26.  
  27. }

But then this error would appear... {Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.}

Help Please...
Last edited by peter_budo; Aug 31st, 2008 at 2:04 pm. Reason: Keep It Organized - please use [code] tags
bmz
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bmz is offline Offline
9 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Adding a Combobox in a Datagridview ASP.NET
Next Thread in ASP.NET Forum Timeline: Beginner question: Changing contentplaceholder on button click





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC