Hey all,
Was referencing various COMs, and tried using the Windows Genuine
Advantage 1.0 Type Library.
There's a cool method called GetMachineDetails() that I wanted to try,
but for some reason I'm getting an ACCESS DENIED HRESULT error when I
do.
Here's my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GAVT = LegitCheckControlLib; // The namespace created from the
reference
namespace COMTest5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
GAVT.LegitCheck lc = new LegitCheckControlLib.LegitCheck();
this.textBox1.Text = lc.GetMachineDetails();
}
}
}
Really want to check out this method. Any ideas?
~uncle.sammy
Here's the output (sorry, forgot to include it): Notice the "final"
call to System.Configuration.dll....I have no problem accessing and
using this otherwise...
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded 'C:\Documents and
Settings\Administrator\My
Documents\COMTest5\bin\Debug\COMTest5.vshost.exe', No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll',
No symbols loaded.
The thread '<No Name>' (0xc8c) has exited with code 0 (0x0).
'COMTest5.vshost.exe' (Managed): Loaded 'C:\Documents and
Settings\Administrator\My Documents\COMTest5\bin\Debug\COMTest5.exe',
Symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded 'C:\Documents and
Settings\Administrator\My
Documents\COMTest5\bin\Debug\Interop.LegitCheckControlLib.dll', No
symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll',
No symbols loaded.
A first chance exception of type 'System.UnauthorizedAccessException'
occurred in COMTest5.exe
An unhandled exception of type 'System.UnauthorizedAccessException'
occurred in COMTest5.exe
Additional information: Access is denied. (Exception from HRESULT:
0x80070005 (E_ACCESSDENIED))
~simon