CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Unhappy Global Managed Type in win32 dll project

    I am making a dll and need to use a global variable. This needs to be addressed by a function. I have some code but i can't figure out how to do this so i have pretty much guessed after reading various articles on the internet.

    Code:
    public ref class Wii {
    public:
    	static Wiimote^ wm;
    };
    
    MYCOMMAND bool WMCONNECT()
    {
    	Wiimote wm;
    	wm.Connect();
    	Wii::wm := wm;
    }
    Help greatly appreciated.

    Dale2507

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Global Managed Type in win32 dll project

    public ref class Wii {
    public:
    static Wiimote^ wm;
    };

    MYCOMMAND bool WMCONNECT()
    {
    Wiimote^ wm = gcnew Wiimote();
    wm->Connect();
    Wii::wm = wm;
    }

  3. #3
    Join Date
    Apr 2009
    Posts
    2

    Talking Re: Global Managed Type in win32 dll project

    Thank you!! works perfectly an i no how 2 do rest now! gd stuff!! :P

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured