473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Accessing a COM method

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

Apr 18 '06 #1
3 2446

si**********@gmail.com wrote:
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__b77a 5c561934e089\mscorlib.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStud io.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50 a3a\Microsoft.VisualStudio.HostingProcess.Utilitie s.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.dl l',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a 5c561934e089\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.VisualStud io.HostingProcess.Utilities.Sync\8.0.0.0__b03f5f7f 11d50a3a\Microsoft.VisualStudio.HostingProcess.Uti lities.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__b 77a5c561934e089\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.LegitCheckCon trolLib.dll', No
symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration \2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dl l',
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

Apr 18 '06 #2
Sorry, forgot to include the output: Notice the final call to the
System.Configuration assembly. I have no problem using it elsewhere...

'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a 5c561934e089\mscorlib.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStud io.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50 a3a\Microsoft.VisualStudio.HostingProcess.Utilitie s.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.dl l',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a 5c561934e089\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.VisualStud io.HostingProcess.Utilities.Sync\8.0.0.0__b03f5f7f 11d50a3a\Microsoft.VisualStudio.HostingProcess.Uti lities.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__b 77a5c561934e089\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.LegitCheckCon trolLib.dll', No
symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration \2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dl l',
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

Apr 18 '06 #3
Sorry, forgot to include the output: Notice the final call to the
System.Configuration assembly. I have no problem using it elsewhere...

'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a 5c561934e089\mscorlib.dll',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStud io.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50 a3a\Microsoft.VisualStudio.HostingProcess.Utilitie s.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.dl l',
No symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a 5c561934e089\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.VisualStud io.HostingProcess.Utilities.Sync\8.0.0.0__b03f5f7f 11d50a3a\Microsoft.VisualStudio.HostingProcess.Uti lities.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__b 77a5c561934e089\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.LegitCheckCon trolLib.dll', No
symbols loaded.
'COMTest5.vshost.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration \2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dl l',
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))

Apr 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Alfred B. Thordarson | last post by:
I have a problem accessing a DLL using C#. I'm using C/FRONT with Navision's CFRONT.DLL, which contains the method: DBL_S32* DBL_NextKey(DBL_HTABLE hTable, DBL_S32* Key); typedef signed long...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
9
by: Bob Day | last post by:
VS 2003, vb.net , sql msde... I have an application with multiple threads running. Its a telephony application where each thread represents a telephone line. For code that would be the same...
3
by: Jim Lewis | last post by:
I have read several things that state accessing a Web Service through a Query String should work. However, when I try to execute http://localhost/webservice1/service1.asmx/HelloWorld I get the...
5
by: Khalique | last post by:
Hi everyone, I Hope that someone will be able to give me a hint to the solution to my problem. I have developed a web service (vb.net) that needs to access the folders / files and copy files to...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
3
by: judy.j.miller | last post by:
Does anyone know why i can't access a form element value using dot notation in firefox, when i'm in a function. Works ok in the body. I'm trying to do this: var FarTemp = faren.temp.value; I...
0
by: Roger Stoller | last post by:
Hello. I have developed a COM object using ATL. It seems to work fine when accessing it from VB.NET most of the time. However, I want to use a delegate in VB to asynchronously run a method in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.