Hello,
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.

I use the code as follow:
_NewActivationPtr myActivation = NULL;

HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaActivation));

I don't what to do.

Do I have to use GACUtil to register?

If I want to use GACUtil do I have to sign my project?

Trying do it had failed, because my third party library I'm using in my C#
dll is not signed (so if I choose to sign my project, there is a compilation
error, caused because the 3rd party library is not signed, I guess).

Please help,

Thanks,

Janiv Ratson.

Re: Using C# dll as COM in an MFC application by Ignacio

Ignacio
Thu Aug 17 14:07:43 CDT 2006

Hi,


In addition to DePalo post take a look at the latest number of MSDN
magazine, it has one article about that precise subject.


--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



"Janiv Ratson" <janivr@gmailcom> wrote in message
news:uEQeuihwGHA.3996@TK2MSFTNGP03.phx.gbl...
> Hello,
> I have written a C# dll in VS2005.
> One interface and class are exported using Interop Services.
> I want to use this c# dll in my MFC application, using VS2003.
> It compiles after I imported the dll to my MFC app.
> On runtime I get class not registered HR error in my MFC project.
>
> I use the code as follow:
> _NewActivationPtr myActivation = NULL;
>
> HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaActivation));
>
> I don't what to do.
>
> Do I have to use GACUtil to register?
>
> If I want to use GACUtil do I have to sign my project?
>
> Trying do it had failed, because my third party library I'm using in my C#
> dll is not signed (so if I choose to sign my project, there is a
> compilation error, caused because the 3rd party library is not signed, I
> guess).
>
> Please help,
>
> Thanks,
>
> Janiv Ratson.
>
>



RE: Using C# dll as COM in an MFC application by KimGreenlee

KimGreenlee
Thu Aug 17 14:45:04 CDT 2006

Janiv,

Did you check the registry to make sure that the COM interfaces were
actually registered?

Run Regedit.exe and then search on NewSupernaActivation or the name of your
DLL. If you don't find it then it's not registered and that is your problem.
You'll need to run regasm.exe to register the DLL.

Kim

--
digipede - Many legs make light work.
Grid computing for the real world.
http://www.digipede.net
http://krgreenlee.blogspot.net



Re: Using C# dll as COM in an MFC application by Dr

Dr
Thu Aug 17 17:28:20 CDT 2006

Did you RegAsm the Assembly? Importing may register only the type library.

"Janiv Ratson" <janivr@gmailcom> wrote in message
news:uEQeuihwGHA.3996@TK2MSFTNGP03.phx.gbl...
> Hello,
> I have written a C# dll in VS2005.
> One interface and class are exported using Interop Services.
> I want to use this c# dll in my MFC application, using VS2003.
> It compiles after I imported the dll to my MFC app.
> On runtime I get class not registered HR error in my MFC project.
>
> I use the code as follow:
> _NewActivationPtr myActivation = NULL;
>
> HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaActivation));
>
> I don't what to do.
>
> Do I have to use GACUtil to register?
>
> If I want to use GACUtil do I have to sign my project?
>
> Trying do it had failed, because my third party library I'm using in my C#
> dll is not signed (so if I choose to sign my project, there is a
> compilation error, caused because the 3rd party library is not signed, I
> guess).
>
> Please help,
>
> Thanks,
>
> Janiv Ratson.
>
>



Re: Using C# dll as COM in an MFC application by Janiv

Janiv
Sun Aug 20 03:03:24 CDT 2006

Hello all and thanks for your help.
I have registered my dll using regasm.exe.
I can find the NewSupernaActivation in the registry under CLSID.
Still I get Class not registered in my code.
Please help.
Thanks,
Janiv Ratson.

"Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in message
news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
> Janiv,
>
> Did you check the registry to make sure that the COM interfaces were
> actually registered?
>
> Run Regedit.exe and then search on NewSupernaActivation or the name of
> your
> DLL. If you don't find it then it's not registered and that is your
> problem.
> You'll need to run regasm.exe to register the DLL.
>
> Kim
>
> --
> digipede - Many legs make light work.
> Grid computing for the real world.
> http://www.digipede.net
> http://krgreenlee.blogspot.net
>
>



Re: Using C# dll as COM in an MFC application by Dr

Dr
Sun Aug 20 02:33:19 CDT 2006

Did you try RegAsm /Codebase.

Eventuall POST the registry Settings under the CLSID here for inspection.
You can check yourself if there are multiple keys below InprocServer32 of
your component. If so remove the CLSID entry of your component, make sure
that the assembly version in AssemblyInfo.cs does not use auto-increment
(1.0.0.1 instead of the VS.NET 2003 default 1.0.*) and RegAsm /Codebase the
assembly again.

Jochen

