How can i change the class in the Class Library project to be static or public so i can use it from the windows application project ?

First i know that when i make any changes to the class library project i need to rebuild the project then to remove the Capture.dll from the TestScreenshot project and then to add again the updated Capture.dll
The problem for example in this case i'm trying to use a public static variable i add in the DXHookD3D9.
In the DXHookD3D9 i added this public static variable:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using SlimDX.Direct3D9;
using EasyHook;
using System.Runtime.InteropServices;
using System.IO;
using System.Threading;
using System.Drawing;
using Capture.Interface;
using SharpDX.Direct3D9;
namespace Capture.Hook
internal class DXHookD3D9: BaseDXHook
public DXHookD3D9(CaptureInterface ssInterface)
: base(ssInterface)
LocalHook Direct3DDevice_EndSceneHook = null;
LocalHook Direct3DDevice_ResetHook = null;
LocalHook Direct3DDevice_PresentHook = null;
LocalHook Direct3DDeviceEx_PresentExHook = null;
object _lockRenderTarget = new object();
Surface _renderTarget;
public static decimal framesperhourtodisplay = 0;
protected override string HookName
get
return "DXHookD3D9";
List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>(
framesperhourtodisplay
The problem is i can't even get to the Capture.Hook namespace and not to the DXHookD3D9 from the TestScreenshot application window project.
This is a screenshot:
For example fro the FramesPerSecond class i can use it get to it from the windows forms application.
namespace Capture.Hook
/// <summary>
/// Used to determine the FPS
/// </summary>
public class FramesPerSecond
int _frames = 0;
int _lastTickCount = 0;
float _lastFrameRate = 0;
Since it's public i guess.
But if i will change the DXHookD3D9 class from internal to public:
public class DXHookD3D9: BaseDXHook
I will get error on the DXHookD3D9: 
Error 1
Inconsistent accessibility: base class 'Capture.Hook.BaseDXHook' is less accessible than class 'Capture.Hook.DXHookD3D9'
And the BaseDXHook class:
namespace Capture.Hook
internal abstract class BaseDXHook: IDXHook
protected readonly ClientCaptureInterfaceEventProxy InterfaceEventProxy = new ClientCaptureInterfaceEventProxy();
public BaseDXHook(CaptureInterface ssInterface)
this.Interface = ssInterface;
this.Timer = new Stopwatch();
this.Timer.Start();
this.FPS = new FramesPerSecond();
Interface.ScreenshotRequested += InterfaceEventProxy.ScreenshotRequestedProxyHandler;
Interface.DisplayText += InterfaceEventProxy.DisplayTextProxyHandler;
InterfaceEventProxy.ScreenshotRequested += new ScreenshotRequestedEvent(InterfaceEventProxy_ScreenshotRequested);
InterfaceEventProxy.DisplayText += new DisplayTextEvent(InterfaceEventProxy_DisplayText);
~BaseDXHook()
Dispose(false);
How can i solve it so i can use the variable framesperhourtodisplay in the DXHookD3D9 class with the TestScreenshot windows forms application ?

Hi,
I dont know if it will work here, since I dont know the complete structure, but the base call must be public, if the derived class is public, so the base class is at least as accessible as the derived class.
Try make the base class public. (And maybe the base-class IDXHook of the base also...)
Or use a different approach and make only the properties public that are needed to be public by adding an extra class...
A structure could look like:(you need to create a class thats public in your dll and expose a property, and set this property in the internal class...)
In the Accessing class (here Form1)
public partial class Form1 : Form
public Form1()
InitializeComponent();
private void Form1_Load(object sender, EventArgs e)
C c = new C();
MessageBox.Show(B.F.ToString());
and in the class Lib:
internal class A
public A()
B.F = DateTime.Now.Millisecond;
public class B
public static int F { get; set; }
public class C
public C()
A a = new A();
(add a referenc to the class lib from the accessing project)
Regards,
  Thorsten

Similar Messages

  • HT2731 how do i get my own apple id that is not associated with my husbands?  We have just used his from the get go.

    I need to know how to set up my wife own account instead of under mind account?

    The page that you posted from tells you how to create an iTunes account, or there are instructions on this page if you want to create one without giving credit card details : http://support.apple.com/kb/HT2534 . To use that new account your wife can tap on the id in Settings > iTunes & App Store on her device(s) and log out of your existing account and she can then log in with the new one.
    All of the content that you and/or your wife has downloaded on your account will remain tied to your account, so only your account will be able to download updates to those apps.

  • How do I change the image used on an movie project icon? iMovie seems to select an image at random from the images I imported.

    How do I change the image used on an movie project icon?
    iMovie seems to select an image at random from the images I imported.

    Not sure I understand how to use what you have posted. Here's what my init() looks like:
    public void init()
    setLayout(new BorderLayout());
    p=new Panel();
    p.setLayout(new GridLayout(1,1));
    callnowButtonURL = getURL(callnowButtonFilename);
    if (callnowButtonURL != null)
    callIcon = new ImageIcon(callnowButtonURL,"call");
    endcallButtonURL = getURL(endcallButtonFilename);
    if (endcallButtonURL != null)
    endIcon = new ImageIcon(endcallButtonURL);
    b=new JButton(callIcon);
    b.setBorder(new EmptyBorder(0,0,0,0));
    b.setBorderPainted(false);
    b.addActionListener(this);
    p.add(b);
    add(p,"Center");
    Now the ActionListener is basically:
    public void actionPerformed(ActionEvent e)
    if (mybool == false)
    <Perform actions here set mybool to true>
    Change JButton b to use EndIcon
    else
    <Perform actions here set mybool to false>
    Change JButton b to use CallIcon
    Can you clarify how to perform the action I require? You can have a couple of Dukes if you can help me sort this out.

  • How can I transfer photos from an IPhone 5 to an IPad 2 using a cable.  I have tried using the lightning to firewire adapter with my current lead but this only seems to allow a download from the Ipad to the Iphone and not the other way around.

    How can I transfer photos from an IPhone 5 to an IPad 2 using a cable.  I have tried using the lightning to firewire adapter with my current lead but this only seems to allow a download from the IPad to the IPhone and not the other way around.

    The devices are not designed for transfer of that kind.  Use Photo Stream as suggested by another poster, or transfer photos to your computer (a good idea anyway since they will be lost if your device needs to be reset), then use iTunes to sync them to the other devices.

  • How can i retrieve documents(.doc,.pdf, .txt) using forms from the database.

    How can i retrieve documents(e.g .doc,.pdf, .txt etc) using forms from the database.
    i inserted the documents using sql*loader, below is the control and data files.
    -- control file
    LOAD DATA
    infile 'load.txt'
    INTO TABLE husman
    APPEND
    FIELDS TERMINATED BY ','
    (id integer external,
    fname FILLER CHAR(50),
    docu LOBFILE(fname) TERMINATED BY EOF)
    --data file
    1,../husman/dell.doc,
    2,../husman/me.pdf,
    3,../husman/export.txt,
    in the form i have a text field to display the id and an OLE container to display the document as an icon. but when i execute query, i only get the id number and not the document.
    any help will be appreciated.
    Thanks
    Hussein Saiger

    Step by step
    1. Erase all contents and settings
    2. You'll be asked twice to confirm
    3. You'll see Apple logo and progress bar
    4. You'll see a big iPad logo on screen
    5. Configuration start
    6. Set language
    7. Set country
    8. Enable Location Service
    9. Select network, enter password and join network
    10. You'll be given 3 options (a) Setup as New iPad (b) Restore from iCloud Backup (c) Restore from iTune Backup
    11. Selected Restore from iCloud Backup
    12. You'll be required to enter Apple ID and Password
    13. Agree to Terms and Conditions
    14. Select Backup file
    15. You'll see progress bar
    16. Red slider will appear; slide to unlock; step #1 to #16 is fast
    17. Pre-installed apps will be restored first
    18. Message: Purchased apps and media will now be automatically downloaded
    19. You'll see a pageful of apps with Waiting/Loading/Installing
    20. Message: Some apps cannot be downloaded, please sync with computer

  • Someone tell me how I can sync my music to my iPhone without it saying on itunes "set up as a new iPhone" or "restore from the backup of: iPod"

    someone tell me how I can sync my music to my iPhone without it saying on itunes "set up as a new iPhone" or "restore from the backup of: iPod"

    You must be trying to sync it with a different computer than the one it used last. No, there is no other way to do this.
    The iPhone may be synced to one and only one computer at any given time. If you choose to sync it to another, you can do that as often as you wish, but its content is erased first.

  • TS1424 How can I retrieve my smurfvillage back where It was? When I rebooted my iPad, it made my smurfvillage begin from the beginning?

    How can I retrieve my smurfvillage back where It was? When I rebooted my iPad, it made my smurfvillage begin from the beginning?
    Please help. I've already invested over $200 in my village and I was in level 27.  Any help would be appreciated. Thank you

    I got my contacts back by doing another restore!  Relief..
    But only a very few odd apps are showing up on the 3GS
    Any suggestions?

  • How can I mount an Amazon S3 bucket so that I can use it from the Finder?

    Hi
    I'm looking for some tool/solution that will allow me to mount a S3 bucket, preferably a free/open-source one.
    Jungledisk is out of the question since it does not seem to be fully compatible with other S3 tools (the format of the uploaded files).
    I found s3fs but it seems to be outdated and broken on Snow Leopard.
    Any help would be much appreciated, thanks!

    Hi GotGemini,
    Just hold down the "C" key while your computer starts up. That'll force it to try to boot from the disk.
    Hope that helps!
    —Hazy

  • HT1937 how do i change mi security questions  if i have to answer them  but i forgot them  i  can't use my iphone

    how do i change mi security questions  if i have to answer them  but i forgot them  i  can't use my iphone

    Go to this knowledge base article and request help from Apple.  If that doesn't help, go to the ExpressLane for assistance.

  • How do I change my security questions? I forget them because I made them ages ago and can't seem to buy anything off my account without having to answer them?? Help

    How do I change my security questions? I forget them because I made them ages ago and can't seem to buy anything off my account without having to answer them?? Help

    1. First, go to http://appleid.apple.com. Underneath where it says "Already have an Apple ID?," click Manage your Account. You will then need to sign in. If you forgot your Apple ID or password, click on the appropriate "Forgot..." link below either of these fields.
    2. After you sign in, click on "Passwords and Security" on the left.
    3. You will be asked to answer the security questions, but you should also notice a link below the second "Answer" field offering to send reset instructions to your rescue email address that you provided.
    4. Check the Inbox of your rescue email address. The email should appear within a minute or two. If it does not, be sure to check Spam. If it is not there either, you can repeat the above process to resend. Once you get the email, following the link will take you to a page where you must sign in again. After doing so, you will have the option to choose three new security questions and answers, which you may want to write down
    5. After you fill in the required information and continue, you should be taken to a confirmation screen stating "Your password and security information has been saved," and then you are done.
    6. The "Forgot your answers?" link will not appear if you do not have a rescue email address set up. In that case you will need to contact iTunes Support, http://apple.com/emea/support/itunes/contact.html
    7. If you still know the answers to your security questions, it is highly recommended you add a rescue email address. To do so, log in at appleid.apple.com and click on Password and Security. Answer the questions and then click on "Add Rescue Email Address:"

  • How can I change my user name on my iPhone 4S running )OS 8.1.1 so I can update my Apps

    How can I change my user name on my iPhone 4S running OS 8.1.1 so I can update my Apps?

    Hi jprohask63,
    Welcome to the Apple Support Communities!
    If you have applications that were originally downloaded from a different Apple ID, you would need to sign out of the current Apple ID and sign in to the Apple ID that was used originally to download the application. To complete this process please follow the instructions provided in the attached article. 
    iOS: Sign in with a different Apple ID in the iTunes Store, App Store, and iBooks Store - Apple Support
    Cheers,
    Joe 

  • I have iWork 09 with a family license. I am unable to install the software on my new Macbook Pro (the message is simply "Installation failed"). I wonder if I need to remove an old computer from the family license, and if so, how?

    I have iWork 09 with a family license. I am unable to install the software on my new Macbook Pro (the message is simply "Installation failed"). I wonder if I need to remove an old computer from the family license, and if so, how?

    Yes, gladly. I am trying to install on a 13" MacBook Pro with OS X 10.8.3. I insert the disk into the SuperDrive. The I work '09 window pops up with two icons: one Tim install and one that says "Read before you install iWork." I double-click on the "Install iWork '09" icon, and a window appears that says, "This package will run a program to determine if the software can be installed." I click "continue" and see "Welcome to the iWork '09 installer." I click on "Continue." The "read me" bullet on the left lights up, and I see "Read before you install. . . ." I click "Continue," then see the software license agreement. When I click on "Continue" again, I am asked to agree, and I do. The window then says, "Standard Install on 'Mackintosh HD" and indicates how much space the program will take.
    I click "Install," enter my password, and the installation begins. It goes through a validating phase and begins "writing files." It indicates that installation will take about 30 minutes (although that number fluctuates). After about four minutes it goes to "cleaning up." Then after just a few seconds, the "Summary" bullet on the left lights up and this message appears: "There were errors with the installation. You may want to try installing again." There is a large yellow triangle with an exclamation point in it, and a bold "The installation failed." Below that appears "The installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance."
    At that point, a "Close" button is pulsating blue at the bottom of the window.
    Sorry for the tedious detail. Anything revealing there?
    Thanks!

  • I have edit access to someone else's calendar.  In iCloud i can add an event to this calender.  In My calendar on my Mac I can see the calendar in the list, but when I try to add an event to this calendar, it is not avail from the list in event to select

    I have edit access to someone else's calendar.  In iCloud i can add an event to this calender.  In My calendar on my Mac I can see the calendar in the list, but when I try to add an event to this calendar, it is not avail from the list in event to select.  Any help appreciated.  Thanks

    Hi Chris,
    You can't get rid of an alert. The least you can have is one that says "none".
    Nevermind, I see you learned how to edit the event.

  • I can not get my itunes to sort my library in alphabetical order by artist??  Nor can I get the listing to be numbered...ie...1...2...3...4...5 etc.....Can anyone help??  It used to alphabetize my list correctly before I downloaded the 11.0.1 or 11.0.5

    I can not get my itunes to sort my library in alphabetical order by artist??  Nor can I get the listing to be numbered...ie...1...2...3...4...5 etc.....Can anyone help??  It used to be able to alphabetize my list correctly before I downloaded the 11.0.1 or 11.0.5 version of itunes?????

    How are you viewing your library? In Song view or Album View?
    If in Album view pull down View > Show View Options and select Sort by: Artist, then: (whichever choice you want here).
    If in Song view I like to see the album artwork so pull down View > Show View Options and select "show album artwork" and close the small window. Then click on the column that contains the artwork and sort it by Artist.

  • My Mother in law messed up my Adobe reader some how to the point that it is no longer in my computer. I have tried to download it from the internet but it is not working. What am I missing? what else do I need to do? I am not even able to watch youtube...

    My Mother in law messed up my Adobe reader some how to the point that it is no longer in my computer. I have tried to download it from the internet but it is not working. What am I missing? what else do I need to do? I am not even able to watch youtube...

    Soccerdm,
    a direct download of Adobe Reader X 10.1.4 (which seems to be the most recent standalone version that runs on Mac OS X 10.5.8) is here.

