[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

moakley7842

9/24/2008 8:53:00 PM

I have a COM component written in C# that was built using Visual
Studio 2008. Each time I try to register it I get the following:

regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
Microsoft (R) .NET Framework Assembly Registration Utility
2.0.50727.1433
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully
Type 'A' exported.
Type 'A' exported.
Assembly exported to 'MyCOM.COM.tlb', and the type library was
registered successfully.

As you can see the types exported are wrong. Cannot be accessed from
unmanaged code. Any suggestions on what I can try?
Mike...
7 Answers

Family Tree Mike

9/25/2008 11:33:00 AM

0

Actually, no, I cannot see that the types are wrong, though type 'A' does not
seem meaningful. What types did you export for COM, and how did you export
them?

"moakley7842@gmail.com" wrote:

> I have a COM component written in C# that was built using Visual
> Studio 2008. Each time I try to register it I get the following:
>
> regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
> Microsoft (R) .NET Framework Assembly Registration Utility
> 2.0.50727.1433
> Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
>
> Types registered successfully
> Type 'A' exported.
> Type 'A' exported.
> Assembly exported to 'MyCOM.COM.tlb', and the type library was
> registered successfully.
>
> As you can see the types exported are wrong. Cannot be accessed from
> unmanaged code. Any suggestions on what I can try?
> Mike...
>

moakley7842

9/25/2008 3:22:00 PM

0

Type 'A' is not meaningful. As it was with 1.1 I expected the types
exported to reflect the names of the interface and class that
implements the interface. I am using the regasm argument /
tlb:MyCOM.tlb to export. The original post contains the command
used. I have used tlbexp.exe and received the same output.
Thanks, Mike...

On Sep 25, 7:33 am, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.com> wrote:
> Actually, no, I cannot see that the types are wrong, though type 'A' does not
> seem meaningful.  What types did you export for COM, and how did you export
> them?
>
>
>
> "moakley7...@gmail.com" wrote:
> > I have a COM component written in C# that was built using Visual
> > Studio 2008.  Each time I try to register it I get the following:
>
> > regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
> > Microsoft (R) .NET Framework Assembly Registration Utility
> > 2.0.50727.1433
> > Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.
>
> > Types registered successfully
> > Type 'A' exported.
> > Type 'A' exported.
> > Assembly exported to 'MyCOM.COM.tlb', and the type library was
> > registered successfully.
>
> > As you can see the types exported are wrong.  Cannot be accessed from
> > unmanaged code.  Any suggestions on what I can try?
> > Mike...- Hide quoted text -
>
> - Show quoted text -

Family Tree Mike

9/25/2008 5:03:00 PM

0

I already understood what you did with regasm. What I was trying to ask was
related to your source code how do you export for COM. One method is
checking the box in the project properties to "Register for COM Interop".
The second way would be to attribute the classes desired for COM. Something
like this:

[Guid("some guid")]
public interface IMyInterface
{
void DoSomething();
}

[ProgId("ProjectName.ClassName")]
[Guid("some guid")]
[ClassInterface(ClassInterfaceType.None)]
public MyClass : IMyInterface
{
public void DoSomething()
{
// Implementation here.
}
}


"moakley7842@gmail.com" wrote:

> Type 'A' is not meaningful. As it was with 1.1 I expected the types
> exported to reflect the names of the interface and class that
> implements the interface. I am using the regasm argument /
> tlb:MyCOM.tlb to export. The original post contains the command
> used. I have used tlbexp.exe and received the same output.
> Thanks, Mike...
>
> On Sep 25, 7:33 am, Family Tree Mike
> <FamilyTreeM...@discussions.microsoft.com> wrote:
> > Actually, no, I cannot see that the types are wrong, though type 'A' does not
> > seem meaningful. What types did you export for COM, and how did you export
> > them?
> >
> >
> >
> > "moakley7...@gmail.com" wrote:
> > > I have a COM component written in C# that was built using Visual
> > > Studio 2008. Each time I try to register it I get the following:
> >
> > > regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
> > > Microsoft (R) .NET Framework Assembly Registration Utility
> > > 2.0.50727.1433
> > > Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
> >
> > > Types registered successfully
> > > Type 'A' exported.
> > > Type 'A' exported.
> > > Assembly exported to 'MyCOM.COM.tlb', and the type library was
> > > registered successfully.
> >
> > > As you can see the types exported are wrong. Cannot be accessed from
> > > unmanaged code. Any suggestions on what I can try?
> > > Mike...- Hide quoted text -
> >
> > - Show quoted text -
>
>

ormico

9/25/2008 7:58:00 PM

0

This might be a dumb question, but are you using an obfuscator?

"Family Tree Mike" wrote:

> I already understood what you did with regasm. What I was trying to ask was
> related to your source code how do you export for COM. One method is
> checking the box in the project properties to "Register for COM Interop".
> The second way would be to attribute the classes desired for COM. Something
> like this:
>
> [Guid("some guid")]
> public interface IMyInterface
> {
> void DoSomething();
> }
>
> [ProgId("ProjectName.ClassName")]
> [Guid("some guid")]
> [ClassInterface(ClassInterfaceType.None)]
> public MyClass : IMyInterface
> {
> public void DoSomething()
> {
> // Implementation here.
> }
> }
>
>
> "moakley7842@gmail.com" wrote:
>
> > Type 'A' is not meaningful. As it was with 1.1 I expected the types
> > exported to reflect the names of the interface and class that
> > implements the interface. I am using the regasm argument /
> > tlb:MyCOM.tlb to export. The original post contains the command
> > used. I have used tlbexp.exe and received the same output.
> > Thanks, Mike...
> >
> > On Sep 25, 7:33 am, Family Tree Mike
> > <FamilyTreeM...@discussions.microsoft.com> wrote:
> > > Actually, no, I cannot see that the types are wrong, though type 'A' does not
> > > seem meaningful. What types did you export for COM, and how did you export
> > > them?
> > >
> > >
> > >
> > > "moakley7...@gmail.com" wrote:
> > > > I have a COM component written in C# that was built using Visual
> > > > Studio 2008. Each time I try to register it I get the following:
> > >
> > > > regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
> > > > Microsoft (R) .NET Framework Assembly Registration Utility
> > > > 2.0.50727.1433
> > > > Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
> > >
> > > > Types registered successfully
> > > > Type 'A' exported.
> > > > Type 'A' exported.
> > > > Assembly exported to 'MyCOM.COM.tlb', and the type library was
> > > > registered successfully.
> > >
> > > > As you can see the types exported are wrong. Cannot be accessed from
> > > > unmanaged code. Any suggestions on what I can try?
> > > > Mike...- Hide quoted text -
> > >
> > > - Show quoted text -
> >
> >

moakley7842

9/25/2008 9:23:00 PM

0

Yes I am, but everything public for the interface and class will be
left in clear text. The only public members are methods.


On Sep 25, 3:58 pm, ormico <orm...@discussions.microsoft.com> wrote:
> This might be a dumb question, but are you using an obfuscator?
>
>
>
> "Family Tree Mike" wrote:
> > I already understood what you did with regasm.  What I was trying to ask was
> > related to your source code how do you export for COM.  One method is
> > checking the box in the project properties to "Register for COM Interop".  
> > The second way would be to attribute the classes desired for COM.  Something
> > like this:
>
> > [Guid("some guid")]
> > public interface IMyInterface
> > {
> > void DoSomething();
> > }
>
> > [ProgId("ProjectName.ClassName")]
> > [Guid("some guid")]
> > [ClassInterface(ClassInterfaceType.None)]
> > public MyClass : IMyInterface
> > {
> > public void DoSomething()
> > {
> > // Implementation here.
> > }
> > }
>
> > "moakley7...@gmail.com" wrote:
>
> > > Type 'A' is not meaningful.  As it was with 1.1 I expected the types
> > > exported to reflect the names of the interface and class that
> > > implements the interface.  I am using the regasm argument /
> > > tlb:MyCOM.tlb to export.  The original post contains the command
> > > used.  I have used tlbexp.exe and received the same output.
> > > Thanks, Mike...
>
> > > On Sep 25, 7:33 am, Family Tree Mike
> > > <FamilyTreeM...@discussions.microsoft.com> wrote:
> > > > Actually, no, I cannot see that the types are wrong, though type 'A' does not
> > > > seem meaningful.  What types did you export for COM, and how did you export
> > > > them?
>
> > > > "moakley7...@gmail.com" wrote:
> > > > > I have a COM component written in C# that was built using Visual
> > > > > Studio 2008.  Each time I try to register it I get the following:
>
> > > > > regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
> > > > > Microsoft (R) .NET Framework Assembly Registration Utility
> > > > > 2.0.50727.1433
> > > > > Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.
>
> > > > > Types registered successfully
> > > > > Type 'A' exported.
> > > > > Type 'A' exported.
> > > > > Assembly exported to 'MyCOM.COM.tlb', and the type library was
> > > > > registered successfully.
>
> > > > > As you can see the types exported are wrong.  Cannot be accessed from
> > > > > unmanaged code.  Any suggestions on what I can try?
> > > > > Mike...- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

moakley7842

9/25/2008 9:28:00 PM

0

Thank You for taking the time to reply. Yes I had been using both
method that you suggested. As it turns out it may have been that my
registry was cluttered. I found 2 registered copies, unregistered
both, and then re-registered the current assembly. I am now able to
access it from unmanaged code.
Mike...

On Sep 25, 1:03 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.com> wrote:
> I already understood what you did with regasm.  What I was trying to ask was
> related to your source code how do you export for COM.  One method is
> checking the box in the project properties to "Register for COM Interop".  
> The second way would be to attribute the classes desired for COM.  Something
> like this:
>
> [Guid("some guid")]
> public interface IMyInterface
> {
> void DoSomething();
>
> }
>
> [ProgId("ProjectName.ClassName")]
> [Guid("some guid")]
> [ClassInterface(ClassInterfaceType.None)]
> public MyClass : IMyInterface
> {
> public void DoSomething()
> {
> // Implementation here.
>
>
>
> }
> }
> "moakley7...@gmail.com" wrote:
> > Type 'A' is not meaningful.  As it was with 1.1 I expected the types
> > exported to reflect the names of the interface and class that
> > implements the interface.  I am using the regasm argument /
> > tlb:MyCOM.tlb to export.  The original post contains the command
> > used.  I have used tlbexp.exe and received the same output.
> > Thanks, Mike...
>
> > On Sep 25, 7:33 am, Family Tree Mike
> > <FamilyTreeM...@discussions.microsoft.com> wrote:
> > > Actually, no, I cannot see that the types are wrong, though type 'A' does not
> > > seem meaningful.  What types did you export for COM, and how did you export
> > > them?
>
> > > "moakley7...@gmail.com" wrote:
> > > > I have a COM component written in C# that was built using Visual
> > > > Studio 2008.  Each time I try to register it I get the following:
>
> > > > regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
> > > > Microsoft (R) .NET Framework Assembly Registration Utility
> > > > 2.0.50727.1433
> > > > Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.
>
> > > > Types registered successfully
> > > > Type 'A' exported.
> > > > Type 'A' exported.
> > > > Assembly exported to 'MyCOM.COM.tlb', and the type library was
> > > > registered successfully.
>
> > > > As you can see the types exported are wrong.  Cannot be accessed from
> > > > unmanaged code.  Any suggestions on what I can try?
> > > > Mike...- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

ormico

9/25/2008 9:32:00 PM

0

I would be highly suspicios that it is your obfuscator. It could be a setting
that is wrong or something else.

As an experiment, try running your same test on an unobfuscated copy of your
dll and see if it registers correctly.


"moakley7842@gmail.com" wrote:

> Yes I am, but everything public for the interface and class will be
> left in clear text. The only public members are methods.
>
>
> On Sep 25, 3:58 pm, ormico <orm...@discussions.microsoft.com> wrote:
> > This might be a dumb question, but are you using an obfuscator?
> >
> >
> >
> > "Family Tree Mike" wrote:
> > > I already understood what you did with regasm. What I was trying to ask was
> > > related to your source code how do you export for COM. One method is
> > > checking the box in the project properties to "Register for COM Interop".
> > > The second way would be to attribute the classes desired for COM. Something
> > > like this:
> >
> > > [Guid("some guid")]
> > > public interface IMyInterface
> > > {
> > > void DoSomething();
> > > }
> >
> > > [ProgId("ProjectName.ClassName")]
> > > [Guid("some guid")]
> > > [ClassInterface(ClassInterfaceType.None)]
> > > public MyClass : IMyInterface
> > > {
> > > public void DoSomething()
> > > {
> > > // Implementation here.
> > > }
> > > }
> >
> > > "moakley7...@gmail.com" wrote:
> >
> > > > Type 'A' is not meaningful. As it was with 1.1 I expected the types
> > > > exported to reflect the names of the interface and class that
> > > > implements the interface. I am using the regasm argument /
> > > > tlb:MyCOM.tlb to export. The original post contains the command
> > > > used. I have used tlbexp.exe and received the same output.
> > > > Thanks, Mike...
> >
> > > > On Sep 25, 7:33 am, Family Tree Mike
> > > > <FamilyTreeM...@discussions.microsoft.com> wrote:
> > > > > Actually, no, I cannot see that the types are wrong, though type 'A' does not
> > > > > seem meaningful. What types did you export for COM, and how did you export
> > > > > them?
> >
> > > > > "moakley7...@gmail.com" wrote:
> > > > > > I have a COM component written in C# that was built using Visual
> > > > > > Studio 2008. Each time I try to register it I get the following:
> >
> > > > > > regasm.exe MyCOM.dll /tlb:MyCOM.tlb /codebase /v
> > > > > > Microsoft (R) .NET Framework Assembly Registration Utility
> > > > > > 2.0.50727.1433
> > > > > > Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
> >
> > > > > > Types registered successfully
> > > > > > Type 'A' exported.
> > > > > > Type 'A' exported.
> > > > > > Assembly exported to 'MyCOM.COM.tlb', and the type library was
> > > > > > registered successfully.
> >
> > > > > > As you can see the types exported are wrong. Cannot be accessed from
> > > > > > unmanaged code. Any suggestions on what I can try?
> > > > > > Mike...- Hide quoted text -
> >
> > > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
>