Results 1 to 8 of 8

Thread: Random Error Please Help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Cool Random Error Please Help

    ee the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) ---> System.Runtime.InteropServices.COMException (0x80040154): Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
    at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
    at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
    at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
    at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
    at System.Windows.Forms.AxHost.CreateInstance()
    at System.Windows.Forms.AxHost.GetOcxCreate()
    at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
    at System.Windows.Forms.AxHost.CreateHandle()
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.AxHost.EndInit()
    at Warez_Edition_Browser.Network_Info.InitializeComponent()
    at Warez_Edition_Browser.Network_Info..ctor()
    --- End of inner exception stack trace ---
    at Warez_Edition_Browser.My.MyProject.MyForms.Create__Instance__[T](T Instance)
    at Warez_Edition_Browser.My.MyProject.MyForms.get_Network_Info()
    at Warez_Edition_Browser.MainScreen.ConnectionLabel_Click(Object sender, EventArgs e)
    at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
    at System.Windows.Forms.ToolStripItem.OnClick(EventArgs e)
    at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
    at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
    at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
    at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
    at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ToolStrip.WndProc(Message& m)
    at System.Windows.Forms.StatusStrip.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    please help

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Random Error Please Help

    The code and where the exception is thrown please,
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: Random Error Please Help

    public class mainscreen
    public class mainscreen Code:
    1. [CODE] Private Sub ConnectionLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ConnectionLabel.Click
    2.         My.Forms.Network_Info.Show()
    3.         Dim voice As New SpVoice
    4.         voice.Speak("Network Information")
    5.     End Sub
    6. ******************************************************
    7. Option Explicit
    8. Imports System.IO
    9. Imports System
    10. Imports System.Net
    11. Imports System.Net.NetworkInformation
    12. Imports System.Management
    13. Imports System.Security
    14. Imports SpeechLib
    15.  
    16. Public Class Network_Info
    17. #Region " Functions "
    18. #Region " API "
    19.     Private Const MF_BYPOSITION = &H400
    20.     Private Const MF_REMOVE = &H1000
    21.     Private Const MF_DISABLED = &H2
    22.  
    23.     Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As IntPtr, ByVal nPosition As Integer, ByVal wFlags As Long) As IntPtr
    24.     Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr
    25.     Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As IntPtr) As Integer
    26.     Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As IntPtr) As Boolean
    27.     Declare Function SendARP Lib "iphlpapi.dll" Alias "SendARP" (ByVal DestIP As Int32, ByVal SrcIP As Int32, ByVal pMacAddr() As Byte, ByRef PhyAddrLen As Int32) As Int32
    28. #End Region
    29. #Region " Network"
    30.     Public Shared Function GetMac(ByVal ipAddr As String) As String
    31.         Dim macAddress As String = String.Empty
    32.         Try
    33.             Dim destIP As Net.IPAddress = Net.IPAddress.Parse(ipAddr)
    34.             Dim IP() As Byte = destIP.GetAddressBytes()
    35.             Dim IPInt As Int32 = BitConverter.ToInt32(IP, 0)
    36.             Dim mac() As Byte = New Byte(5) {}
    37.             SendARP(IPInt, 0, mac, mac.Length)
    38.             macAddress = BitConverter.ToString(mac, 0, mac.Length)
    39.         Catch ex As Exception
    40.             Debug.Write(ex.Message)
    41.         End Try
    42.         Return macAddress
    43.  
    44.  
    45.     End Function
    46. #End Region
    47.  
    48. #End Region
    49. #Region " Main "
    50. #Region " Call's , Others "
    51.     Public Sub DisableCloseButton(ByVal hwnd As IntPtr)
    52.         Dim hMenu As IntPtr
    53.         Dim menuItemCount As Integer
    54.  
    55.         hMenu = GetSystemMenu(hwnd, False)
    56.         menuItemCount = GetMenuItemCount(hMenu)
    57.         Call RemoveMenu(hMenu, menuItemCount - 1, MF_DISABLED Or MF_BYPOSITION)
    58.         Call RemoveMenu(hMenu, menuItemCount - 2, MF_DISABLED Or MF_BYPOSITION)
    59.         Call DrawMenuBar(hwnd)
    60.     End Sub
    61.     Private Sub gateway1()
    62.         Dim gatewayip As String
    63.         Dim i As Integer = 0
    64.         Dim arr(1) As String
    65.         Dim myNetworkAdapters() As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces
    66.         Dim myAdapterProps As IPInterfaceProperties = Nothing
    67.         Dim myGateways As GatewayIPAddressInformationCollection = Nothing
    68.  
    69.         For Each adapter As NetworkInterface In myNetworkAdapters
    70.             myAdapterProps = adapter.GetIPProperties
    71.             myGateways = myAdapterProps.GatewayAddresses
    72.             For Each Gateway As GatewayIPAddressInformation In myGateways
    73.                 gatewayip = Gateway.Address.ToString
    74.                 arr(1) = gatewayip
    75.                 'MessageBox.Show("Gateway IP: " & Gateway.Address.ToString)
    76.  
    77.  
    78.  
    79.             Next
    80.         Next
    81.         'MsgBox(arr(0))
    82.         WebBrowser1.Navigate(arr(1))
    83.        
    84.  
    85.  
    86.  
    87.  
    88.  
    89.     End Sub
    90.  
    91.  
    92.  
    93. #End Region
    94. #Region "Buttons"
    95.     Private Sub DisplayMACAddress_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisplayMACAddress.Click
    96.         Me.MACAddressDisplayLabel.Text = GetMac(Me.MacLocalIPAddressBox.Text)
    97.     End Sub
    98.     Private Sub RouterLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RouterLogIn.Click
    99.         gateway1()
    100.         Dim voice As New SpVoice
    101.         voice.Speak("Router Login , Security alert!")
    102.     End Sub
    103.  
    104. #End Region
    105. #Region " Load"
    106.     Private Sub Network_Info_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    107.         On Error Resume Next
    108.         Security.Enabled = True
    109.         DisableCloseButton(Me.Handle)
    110.  
    111.     End Sub
    112. #End Region
    113. #Region " Timer's"
    114.     Private Sub Speech_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Speech.Tick
    115.         On Error Resume Next
    116.         Dim voice As New SpVoice
    117.         If voice.Speak("This Is Where, Your Local Machine, IP Address, is Displayed") Then
    118.             voice.Speak("Local Port Number, Is Displayed")
    119.             voice.Speak("Interenet,Service ,Provider ,IP Address, is Displayed ")
    120.             voice.Speak("To Log In To Your, Router, Please Press, Router Login , and Enter ,Username and Password")
    121.  
    122.             Speech.Enabled = False
    123.         End If
    124.  
    125.     End Sub
    126.  
    127.     Private Sub Security_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Security.Tick
    128.         On Error Resume Next
    129.         Dim req As Net.HttpWebRequest = Net.WebRequest.Create("http://whatismyip.com/automation/n09230945.asp")
    130.         On Error Resume Next
    131.         Dim res As Net.HttpWebResponse = req.GetResponse
    132.         On Error Resume Next
    133.         Dim Stream As Stream = res.GetResponseStream()
    134.         On Error Resume Next
    135.         Dim sr As StreamReader = New StreamReader(Stream)
    136.         On Error Resume Next
    137.         RealIPAddressBox.Text = (sr.ReadToEnd())
    138.         On Error Resume Next
    139.         LocalMachineIPAddressBox.Text = AxWinsock1.LocalIP
    140.         On Error Resume Next
    141.         IPLocalPortBox.Text = AxWinsock1.LocalPort
    142.  
    143.         On Error Resume Next
    144.         MaximizeBox = False
    145.         On Error Resume Next
    146.         Speech.Enabled = True
    147.         On Error Resume Next
    148.         Security.Enabled = False
    149.     End Sub
    150. #End Region
    151.  
    152. #End Region
    153.  
    154.  
    155.     Private Sub CloseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseButton.Click
    156.         Me.Close()
    157.     End Sub
    158. End Class[/CODE]
    Last edited by pillhead2007; May 17th, 2010 at 04:03 PM.

  4. #4
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Random Error Please Help

    If you wouldn't mind, edit your post, click advanced and put vbcode tags around all that code, it's a bit to read : ).

    Thanks,

    Justin


    P.S

    when you click the vbcode button a box will pop up, just type 'vb' into it.
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: Random Error Please Help

    sorry matey

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: Random Error Please Help

    bump!!!!!!!!!!!!
    Last edited by pillhead2007; May 17th, 2010 at 05:15 PM.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: Random Error Please Help

    can anyone help me!!!

  8. #8
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Random Error Please Help

    Hi.
    Please don't bump the posts, it's not allowed.
    Also what i am suggesting is you should put some breakpoints
    (http://www.startvbdotnet.com/forms/debug2.aspx) and see where the program get's the error.
    Having said that, change your sendArp function to this
    Code:
    Declare Function SendARP Lib "iphlpapi.dll" (ByVal DestIP As UInt32 _
        , ByVal SrcIP As UInt32, ByVal pMacAddr As Byte(), ByRef PhyAddrLen As Integer) As Integer
    .
    I was going to ask before if you where using API but now it's clear.The problem may be that you have not specified a function correct or use it in the wrong way.But without telling us where exactly you get the error we can only make speculations.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width