arupert

In VS2003 C++, I can configure strong names for ActiveX control references so I can sign and build my main assembly. This is done from the Project Managed Wrapper Properties. But I cannot find an equivalent for this in VS2005 C++. I see properties for references in Project References, but they are grayed out. Is there a way to sign ActiveX controls/references in VS2005

Thanks



Re: Visual C++ General How can I sign ActiveX controls/references in VS2005?

Nikola Dudar

Hi,

I am not sure what dialogs you are looking for. Strong name signing is described in this topics, http://msdn2.microsoft.com/en-us/library/xc31ft41(VS.80).aspx. However I am not sure what you mean abou ActiveX control signing. Please provide more details on what steps you were taking in VS2003, what projects do you have.

Thanks,

Nikola






Re: Visual C++ General How can I sign ActiveX controls/references in VS2005?

arupert

Thanks for the reply.
Here are more details:

I have a VS 2005 C++ application that uses some COM components. In order to sign my main assembly, I need to sign the Interop and AxInterop assemblies created for the COM components.
If I try to strong name my main assembly with a key file, then when I compile my application, I get errors similar to these:

LINK : error LNK2022: metadata operation failed (8004041F) : Referenced assembly 'Interop.xxxxxxLib.1.0' does not have a strong name
LINK : error LNK2022: metadata operation failed (8004041F) : Referenced assembly 'AxInterop.yyyyyyyy' does not have a strong name
LINK : fatal error LNK1255: link failed because of metadata errors

So I want to sign the Interop and AxInterop assemblies.

In VS2003, this can be accomplished by these steps:
1. Select Properties from the Project menu.
2. Click on Managed Wrapper in the tree on the left. You will see $(OutDir)\Interop.$(InputName).dll for the Output Name.
3. Enter the Public Key File value and set the Strong Name type to Key File.
4. Click on Auxilary Managed Wrapper in the tree on the left. You will see $(OutDir)\AxInterop.$(InputName).dll for the Output Name.
5. Enter the Public Key File value and set the Strong Name type to Key File.

My question is: How do I do the same thing above in VS 2005
Or, how can I use the assembly linker for Interop and AxInterop assemblies I don't know which name to use for module name for the assembly linker example in the link you provided:
al /out:MyAssembly.dll MyModule.netmodule /keyfile:sgKey.snk

Thanks,
Alan





Re: Visual C++ General How can I sign ActiveX controls/references in VS2005?

Brian Kramer

If you are not able to get an answer in this forum, you may get an answer from someone who've done this (signing AX controls under VS2005) in the in the Win32 OLE newsgroup: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.win32.programmer.ole&lang=en&cr=US





Re: Visual C++ General How can I sign ActiveX controls/references in VS2005?

jomo

Did anyone come up with a solution for this I tried re-adding shdocvw.dll to my project, which generated 'Interop.shdocvw.1.1.dll' for me, but the assembly doesn't have a strong name and I can't find anything that allows me to set a key file in VS2005 (why did C# get to keep the handy References node, but they removed it and its associated configuration options in C++ ).




Re: Visual C++ General How can I sign ActiveX controls/references in VS2005?

arupert

Bingo!

I finally got it to work today!

Here's what I did for my VC++ 2005 app:

For each project in the solution:
Set the key file to mykey.snk in project properties linker advanced.

For each activex control, execute:
aximp /keyfile:mykey.snk someControl.ocx
(this generates AxsomeControlLib.dll and someControlLib.dll)

For each com library, execute:
tlbimp /keyfile:mykey.snk someComServer.tlb
(this generates someComServerLib.dll)

For each project in the solution that uses the components above:
Remove the current references for the components.
Add the component references using the files output from aximp and tlbimp.

Build the solution.

Note:
aximp and tlbimp are found in:
\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin





Re: Visual C++ General How can I sign ActiveX controls/references in VS2005?

Maik Wiege

Hello!
I'm trying to sign the activeX control from the Adobe Acrobat Reader 7.
The ActiveX is loaded into VS using the file "program files\adobe\acrobat 7.0\activeX\AcroPDF.dll". In that folder are some other dll files, but I don't think they are needed here.
I now could use both of your commands, with the following results:
aximp outputs:
generated Assembly: ...AcroPDFLib.dll
generated Assembly: ...AxAcroPDFLib.dll
tblimp outputs:
Type library imported to AcroPDFLib.dll


I now tried everything to import that files into my project, but I always get an error, that the typelibrary can not be found - of course that all makes sense because it seems that I don't have the tld file, but has anyone an idea how to accomblish linking the acrobat reader activeX into a strong name signed VS2005 project

Thank
Maik




Re: Visual C++ General How can I sign ActiveX controls/references in VS2005?

jmsigler2

I have a project using a WinXP / VS 2003 / .Net Framework 1.1 project which references Interop.SHDocVw.dll. This project was opened and migrated to Vista / VS 2005 / .NET Framework 2.0. When I build the project, I receive an error, "Assembly generation failed -- Referenced assembly 'Interop.SHDocVw.dll' does not have a strong name.

Visual C#

using SHDocVw;

// Class definition

class xyz

{

WebBrowserClass x; // I believe this is the class being referenced...

}

Similar Reference:

Facts:

  • SHDocVw.dll resides in C:\Windows\System32
  • I deleted the interop assembly reference to Interop.SHDocVw.dll and changed it to the native ActiveX file, SHDocVw.dll. Visual Studio regenerated a new interop assembly, Interop.SHDocVw.dll. -- I assume that this is the same as manually calling "TLBImp SHDocVw.dll /out:Interop.SHDocVw.dll".
  • I then deleted the reference to SHDocVw.dll and added a reference back to the newly generated file, Interop.SHDocVw.dll.
  • The original error remained; so a strong named interop assembly is needed if I wish to use COM as a solution.
  • In the reference above, another developer say that .NET Framework 2.0 provides a new WebBrowser Control to replace use of the COM-based ActiveX control; I would prefer not to use this approach unless absolutely necessary. In this way the code is more backward compatible with existing code supporting a Windows XP solution on the older platform.

Assumptions:

  • SHDocVw.dll is a Microsoft distributed file.
  • A strong name key must be added to this interop assembly, Interop.SHDocVw.dll.

Questions:

  • How should I appropriate adding a key
  • Should I type "TLBImp SHDocVw.dll /out:Interop.SHDocVw.dll /publickey:<filespec.snk>"
  • Should I type "TLBImp SHDocVw.dll /out:Interop.SHDocVw.dll /keyfile:<filespec.snk>"
  • Should I type a similar call using both /publickey and /keyfile

James

Dallas, TX