guys ,Could anyone hlep me to get out of this hell ?
I am calling a dll method which is "Navigate" and "Navigate2" from my class "Navigation" but it keeps firing this error which damn says :

an unhandled exception of type "InvalidActiveXStateException" occurred in axinterop.shdocvw.dll

when I call this method from the form it's fine.
Don't you think this have to do with inheritence :
I tried this :
VB Code:
  1. Imports AxSHDocVw.AxWebBrowser
  2. Public Class Navigation
  3.     Public Shared MyWeb As New AxSHDocVw.AxWebBrowser()
  4.  
  5.     Public Shared Function Back() As String
  6.         MyWeb.GoBack()
  7.     End Function
  8.  
  9.     Public Shared Function Forward() As String
  10.         MyWeb.GoForward()
  11.     End Function
  12.  
  13.     Public Shared Function Go() As String
  14.  
  15.     End Function
  16.  
  17.     Public Shared Function Refresh() As String
  18.         MyWeb.Refresh()
  19.     End Function
  20.  
  21.     Public Shared Function Stopp() As String
  22.         MyWeb.Stop()
  23.     End Function
  24.  
  25.     Public Shared Function Home() As String
  26.         MyWeb.GoHome()
  27.     End Function
  28.  
  29.     Public Shared Function Navigate() As String
  30.         Dim nullObject As System.Object = 0
  31.         Dim URL As Object
  32.         Dim Str As String = ""
  33.         Dim nullObjStr As System.Object = Str
  34.         Cursor.Current = Cursors.WaitCursor  ' Navigate to location found in textbox        
  35.         MyWeb.Navigate2(URL, nullObject, nullObjStr, nullObjStr, nullObjStr)
  36.         Cursor.Current = Cursors.Default
  37.  
  38.         'or you can safely use this :
  39.         'MyWeb.Navigate("www.home.com")
  40.  
  41.     End Function
  42.  
  43. End Class