Click here to Skip to main content
15,881,381 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hello

I was assigned a project which uses a biometric device to detect the hand veins . The device detects the hand and allows you to save , verify , identify and delete user information

The project is based on C # WinForm , this project uses a dll developed in another project in c + + / CLI . And this dll calls a series of dll files ( c ) stored in the computer

The problem is that my bosses told me I should use WCF for silverlight 5 application that will visualize from internet explorer .
It is here when I wonder if it is possible and if so how it should develop the application

- Should I use the dll c + + / CLI from silverlight ? Try using DllImport but I think only work to use the methods and not to instantiate the dll classes
- Should I use the dll c + + / CLI from WCF ? I only know a little, WCF is used to transfer messages from one device to another , but I work if called from silverlight dll c + + / CLI which is in WCF ?
- Is possible use silverlight for pojecto like this which requires access from the browser files on the computer?

I hope you can help me
Thank you.
Posted

1 solution

Unfortunately, my understanding of you problem is incomplete. First of all, I cannot immediately see how is it related to your previous question about indirect reference of the assembly (which is the non-existing mechanism). By the way, your explanation of your project looks very interesting and, probably, challenging. Let me first answer to what looks obvious to me.

Yes, you can use C++/CLI from Silverlight and should do this is your C++/CLI project contains valuable resources for the Silverlight solution. You only need to compile it to appropriate target .NET version. But no way you should use P/Invoke; it would be possible but just defeat the purpose. I'll explain. There are two options: all the code in your C++/CLI project is managed, or it can be the mixed-mode project, managed + unmanaged. In first case, you can just reference this DLL in your CLI assembly (Silverlight project or not), or load your assembly dynamically or use via Reflection. In other words, your C++/CLI project will compile into a regular .NET assembly and should be used as such, as any other .NET assembly. If this is a mixed-mode project (because you have some code developed as unmanaged), you would obtain a DLL, some PE file, an executable module with dual use: either as regular native (unmanaged) DLL or as a regular .NET assembly. So, P/Invoke could be possible. Don't do it! Take the real unique benefit of C++/CLI! Even if you have some unmanaged code, wrap it in some managed ("ref") class/structure, make it public, with the members you need to invoke, to make it accessible as object/members of managed (.NET) assembly. This is the unique feature of C++/CLI which allows to skip cumbersome P/Invoke.

"Use the DLL C++/CLI from WCF" is just not a comprehensible expression to me. WCF is another library, part of .NET FCL. You cannot "inject" anything into it from your own assembly. It will always use .NET FCL as is. But the mechanism of serialization (Data Contract, you will need to read about it), will allow you to use your classes representing data you need to pass through the network using WCF. So, you can and are advised to use WCF, but not "the DLL C++/CLI from WCF". Rather, it will be using C++/CLI (or any other .NET language) with FCL. To get an idea, please see:
http://msdn.microsoft.com/en-us/library/ms733127%28v=vs.110%29.aspx[^].

About last question: I don't understand what does it mean, "from browser files"? I don't know any "browser files". Perhaps, again, you need to explain the purpose or desired behavior. "What" instead of "how".

That's all for now. If you provide relevant feedback, we can discuss more of it.

SA—
 
Share this answer
 
v2
Comments
memd24 14-Mar-14 12:32pm    
Thank you for informate to me, I didnt know it.
But, do you tink is posible to use that dll in silverlight and connect to the biometric device?

Sorry about the las question, bad translation, Im speack spanish.
-Is possible to access to the biometric device, from Internet Explorer, because the project is web, but if I use the dll form the project (server), How does it could connect
Sergey Alexandrovich Kryukov 14-Mar-14 13:19pm    
No problem, we can discuss everything. Such systems where you access hardware from a Web browser do exist, but you need to have some Web browser somewhere. Such browser can be embedded in a hardware unit (this is very typical for a number of classes of devices; one of the most used examples is a wireless router which provides Web interface for administration/configuration of the device), or some computer controlling hardware. It highly depends on hardware architecture you can use and other factors.
—SA
Sergey Alexandrovich Kryukov 14-Mar-14 13:19pm    
Are you going to accept the answer formally now? In all cases, your follow-up questions will be welcome.
—SA
Sergey Alexandrovich Kryukov 14-Mar-14 13:21pm    
And yes, you can use the DLL in case of compatibility between target .NET version. The DLL is yours, with source code, isn't it?
—SA
memd24 14-Mar-14 13:40pm    
Yes, thank you for the help
Now I'll digest the information and use it
Thank you very much! :)

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