Google Groups Home
Help | Sign in
Why can I only create the following COM control when it is in the GAC?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
markscottwright  
View profile
 More options Aug 27 2008, 8:51 am
From: markscottwright <markscottwri...@gmail.com>
Date: Tue, 26 Aug 2008 14:51:43 -0700 (PDT)
Local: Wed, Aug 27 2008 8:51 am
Subject: Why can I only create the following COM control when it is in the GAC?
If I use the following commands on the code at the bottom, I get an
error (0x80070002) when I try to CoCreateClass (ether from within OLE/
COM viewer or with python's win32com library):

    csc /target:library /r:mscorlib.dll /r:System.Windows.Forms.dll /
out:TestKeyManagement.dll TestKeyManagement.cs
    regasm TestKeyManagement.dll /tlb

But this works:

    csc /keyfile:TestKeyManagementKeyPair.snk /target:library /
r:System.Windows.Forms.dll /out:TestKeyManagement.dll
TestKeyManagement.cs
    regasm TestKeyManagement.dll /tlb
    gacutil -i TestKeyManagement.dll

Can anyone explain why?

========
TestKeyManagement.cs
========
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyDescription("TestKeyManagement 1.0 Type Library")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: Guid("0E84DDE2-A6FC-45de-8B15-3916FFB932BC")]

[Guid("17FB4DE2-1ECB-4cb2-A043-A2D751B16A3B"),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface ITestKeyManagement {
    [DispId(1)] void ManageKeys();

}

[ClassInterface(ClassInterfaceType.None)]
[ProgId("dcc.TestKeyManagement.1")]
[Guid("F2A67839-01DE-43c3-A402-4765CF25ED51")]
public class TestKeyManagement : ITestKeyManagement {
    public void ManageKeys() {
        MessageBox.Show("I'm managing keys from within C#");
    }


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google