"Janiv Ratson" <janivr@gmailcom> wrote in message
news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
> Hello all and thanks for your help.
> I have registered my dll using regasm.exe.
> I can find the NewSupernaActivation in the registry under CLSID.
> Still I get Class not registered in my code.
> Please help.
> Thanks,
> Janiv Ratson.
>
> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in message
> news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>> Janiv,
>>
>> Did you check the registry to make sure that the COM interfaces were
>> actually registered?
>>
>> Run Regedit.exe and then search on NewSupernaActivation or the name of
>> your
>> DLL. If you don't find it then it's not registered and that is your
>> problem.
>> You'll need to run regasm.exe to register the DLL.
>>
>> Kim
>>
>> --
>> digipede - Many legs make light work.
>> Grid computing for the real world.
>> http://www.digipede.net
>> http://krgreenlee.blogspot.net
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Janiv

Janiv
Sun Aug 20 04:06:48 CDT 2006

Hello Dr. Manns and all,
In order to regasm my dll using /code base, I need my assembly to be signed.
Hoever, my assembly uses 3rd party assembly, which is not signed, and
therefor I my assembly cannot be signed.
Is there any other solution?
Thanks a lot,
Janiv Ratson.

"Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
news:44e81037$0$2192$9b622d9e@news.freenet.de...
> Did you try RegAsm /Codebase.
>
> Eventuall POST the registry Settings under the CLSID here for inspection.
> You can check yourself if there are multiple keys below InprocServer32 of
> your component. If so remove the CLSID entry of your component, make sure
> that the assembly version in AssemblyInfo.cs does not use auto-increment
> (1.0.0.1 instead of the VS.NET 2003 default 1.0.*) and RegAsm /Codebase
> the assembly again.
>
> Jochen
>
> "Janiv Ratson" <janivr@gmailcom> wrote in message
> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>> Hello all and thanks for your help.
>> I have registered my dll using regasm.exe.
>> I can find the NewSupernaActivation in the registry under CLSID.
>> Still I get Class not registered in my code.
>> Please help.
>> Thanks,
>> Janiv Ratson.
>>
>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in message
>> news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>> Janiv,
>>>
>>> Did you check the registry to make sure that the COM interfaces were
>>> actually registered?
>>>
>>> Run Regedit.exe and then search on NewSupernaActivation or the name of
>>> your
>>> DLL. If you don't find it then it's not registered and that is your
>>> problem.
>>> You'll need to run regasm.exe to register the DLL.
>>>
>>> Kim
>>>
>>> --
>>> digipede - Many legs make light work.
>>> Grid computing for the real world.
>>> http://www.digipede.net
>>> http://krgreenlee.blogspot.net
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Dr

Dr
Sun Aug 20 03:55:29 CDT 2006

Are you sure? I thought that this message is only a warning.

RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase
can ca...
use your assembly to interfere with other applications that may be installed
on
the same computer. The /codebase switch is intended to be used only with
signed
assemblies. Please give your assembly a strong name and re-register it.

"Janiv Ratson" <janivr@gmailcom> wrote in message
news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
> Hello Dr. Manns and all,
> In order to regasm my dll using /code base, I need my assembly to be
> signed.
> Hoever, my assembly uses 3rd party assembly, which is not signed, and
> therefor I my assembly cannot be signed.
> Is there any other solution?
> Thanks a lot,
> Janiv Ratson.
>
> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>> Did you try RegAsm /Codebase.
>>
>> Eventuall POST the registry Settings under the CLSID here for inspection.
>> You can check yourself if there are multiple keys below InprocServer32 of
>> your component. If so remove the CLSID entry of your component, make sure
>> that the assembly version in AssemblyInfo.cs does not use auto-increment
>> (1.0.0.1 instead of the VS.NET 2003 default 1.0.*) and RegAsm /Codebase
>> the assembly again.
>>
>> Jochen
>>
>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>> Hello all and thanks for your help.
>>> I have registered my dll using regasm.exe.
>>> I can find the NewSupernaActivation in the registry under CLSID.
>>> Still I get Class not registered in my code.
>>> Please help.
>>> Thanks,
>>> Janiv Ratson.
>>>
>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in message
>>> news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>> Janiv,
>>>>
>>>> Did you check the registry to make sure that the COM interfaces were
>>>> actually registered?
>>>>
>>>> Run Regedit.exe and then search on NewSupernaActivation or the name of
>>>> your
>>>> DLL. If you don't find it then it's not registered and that is your
>>>> problem.
>>>> You'll need to run regasm.exe to register the DLL.
>>>>
>>>> Kim
>>>>
>>>> --
>>>> digipede - Many legs make light work.
>>>> Grid computing for the real world.
>>>> http://www.digipede.net
>>>> http://krgreenlee.blogspot.net
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Janiv

Janiv
Sun Aug 20 07:11:05 CDT 2006

Is it a warning we can live with ?
Thanks,
Janiv Ratson.

"Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
news:44e82376$0$10375$9b622d9e@news.freenet.de...
> Are you sure? I thought that this message is only a warning.
>
> RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase
> can ca...
> use your assembly to interfere with other applications that may be
> installed on
> the same computer. The /codebase switch is intended to be used only with
> signed
> assemblies. Please give your assembly a strong name and re-register it.
>
> "Janiv Ratson" <janivr@gmailcom> wrote in message
> news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
>> Hello Dr. Manns and all,
>> In order to regasm my dll using /code base, I need my assembly to be
>> signed.
>> Hoever, my assembly uses 3rd party assembly, which is not signed, and
>> therefor I my assembly cannot be signed.
>> Is there any other solution?
>> Thanks a lot,
>> Janiv Ratson.
>>
>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>>> Did you try RegAsm /Codebase.
>>>
>>> Eventuall POST the registry Settings under the CLSID here for
>>> inspection. You can check yourself if there are multiple keys below
>>> InprocServer32 of your component. If so remove the CLSID entry of your
>>> component, make sure that the assembly version in AssemblyInfo.cs does
>>> not use auto-increment (1.0.0.1 instead of the VS.NET 2003 default
>>> 1.0.*) and RegAsm /Codebase the assembly again.
>>>
>>> Jochen
>>>
>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>>> Hello all and thanks for your help.
>>>> I have registered my dll using regasm.exe.
>>>> I can find the NewSupernaActivation in the registry under CLSID.
>>>> Still I get Class not registered in my code.
>>>> Please help.
>>>> Thanks,
>>>> Janiv Ratson.
>>>>
>>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in message
>>>> news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>>> Janiv,
>>>>>
>>>>> Did you check the registry to make sure that the COM interfaces were
>>>>> actually registered?
>>>>>
>>>>> Run Regedit.exe and then search on NewSupernaActivation or the name of
>>>>> your
>>>>> DLL. If you don't find it then it's not registered and that is your
>>>>> problem.
>>>>> You'll need to run regasm.exe to register the DLL.
>>>>>
>>>>> Kim
>>>>>
>>>>> --
>>>>> digipede - Many legs make light work.
>>>>> Grid computing for the real world.
>>>>> http://www.digipede.net
>>>>> http://krgreenlee.blogspot.net
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Dr

Dr
Sun Aug 20 07:02:07 CDT 2006

Well - your choice, finally. In this special case: using a strongly names
assembly makes sure that no one tamperes with it. And registering something
as COM open wide access to the component on the system - no way for further
security verifications the assembly will have full trust. Personally (not
more) I can think there are scenarios where you can live with it. Yes,
indeed you losse .NET / CLR security but if someone is able to replace a DLL
on a system in most (s)he can choose to patch the registration to a modified
DLL anyway.

No more help to expect from this side, sorry :-) But actually: does it work
after the RegAsm /Codebase?

Bye

Jochen

"Janiv Ratson" <janivr@gmailcom> wrote in message
news:OGR6elExGHA.2208@TK2MSFTNGP04.phx.gbl...
> Is it a warning we can live with ?
> Thanks,
> Janiv Ratson.
>
> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
> news:44e82376$0$10375$9b622d9e@news.freenet.de...
>> Are you sure? I thought that this message is only a warning.
>>
>> RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase
>> can ca...
>> use your assembly to interfere with other applications that may be
>> installed on
>> the same computer. The /codebase switch is intended to be used only with
>> signed
>> assemblies. Please give your assembly a strong name and re-register it.
>>
>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>> news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
>>> Hello Dr. Manns and all,
>>> In order to regasm my dll using /code base, I need my assembly to be
>>> signed.
>>> Hoever, my assembly uses 3rd party assembly, which is not signed, and
>>> therefor I my assembly cannot be signed.
>>> Is there any other solution?
>>> Thanks a lot,
>>> Janiv Ratson.
>>>
>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>>>> Did you try RegAsm /Codebase.
>>>>
>>>> Eventuall POST the registry Settings under the CLSID here for
>>>> inspection. You can check yourself if there are multiple keys below
>>>> InprocServer32 of your component. If so remove the CLSID entry of your
>>>> component, make sure that the assembly version in AssemblyInfo.cs does
>>>> not use auto-increment (1.0.0.1 instead of the VS.NET 2003 default
>>>> 1.0.*) and RegAsm /Codebase the assembly again.
>>>>
>>>> Jochen
>>>>
>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>>>> Hello all and thanks for your help.
>>>>> I have registered my dll using regasm.exe.
>>>>> I can find the NewSupernaActivation in the registry under CLSID.
>>>>> Still I get Class not registered in my code.
>>>>> Please help.
>>>>> Thanks,
>>>>> Janiv Ratson.
>>>>>
>>>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in
>>>>> message news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>>>> Janiv,
>>>>>>
>>>>>> Did you check the registry to make sure that the COM interfaces were
>>>>>> actually registered?
>>>>>>
>>>>>> Run Regedit.exe and then search on NewSupernaActivation or the name
>>>>>> of your
>>>>>> DLL. If you don't find it then it's not registered and that is your
>>>>>> problem.
>>>>>> You'll need to run regasm.exe to register the DLL.
>>>>>>
>>>>>> Kim
>>>>>>
>>>>>> --
>>>>>> digipede - Many legs make light work.
>>>>>> Grid computing for the real world.
>>>>>> http://www.digipede.net
>>>>>> http://krgreenlee.blogspot.net
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Janiv

