|
-
May 17th, 2010, 02:48 PM
#1
Thread Starter
Addicted Member
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
-
May 17th, 2010, 03:43 PM
#2
Re: Random Error Please Help
The code and where the exception is thrown please,
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
May 17th, 2010, 03:49 PM
#3
Thread Starter
Addicted Member
Re: Random Error Please Help
public class mainscreen
public class mainscreen Code:
[CODE] Private Sub ConnectionLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ConnectionLabel.Click
My.Forms.Network_Info.Show()
Dim voice As New SpVoice
voice.Speak("Network Information")
End Sub
******************************************************
Option Explicit
Imports System.IO
Imports System
Imports System.Net
Imports System.Net.NetworkInformation
Imports System.Management
Imports System.Security
Imports SpeechLib
Public Class Network_Info
#Region " Functions "
#Region " API "
Private Const MF_BYPOSITION = &H400
Private Const MF_REMOVE = &H1000
Private Const MF_DISABLED = &H2
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As IntPtr, ByVal nPosition As Integer, ByVal wFlags As Long) As IntPtr
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As IntPtr) As Integer
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As IntPtr) As Boolean
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
#End Region
#Region " Network"
Public Shared Function GetMac(ByVal ipAddr As String) As String
Dim macAddress As String = String.Empty
Try
Dim destIP As Net.IPAddress = Net.IPAddress.Parse(ipAddr)
Dim IP() As Byte = destIP.GetAddressBytes()
Dim IPInt As Int32 = BitConverter.ToInt32(IP, 0)
Dim mac() As Byte = New Byte(5) {}
SendARP(IPInt, 0, mac, mac.Length)
macAddress = BitConverter.ToString(mac, 0, mac.Length)
Catch ex As Exception
Debug.Write(ex.Message)
End Try
Return macAddress
End Function
#End Region
#End Region
#Region " Main "
#Region " Call's , Others "
Public Sub DisableCloseButton(ByVal hwnd As IntPtr)
Dim hMenu As IntPtr
Dim menuItemCount As Integer
hMenu = GetSystemMenu(hwnd, False)
menuItemCount = GetMenuItemCount(hMenu)
Call RemoveMenu(hMenu, menuItemCount - 1, MF_DISABLED Or MF_BYPOSITION)
Call RemoveMenu(hMenu, menuItemCount - 2, MF_DISABLED Or MF_BYPOSITION)
Call DrawMenuBar(hwnd)
End Sub
Private Sub gateway1()
Dim gatewayip As String
Dim i As Integer = 0
Dim arr(1) As String
Dim myNetworkAdapters() As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces
Dim myAdapterProps As IPInterfaceProperties = Nothing
Dim myGateways As GatewayIPAddressInformationCollection = Nothing
For Each adapter As NetworkInterface In myNetworkAdapters
myAdapterProps = adapter.GetIPProperties
myGateways = myAdapterProps.GatewayAddresses
For Each Gateway As GatewayIPAddressInformation In myGateways
gatewayip = Gateway.Address.ToString
arr(1) = gatewayip
'MessageBox.Show("Gateway IP: " & Gateway.Address.ToString)
Next
Next
'MsgBox(arr(0))
WebBrowser1.Navigate(arr(1))
End Sub
#End Region
#Region "Buttons"
Private Sub DisplayMACAddress_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisplayMACAddress.Click
Me.MACAddressDisplayLabel.Text = GetMac(Me.MacLocalIPAddressBox.Text)
End Sub
Private Sub RouterLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RouterLogIn.Click
gateway1()
Dim voice As New SpVoice
voice.Speak("Router Login , Security alert!")
End Sub
#End Region
#Region " Load"
Private Sub Network_Info_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
On Error Resume Next
Security.Enabled = True
DisableCloseButton(Me.Handle)
End Sub
#End Region
#Region " Timer's"
Private Sub Speech_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Speech.Tick
On Error Resume Next
Dim voice As New SpVoice
If voice.Speak("This Is Where, Your Local Machine, IP Address, is Displayed") Then
voice.Speak("Local Port Number, Is Displayed")
voice.Speak("Interenet,Service ,Provider ,IP Address, is Displayed ")
voice.Speak("To Log In To Your, Router, Please Press, Router Login , and Enter ,Username and Password")
Speech.Enabled = False
End If
End Sub
Private Sub Security_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Security.Tick
On Error Resume Next
Dim req As Net.HttpWebRequest = Net.WebRequest.Create("http://whatismyip.com/automation/n09230945.asp")
On Error Resume Next
Dim res As Net.HttpWebResponse = req.GetResponse
On Error Resume Next
Dim Stream As Stream = res.GetResponseStream()
On Error Resume Next
Dim sr As StreamReader = New StreamReader(Stream)
On Error Resume Next
RealIPAddressBox.Text = (sr.ReadToEnd())
On Error Resume Next
LocalMachineIPAddressBox.Text = AxWinsock1.LocalIP
On Error Resume Next
IPLocalPortBox.Text = AxWinsock1.LocalPort
On Error Resume Next
MaximizeBox = False
On Error Resume Next
Speech.Enabled = True
On Error Resume Next
Security.Enabled = False
End Sub
#End Region
#End Region
Private Sub CloseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseButton.Click
Me.Close()
End Sub
End Class[/CODE]
Last edited by pillhead2007; May 17th, 2010 at 04:03 PM.
-
May 17th, 2010, 03:57 PM
#4
Frenzied Member
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.
-
May 17th, 2010, 04:04 PM
#5
Thread Starter
Addicted Member
Re: Random Error Please Help
-
May 17th, 2010, 05:03 PM
#6
Thread Starter
Addicted Member
Re: Random Error Please Help
Last edited by pillhead2007; May 17th, 2010 at 05:15 PM.
-
May 17th, 2010, 05:17 PM
#7
Thread Starter
Addicted Member
Re: Random Error Please Help
-
May 17th, 2010, 05:58 PM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|