Click here to Skip to main content
15,792,771 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey guys, I'm facing a problem regarding adding references into project. Basically, I have downloaded a project from this site. Now i want to use class libraries of that project. I have already added the reference of dlls of that project but still i can't access classes which are accessible in that project. I have took screen shots to illustrate in better way:

Here's the actual project solution architecture:

Here's my project and I have added two references:

Now I'm trying to access Capture class but I can't =[

Please answer me ASAP. Thanks in advance =]
Updated 22-Jun-12 19:23pm

There can be different situations; and you don't really show in your pictures how do you try to use Capture. What I could see is that the property Capture related to mouse capture is shown. Here is how you can see what is accessible from the assembly you referenced: focus on Solution Explorer, select the item in the Solution Explorer, the one representing a referenced assembly; and double click on it. It will show the view in the area of the source code tabs; it will allow you to browse through reflected public declarations and see what's available, as well as the help on each item, if XML help comments were provided by the developer.

Another thing is hardly related to the library you have references, because it is probably already a library prepared to be used as a reference, but you need to understand something which is good to understand. You always reference assemblies (not libraries, DLLs, and — notably — not projects). Even though you can reference by project (through the "Browse" tab of the "Add Reference" window), this is only the artifact of the solution functionality under Visual Studio, a kind of development automation tool, it allows to abstract out strong names of the assemblies, so you can freely modify them during development. So, you reference an assembly, no matter if its main executable module is DLL, EXE or anything else; this is nothing but exception. Referencing of application's EXE can be used to plug-in architecture, to reference plug-in API by plug-in assemblies, so you can store the plug-in API directly in the host application.

So, one problem could be referencing the executable build from the article's source code. The types and members in such assembly, if it is not developed to be referenced by other assemblies, normally use internal or internal protected declaration, which means the same as public or protected for access withing the same assembly only. If you want to use such types from referencing assembly, you need to change the access modifiers of the types and members you need into public or protected.

Share this answer
Espen Harlinn 23-Jun-12 8:51am    
Good points :-D
Sergey Alexandrovich Kryukov 23-Jun-12 12:03pm    
Thank you, Espen.
try using full class name

DirectX.Capture.Capture myobj = new DirectX.Capture.Capture();
Share this answer
Zainy95 23-Jun-12 1:26am    
Thanks a lot!!! =]

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