Janiv
Sun Aug 20 08:27:38 CDT 2006

Yes it works.
Thanks,
J.
"Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
news:44e84f34$0$10391$9b622d9e@news.freenet.de...
> Well - your choice, finally. In this special case: using a strongly names
> assembly makes sure that no one tamperes with it. And registering
> something as COM open wide access to the component on the system - no way
> for further security verifications the assembly will have full trust.
> Personally (not more) I can think there are scenarios where you can live
> with it. Yes, indeed you losse .NET / CLR security but if someone is able
> to replace a DLL on a system in most (s)he can choose to patch the
> registration to a modified DLL anyway.
>
> No more help to expect from this side, sorry :-) But actually: does it
> work after the RegAsm /Codebase?
>
> Bye
>
> Jochen
>
> "Janiv Ratson" <janivr@gmailcom> wrote in message
> news:OGR6elExGHA.2208@TK2MSFTNGP04.phx.gbl...
>> Is it a warning we can live with ?
>> Thanks,
>> Janiv Ratson.
>>
>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>> news:44e82376$0$10375$9b622d9e@news.freenet.de...
>>> Are you sure? I thought that this message is only a warning.
>>>
>>> RegAsm : warning RA0000 : Registering an unsigned assembly with
>>> /codebase can ca...
>>> use your assembly to interfere with other applications that may be
>>> installed on
>>> the same computer. The /codebase switch is intended to be used only with
>>> signed
>>> assemblies. Please give your assembly a strong name and re-register it.
>>>
>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>> news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
>>>> Hello Dr. Manns and all,
>>>> In order to regasm my dll using /code base, I need my assembly to be
>>>> signed.
>>>> Hoever, my assembly uses 3rd party assembly, which is not signed, and
>>>> therefor I my assembly cannot be signed.
>>>> Is there any other solution?
>>>> Thanks a lot,
>>>> Janiv Ratson.
>>>>
>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>>>>> Did you try RegAsm /Codebase.
>>>>>
>>>>> Eventuall POST the registry Settings under the CLSID here for
>>>>> inspection. You can check yourself if there are multiple keys below
>>>>> InprocServer32 of your component. If so remove the CLSID entry of your
>>>>> component, make sure that the assembly version in AssemblyInfo.cs does
>>>>> not use auto-increment (1.0.0.1 instead of the VS.NET 2003 default
>>>>> 1.0.*) and RegAsm /Codebase the assembly again.
>>>>>
>>>>> Jochen
>>>>>
>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>>>>> Hello all and thanks for your help.
>>>>>> I have registered my dll using regasm.exe.
>>>>>> I can find the NewSupernaActivation in the registry under CLSID.
>>>>>> Still I get Class not registered in my code.
>>>>>> Please help.
>>>>>> Thanks,
>>>>>> Janiv Ratson.
>>>>>>
>>>>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in
>>>>>> message news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>>>>> Janiv,
>>>>>>>
>>>>>>> Did you check the registry to make sure that the COM interfaces were
>>>>>>> actually registered?
>>>>>>>
>>>>>>> Run Regedit.exe and then search on NewSupernaActivation or the name
>>>>>>> of your
>>>>>>> DLL. If you don't find it then it's not registered and that is your
>>>>>>> problem.
>>>>>>> You'll need to run regasm.exe to register the DLL.
>>>>>>>
>>>>>>> Kim
>>>>>>>
>>>>>>> --
>>>>>>> digipede - Many legs make light work.
>>>>>>> Grid computing for the real world.
>>>>>>> http://www.digipede.net
>>>>>>> http://krgreenlee.blogspot.net
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Janiv

Janiv
Sun Aug 20 10:42:12 CDT 2006

