Node.js | Server communication to C++ component | register C++ COM Component using manifest dependencies

Hi Experts,
We have a requirement to consume C++ COM Component from C++ DLL (MFC 64 bit DLL). This MFC DLL in turn shall be invoked via Node.exe on some action on the web browser.
WEB BROWSER ------> NODE.exe (server) -------------> MFC.DLL (64 bit) -------------> C++ COM .DLL (64 bit).
We don't want to register the COM component explicitly (using regsvr32.exe) on the deployment machine. This is an explicit requirement from our clients. Instead they want us to use the manifest dependencies (described in link below) in visual studio to achieve the same
http://blogs.msdn.com/b/yvesdolc/archive/2008/05/09/native-manifests-let-s-do-com-and-forget-the-registry.aspx?CommentPosted=true#commentmessage
However these manifest dependencies work only when it is done as part of the EXE settings in visual studio, it does not work if it is done from MFC.DLL.
Now in our case since Node server (Node.exe) shall be invoking our DLL, we wanted to know how to do the manifest settings for COM component in Node server so that we do not require to register the COM component explicitly.

Thanks and regards,
Karrtik
LVL 15
Karrtik IyerSoftware ArchitectAsked:
Who is Participating?
 
jkrCommented:
Well, try that yourself in the mean time - save the manifest file, use rc.exe to create a node.manifest and then

mt.exe –manifest node.exe.manifest -outputresource:node.exe;1

Open in new window

0
 
jkrCommented:
You could do that by changing/editing the manifest that 'node.exe' contains or add one to the executable if there is none so far. See http://support.microsoft.com/en-us/kb/944276 ("How to embed a manifest file in an executable file in Visual Studio 2005", works equally with later versions) and https://msdn.microsoft.com/en-us/library/ms235605.aspx?f=255&MSPPError=-2147217396 ("Manifest Generation at the Command Line")
0
 
Karrtik IyerSoftware ArchitectAuthor Commented:
Hi JKR,

Node.exe is the node.js (www.nodejs.org) server side component. I do not think it is built using a Microsoft technology which ch we can do these settings. Hence this question.

Thanks,
Karrtik
0
Simple Misconfiguration =Network Vulnerability

In this technical webinar, AlgoSec will present several examples of common misconfigurations; including a basic device change, business application connectivity changes, and data center migrations. Learn best practices to protect your business from attack.

 
jkrCommented:
It is. As long as it consist of the binary format required to run on MS Windows, you can apply all means that MS' development tools offer. I do work with node.js as well, so I'll see what it takes to add a manifest to 'node.exe' tomorow, Aquick test just now already confirms that this is possible, so following the steps linked above should get you there.
0
 
Karrtik IyerSoftware ArchitectAuthor Commented:
Thanks JRK, steps and any sample program should help.
Shall await your response.
Regards,
Karrtik
0
 
jkrCommented:
OK, that worked. Only a simple error in the above, that should be

mt.exe –manifest node.exe.manifest -outputresource:node.exe;#1

Open in new window


The '#' was missing. With the manifest from the article, you get


C:\tmp\cc\node>mt -updateresource:node.exe;#1 -manifest node.exe.manifest
Microsoft (R) Manifest Tool version 5.2.3790.2075
Copyright (c) Microsoft Corporation 2005.
All rights reserved.

mt.exe : manifest authoring warning 81010002: Unrecognized Element "requestedPrivileges" in namespace "urn:schemas-microsoft-com:asm.v3".

mt.exe : manifest authoring warning 81010002: Unrecognized Element "compatibility" in namespace "urn:schemas-microsoft-com:compatibility.v1".
0
 
Karrtik IyerSoftware ArchitectAuthor Commented:
Thanks JKR, we were able to achieve it using your hint yesterday. Thanks once again.

Regards,
Karrtik
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.