Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi,

1. I have a program ("client") written in c++ (not written by me) that is exported as a COM object. the DLL needs to be registered in the registry for it to be used...

2. Having to add some features to it, I have written a program in c# ("queue") that the client uses in some cases.

3. In order to connect them together, I have written a cpp/cli wrapper("wrapper"), that enables the use of managed code from unmanaged code.

4. Now I have: client.dll, wrapper.dll, queue.dll tat are supposed to use each other.
the c# queue compiles and works, the cpp/cli wrapper compiles and works with the queue, the client does not fail on the code using the wrapper, but failes to register output for it now. i get:

Quote:
Error 15 error PRJ0050: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions. client client

(per-user redirection is enabled)


5. Some tell me it can't be done - i cannot use managed code in a COM object (even though it is in a different DLL?) and some say i can, but i need to register the other DLLs as well, so i add, in VS:
- make assembly COM visable.
- register for COM interop.

now the c# queue fails to register, here i get:

Quote:
Error 91 error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 756 6 wrapper


any ideas?
can it be done?
does one DLL care if the DLLs it uses are managed code or unmanaged code?
is there a simple way to sort this out..?

Hope I have written all the info needed for your kind help.
thx.
Posted
Updated 17-Jul-12 23:11pm
v3
Comments
Sandeep Mewara 18-Jul-12 5:15am    
Post comment to answerer if your update was based on what he suggested.

1 solution

You can make managed COM objects, if that is the question. Create it as ClassLibrary project, and project properties, in the build section set Register for COM interop.
 
Share this answer
 
Comments
Ron Anoshi 1-Aug-12 5:39am    
well, I have added the register for COM interop, and changed some of the projects definitions, so now the client tries to use the wrapper's DLL.
but now linking fails on the row that tries to access the wrapper, with:


Error 30 error LNK2019: unresolved external symbol "int __cdecl isQueue_u(void)" (?isQueue_u@@YAHXZ) referenced in function "public: virtual long __stdcall ...::...(...*)" (?...@@UAGJPA_WPAPA_W1PAJ@Z) ....obj client

(wrote "..." over some irrelevant inner functions)

Is there a problem linking it dynamicly? how can I find out?
armagedescu 1-Aug-12 7:19am    
I suppose somewhere is used isQueue, but is not exposed. Or it is exposed, but you are not using correct libs or references. You have to find the place where it is used, and see, if it is a COM object, then you have to add reference, and remove the lib which was meant to add this function. But if it is lib function, then you have to add the lib.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900