Hi,
It is now created but could not run due to "Could not load file or assembly
'3rd party assembly' exception.
I guess I haven't completed the action as required.
Any ideas?
Thanks.
J.
"Janiv Ratson" <janivr@gmailcom> wrote in message
news:e8deQQFxGHA.3904@TK2MSFTNGP02.phx.gbl...
> Yes it works.
> Thanks,
> J.
> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
> news:44e84f34$0$10391$9b622d9e@news.freenet.de...
>> Well - your choice, finally. In this special case: using a strongly names
>> assembly makes sure that no one tamperes with it. And registering
>> something as COM open wide access to the component on the system - no way
>> for further security verifications the assembly will have full trust.
>> Personally (not more) I can think there are scenarios where you can live
>> with it. Yes, indeed you losse .NET / CLR security but if someone is able
>> to replace a DLL on a system in most (s)he can choose to patch the
>> registration to a modified DLL anyway.
>>
>> No more help to expect from this side, sorry :-) But actually: does it
>> work after the RegAsm /Codebase?
>>
>> Bye
>>
>> Jochen
>>
>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>> news:OGR6elExGHA.2208@TK2MSFTNGP04.phx.gbl...
>>> Is it a warning we can live with ?
>>> Thanks,
>>> Janiv Ratson.
>>>
>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>> news:44e82376$0$10375$9b622d9e@news.freenet.de...
>>>> Are you sure? I thought that this message is only a warning.
>>>>
>>>> RegAsm : warning RA0000 : Registering an unsigned assembly with
>>>> /codebase can ca...
>>>> use your assembly to interfere with other applications that may be
>>>> installed on
>>>> the same computer. The /codebase switch is intended to be used only
>>>> with signed
>>>> assemblies. Please give your assembly a strong name and re-register it.
>>>>
>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>> news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
>>>>> Hello Dr. Manns and all,
>>>>> In order to regasm my dll using /code base, I need my assembly to be
>>>>> signed.
>>>>> Hoever, my assembly uses 3rd party assembly, which is not signed, and
>>>>> therefor I my assembly cannot be signed.
>>>>> Is there any other solution?
>>>>> Thanks a lot,
>>>>> Janiv Ratson.
>>>>>
>>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>>> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>>>>>> Did you try RegAsm /Codebase.
>>>>>>
>>>>>> Eventuall POST the registry Settings under the CLSID here for
>>>>>> inspection. You can check yourself if there are multiple keys below
>>>>>> InprocServer32 of your component. If so remove the CLSID entry of
>>>>>> your component, make sure that the assembly version in
>>>>>> AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of the
>>>>>> VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly again.
>>>>>>
>>>>>> Jochen
>>>>>>
>>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>>>>>> Hello all and thanks for your help.
>>>>>>> I have registered my dll using regasm.exe.
>>>>>>> I can find the NewSupernaActivation in the registry under CLSID.
>>>>>>> Still I get Class not registered in my code.
>>>>>>> Please help.
>>>>>>> Thanks,
>>>>>>> Janiv Ratson.
>>>>>>>
>>>>>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in
>>>>>>> message news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>>>>>> Janiv,
>>>>>>>>
>>>>>>>> Did you check the registry to make sure that the COM interfaces
>>>>>>>> were
>>>>>>>> actually registered?
>>>>>>>>
>>>>>>>> Run Regedit.exe and then search on NewSupernaActivation or the name
>>>>>>>> of your
>>>>>>>> DLL. If you don't find it then it's not registered and that is
>>>>>>>> your problem.
>>>>>>>> You'll need to run regasm.exe to register the DLL.
>>>>>>>>
>>>>>>>> Kim
>>>>>>>>
>>>>>>>> --
>>>>>>>> digipede - Many legs make light work.
>>>>>>>> Grid computing for the real world.
>>>>>>>> http://www.digipede.net
>>>>>>>> http://krgreenlee.blogspot.net
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Dr

Dr
Sun Aug 20 10:20:37 CDT 2006

Hmm, hope that this is not a .NET 2.0 security feature which correlates with
the RegAsm warning.

Check InProgServer32 Codebase and make sure, that all required files are in
this directory. Eventually (?) the assembly requires more legacy (win32)
DLLs in this directory or the system search path.