Maybe you are looking for

  • How can i get this set up to work? PLEASE HELP

    Ok so right now i have a airport express, and i bought a xbox 360. I want a wired connection for my xbox 360, so the guy at bestbuy said to buy a dlink EBR-2310 switch so i would still have a wireless connection for all the laptops, phone, etc in my

  • Assigning a Constant Value for Target Revenue

    Hello all, I have a scenario where I need to assign a Constant value, say 10000, for my Target revenue Key Figure at the Info Cube level. This value should always be 10000. Please advice. Your valuable suggestions will be greatly appreciated. I will

  • Radeon 9000 extreme Xorg instability

    I have two problems on my itronix 260+ notebook : 1)Xorg does crash often when I open some websites like ebay with firefox: black screen or freezed screen and I have to reboot 2)If I remove my logitech mouse usb nano receiver Xorg freezes and if I re

  • Af:region, PPR and onload handler

    We develop custom JSF components that need some javascript counterpart on the client. These counterparts needs to be initialized (through some AJAX calls) when the page is ready to be displayed. In old technologies, this was done through an "onload"

  • Upgrade to SUNWCuser to SUNWCXall in Solaris 10

    Hi, Can I upgrade from SUNWCuser to SUNWCXall in Solaris 10. Appreciate if I get some quick reply from anyone as all the appication, db are installed and at last I noticed that the Solaris Cluster is SUNWCuser but the requirement is SUNWCXall. Apprec