Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello guys,
I have a serious problem with some DLL coded in C++. This is libarary which provides some communication protocol methods/functions to connect and use fiscal printer.
Every time I try to add reference to this in my project, VS2010 brings me error dialog window with information, that this is not proper COM object.
Can somebody please give me some step-by-step manual what should i do to use this DLL in VB.NET or C# project? I know this is possible but I don't have any good source of information about solving it.
I'm not very familiar with C++ also.
Posted
Comments
[no name] 2-Sep-13 13:21pm    
Do you really think that "some DLL" tells us anything? Do you have any idea how DLLs have been written in C++ over the decades any one of which could be your "some DLL"? Go back to where you got this DLL and get the documentation and read it.
szataniel 2-Sep-13 14:03pm    
That's the link to DLL:

http://egofiles.com/H6NZYbj0ulWl4h0p/dll.rar

It's not a virus or any other malicious software. I haven't any documentation to this.
[no name] 2-Sep-13 15:17pm    
So, in other words, your "question" is "Someone download some unknown DLL package from an unknown source for some unknown purpose, spend some hours or days of free time to figure out how to use, then teach you how to write code in C++", is that about right? Good luck with that.

1 solution

References to .DLL's only work if they are COM exposed or .NET .DLL's. If you can't set a reference to it you have to use P/Invoke and import the functions the library exports and call them directly.

You will need to know the functions headers and their parameter and return types in order to do this. I hope you have the documentation that spells this out because it's all but impossible to guess at.
 
Share this answer
 
Comments
szataniel 2-Sep-13 14:13pm    
The only things I have are those DLLs, LIB files and some .h file, which surely corresponds to this all... but I really don't know how to manage this.
Dave Kreskowiak 2-Sep-13 15:19pm    
Hopefully, the .H files have the correct function headers in them. You would use the information you find in there to write your C# DllImport statements.

This is not a "beginner" type thing. But, you can find a tutorial on doing P/Invoke at http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx.
szataniel 2-Sep-13 15:24pm    
Yes, that's what I looking for. :) Thanks s lot. :)

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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