CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Mar 2011
    Posts
    144

    extern a public member of a class - is it possible?

    Hi guys, I was trying to access an object's member I've created in one file, from another file. The problem I think is that the member is a Private Implementation for that class. I've tried to "extern" the member with no luck. So how can I get the object from one class to another? I hope I made this clear enough...


    To make things clearer -

    //MyClass.h
    Code:
    class MyClass {
    public:
    class PImpl;
    PImpl *p;
    }
    //MyClass.cpp
    Code:
    class MyClass::PImpl {
         public:
           SomeClass * member;
    }
    
    MyClass::MyClass {
    p = new PImpl;
    p->member = SomeFunction();
    }
    and I need to access p in another header file, how?
    Last edited by drwbns; July 22nd, 2011 at 07:25 PM.

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