"Janiv Ratson" <janivr@gmailcom> wrote in message
news:euf1cbGxGHA.4752@TK2MSFTNGP02.phx.gbl...
> Hi,
> It is now created but could not run due to "Could not load file or
> assembly '3rd party assembly' exception.
> I guess I haven't completed the action as required.
> Any ideas?
> Thanks.
> J.
> "Janiv Ratson" <janivr@gmailcom> wrote in message
> news:e8deQQFxGHA.3904@TK2MSFTNGP02.phx.gbl...
>> Yes it works.
>> Thanks,
>> J.
>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>> news:44e84f34$0$10391$9b622d9e@news.freenet.de...
>>> Well - your choice, finally. In this special case: using a strongly
>>> names assembly makes sure that no one tamperes with it. And registering
>>> something as COM open wide access to the component on the system - no
>>> way for further security verifications the assembly will have full
>>> trust. Personally (not more) I can think there are scenarios where you
>>> can live with it. Yes, indeed you losse .NET / CLR security but if
>>> someone is able to replace a DLL on a system in most (s)he can choose to
>>> patch the registration to a modified DLL anyway.
>>>
>>> No more help to expect from this side, sorry :-) But actually: does it
>>> work after the RegAsm /Codebase?
>>>
>>> Bye
>>>
>>> Jochen
>>>
>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>> news:OGR6elExGHA.2208@TK2MSFTNGP04.phx.gbl...
>>>> Is it a warning we can live with ?
>>>> Thanks,
>>>> Janiv Ratson.
>>>>
>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>> news:44e82376$0$10375$9b622d9e@news.freenet.de...
>>>>> Are you sure? I thought that this message is only a warning.
>>>>>
>>>>> RegAsm : warning RA0000 : Registering an unsigned assembly with
>>>>> /codebase can ca...
>>>>> use your assembly to interfere with other applications that may be
>>>>> installed on
>>>>> the same computer. The /codebase switch is intended to be used only
>>>>> with signed
>>>>> assemblies. Please give your assembly a strong name and re-register
>>>>> it.
>>>>>
>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>> news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
>>>>>> Hello Dr. Manns and all,
>>>>>> In order to regasm my dll using /code base, I need my assembly to be
>>>>>> signed.
>>>>>> Hoever, my assembly uses 3rd party assembly, which is not signed, and
>>>>>> therefor I my assembly cannot be signed.
>>>>>> Is there any other solution?
>>>>>> Thanks a lot,
>>>>>> Janiv Ratson.
>>>>>>
>>>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>>>> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>>>>>>> Did you try RegAsm /Codebase.
>>>>>>>
>>>>>>> Eventuall POST the registry Settings under the CLSID here for
>>>>>>> inspection. You can check yourself if there are multiple keys below
>>>>>>> InprocServer32 of your component. If so remove the CLSID entry of
>>>>>>> your component, make sure that the assembly version in
>>>>>>> AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of the
>>>>>>> VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly again.
>>>>>>>
>>>>>>> Jochen
>>>>>>>
>>>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>>>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>>>>>>> Hello all and thanks for your help.
>>>>>>>> I have registered my dll using regasm.exe.
>>>>>>>> I can find the NewSupernaActivation in the registry under CLSID.
>>>>>>>> Still I get Class not registered in my code.
>>>>>>>> Please help.
>>>>>>>> Thanks,
>>>>>>>> Janiv Ratson.
>>>>>>>>
>>>>>>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in
>>>>>>>> message news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>>>>>>> Janiv,
>>>>>>>>>
>>>>>>>>> Did you check the registry to make sure that the COM interfaces
>>>>>>>>> were
>>>>>>>>> actually registered?
>>>>>>>>>
>>>>>>>>> Run Regedit.exe and then search on NewSupernaActivation or the
>>>>>>>>> name of your
>>>>>>>>> DLL. If you don't find it then it's not registered and that is
>>>>>>>>> your problem.
>>>>>>>>> You'll need to run regasm.exe to register the DLL.
>>>>>>>>>
>>>>>>>>> Kim
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> digipede - Many legs make light work.
>>>>>>>>> Grid computing for the real world.
>>>>>>>>> http://www.digipede.net
>>>>>>>>> http://krgreenlee.blogspot.net
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Janiv

Janiv
Sun Aug 20 11:41:04 CDT 2006

How do I use InProgServer32 ?
All required files are in the same folder.
Thanks.

"Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
news:44e87dba$0$8285$9b622d9e@news.freenet.de...
> Hmm, hope that this is not a .NET 2.0 security feature which correlates
> with the RegAsm warning.
>
> Check InProgServer32 Codebase and make sure, that all required files are
> in this directory. Eventually (?) the assembly requires more legacy
> (win32) DLLs in this directory or the system search path.
>
> "Janiv Ratson" <janivr@gmailcom> wrote in message
> news:euf1cbGxGHA.4752@TK2MSFTNGP02.phx.gbl...
>> Hi,
>> It is now created but could not run due to "Could not load file or
>> assembly '3rd party assembly' exception.
>> I guess I haven't completed the action as required.
>> Any ideas?
>> Thanks.
>> J.
>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>> news:e8deQQFxGHA.3904@TK2MSFTNGP02.phx.gbl...
>>> Yes it works.
>>> Thanks,
>>> J.
>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>> news:44e84f34$0$10391$9b622d9e@news.freenet.de...
>>>> Well - your choice, finally. In this special case: using a strongly
>>>> names assembly makes sure that no one tamperes with it. And registering
>>>> something as COM open wide access to the component on the system - no
>>>> way for further security verifications the assembly will have full
>>>> trust. Personally (not more) I can think there are scenarios where you
>>>> can live with it. Yes, indeed you losse .NET / CLR security but if
>>>> someone is able to replace a DLL on a system in most (s)he can choose
>>>> to patch the registration to a modified DLL anyway.
>>>>
>>>> No more help to expect from this side, sorry :-) But actually: does it
>>>> work after the RegAsm /Codebase?
>>>>
>>>> Bye
>>>>
>>>> Jochen
>>>>
>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>> news:OGR6elExGHA.2208@TK2MSFTNGP04.phx.gbl...
>>>>> Is it a warning we can live with ?
>>>>> Thanks,
>>>>> Janiv Ratson.
>>>>>
>>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>>> news:44e82376$0$10375$9b622d9e@news.freenet.de...
>>>>>> Are you sure? I thought that this message is only a warning.
>>>>>>
>>>>>> RegAsm : warning RA0000 : Registering an unsigned assembly with
>>>>>> /codebase can ca...
>>>>>> use your assembly to interfere with other applications that may be
>>>>>> installed on
>>>>>> the same computer. The /codebase switch is intended to be used only
>>>>>> with signed
>>>>>> assemblies. Please give your assembly a strong name and re-register
>>>>>> it.
>>>>>>
>>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>>> news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
>>>>>>> Hello Dr. Manns and all,
>>>>>>> In order to regasm my dll using /code base, I need my assembly to be
>>>>>>> signed.
>>>>>>> Hoever, my assembly uses 3rd party assembly, which is not signed,
>>>>>>> and therefor I my assembly cannot be signed.
>>>>>>> Is there any other solution?
>>>>>>> Thanks a lot,
>>>>>>> Janiv Ratson.
>>>>>>>
>>>>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>>>>> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>>>>>>>> Did you try RegAsm /Codebase.
>>>>>>>>
>>>>>>>> Eventuall POST the registry Settings under the CLSID here for
>>>>>>>> inspection. You can check yourself if there are multiple keys below
>>>>>>>> InprocServer32 of your component. If so remove the CLSID entry of
>>>>>>>> your component, make sure that the assembly version in
>>>>>>>> AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of the
>>>>>>>> VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly again.
>>>>>>>>
>>>>>>>> Jochen
>>>>>>>>
>>>>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>>>>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>>>>>>>> Hello all and thanks for your help.
>>>>>>>>> I have registered my dll using regasm.exe.
>>>>>>>>> I can find the NewSupernaActivation in the registry under CLSID.
>>>>>>>>> Still I get Class not registered in my code.
>>>>>>>>> Please help.
>>>>>>>>> Thanks,
>>>>>>>>> Janiv Ratson.
>>>>>>>>>
>>>>>>>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in
>>>>>>>>> message news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>>>>>>>> Janiv,
>>>>>>>>>>
>>>>>>>>>> Did you check the registry to make sure that the COM interfaces
>>>>>>>>>> were
>>>>>>>>>> actually registered?
>>>>>>>>>>
>>>>>>>>>> Run Regedit.exe and then search on NewSupernaActivation or the
>>>>>>>>>> name of your
>>>>>>>>>> DLL. If you don't find it then it's not registered and that is
>>>>>>>>>> your problem.
>>>>>>>>>> You'll need to run regasm.exe to register the DLL.
>>>>>>>>>>
>>>>>>>>>> Kim
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> digipede - Many legs make light work.
>>>>>>>>>> Grid computing for the real world.
>>>>>>>>>> http://www.digipede.net
>>>>>>>>>> http://krgreenlee.blogspot.net
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Using C# dll as COM in an MFC application by Dr

Dr
Sun Aug 20 11:10:22 CDT 2006

Sorry, I ment InprocServer32 in the Registry and there the CodeBase value.

When exactly is the load error reported? If you attach a debugger do you get
any more detailled error (output/trace window or inner exception)? Can you
activate the fusion log to find out which locations have been scanned for
the assembly (debugger should automatically report this - I think).

Jochen

"Janiv Ratson" <janivr@gmailcom> wrote in message
news:uFIvV8GxGHA.4968@TK2MSFTNGP03.phx.gbl...
> How do I use InProgServer32 ?
> All required files are in the same folder.
> Thanks.
>
> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
> news:44e87dba$0$8285$9b622d9e@news.freenet.de...
>> Hmm, hope that this is not a .NET 2.0 security feature which correlates
>> with the RegAsm warning.
>>
>> Check InProgServer32 Codebase and make sure, that all required files are
>> in this directory. Eventually (?) the assembly requires more legacy
>> (win32) DLLs in this directory or the system search path.
>>
>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>> news:euf1cbGxGHA.4752@TK2MSFTNGP02.phx.gbl...
>>> Hi,
>>> It is now created but could not run due to "Could not load file or
>>> assembly '3rd party assembly' exception.
>>> I guess I haven't completed the action as required.
>>> Any ideas?
>>> Thanks.
>>> J.
>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>> news:e8deQQFxGHA.3904@TK2MSFTNGP02.phx.gbl...
>>>> Yes it works.
>>>> Thanks,
>>>> J.
>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>> news:44e84f34$0$10391$9b622d9e@news.freenet.de...
>>>>> Well - your choice, finally. In this special case: using a strongly
>>>>> names assembly makes sure that no one tamperes with it. And
>>>>> registering something as COM open wide access to the component on the
>>>>> system - no way for further security verifications the assembly will
>>>>> have full trust. Personally (not more) I can think there are scenarios
>>>>> where you can live with it. Yes, indeed you losse .NET / CLR security
>>>>> but if someone is able to replace a DLL on a system in most (s)he can
>>>>> choose to patch the registration to a modified DLL anyway.
>>>>>
>>>>> No more help to expect from this side, sorry :-) But actually: does it
>>>>> work after the RegAsm /Codebase?
>>>>>
>>>>> Bye
>>>>>
>>>>> Jochen
>>>>>
>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>> news:OGR6elExGHA.2208@TK2MSFTNGP04.phx.gbl...
>>>>>> Is it a warning we can live with ?
>>>>>> Thanks,
>>>>>> Janiv Ratson.
>>>>>>
>>>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>>>> news:44e82376$0$10375$9b622d9e@news.freenet.de...
>>>>>>> Are you sure? I thought that this message is only a warning.
>>>>>>>
>>>>>>> RegAsm : warning RA0000 : Registering an unsigned assembly with
>>>>>>> /codebase can ca...
>>>>>>> use your assembly to interfere with other applications that may be
>>>>>>> installed on
>>>>>>> the same computer. The /codebase switch is intended to be used only
>>>>>>> with signed
>>>>>>> assemblies. Please give your assembly a strong name and re-register
>>>>>>> it.
>>>>>>>
>>>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>>>> news:udswf%23CxGHA.4460@TK2MSFTNGP04.phx.gbl...
>>>>>>>> Hello Dr. Manns and all,
>>>>>>>> In order to regasm my dll using /code base, I need my assembly to
>>>>>>>> be signed.
>>>>>>>> Hoever, my assembly uses 3rd party assembly, which is not signed,
>>>>>>>> and therefor I my assembly cannot be signed.
>>>>>>>> Is there any other solution?
>>>>>>>> Thanks a lot,
>>>>>>>> Janiv Ratson.
>>>>>>>>
>>>>>>>> "Dr. Jochen Manns" <dev-2@psimarron.net> wrote in message
>>>>>>>> news:44e81037$0$2192$9b622d9e@news.freenet.de...
>>>>>>>>> Did you try RegAsm /Codebase.
>>>>>>>>>
>>>>>>>>> Eventuall POST the registry Settings under the CLSID here for
>>>>>>>>> inspection. You can check yourself if there are multiple keys
>>>>>>>>> below InprocServer32 of your component. If so remove the CLSID
>>>>>>>>> entry of your component, make sure that the assembly version in
>>>>>>>>> AssemblyInfo.cs does not use auto-increment (1.0.0.1 instead of
>>>>>>>>> the VS.NET 2003 default 1.0.*) and RegAsm /Codebase the assembly
>>>>>>>>> again.
>>>>>>>>>
>>>>>>>>> Jochen
>>>>>>>>>
>>>>>>>>> "Janiv Ratson" <janivr@gmailcom> wrote in message
>>>>>>>>> news:u6q3EbCxGHA.324@TK2MSFTNGP06.phx.gbl...
>>>>>>>>>> Hello all and thanks for your help.
>>>>>>>>>> I have registered my dll using regasm.exe.
>>>>>>>>>> I can find the NewSupernaActivation in the registry under CLSID.
>>>>>>>>>> Still I get Class not registered in my code.
>>>>>>>>>> Please help.
>>>>>>>>>> Thanks,
>>>>>>>>>> Janiv Ratson.
>>>>>>>>>>
>>>>>>>>>> "Kim Greenlee" <KimGreenlee@discussions.microsoft.com> wrote in
>>>>>>>>>> message
>>>>>>>>>> news:69329933-90B9-430B-BC31-D767AD300D7B@microsoft.com...
>>>>>>>>>>> Janiv,
>>>>>>>>>>>
>>>>>>>>>>> Did you check the registry to make sure that the COM interfaces
>>>>>>>>>>> were
>>>>>>>>>>> actually registered?
>>>>>>>>>>>
>>>>>>>>>>> Run Regedit.exe and then search on NewSupernaActivation or the
>>>>>>>>>>> name of your
>>>>>>>>>>> DLL. If you don't find it then it's not registered and that is
>>>>>>>>>>> your problem.
>>>>>>>>>>> You'll need to run regasm.exe to register the DLL.
>>>>>>>>>>>
>>>>>>>>>>> Kim
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> digipede - Many legs make light work.
>>>>&