Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 25th, 2007, 09:45 AM
Registered User
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help c++ programmers

hi all it is my first topic here but i really need ur help so thnx in advance for giving me some of ur time:
i am dealing with dlls so here is the problem:
i have an interface class (A) that is pure virtual and have some members and there is a pointer to another interface class class(B)in the dll.
what i need is to tell me how to access that pointer like:
myobject->thatptr=this;
thanks again for ur time

mizomizo
Reply With Quote
  #2 (permalink)  
Old October 25th, 2007, 09:32 PM
Authorized User
 
Join Date: May 2007
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Peter_APIIT
Default

*ptr. To print the content of pointer.

ptr-> - To access member function of interface class.

I hope this help.

Linux is the best OS in the world.
Reply With Quote
  #3 (permalink)  
Old October 28th, 2007, 03:17 AM
Registered User
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks peter but i didnt mean that my program consists of a dll called mydll and has a pointer called thatptr, in my application i have a mydll object called myobject so what i want is to do:
myobject->thatptr=this;
and believe me that line does not work
thanks


mizomizo
Reply With Quote
  #4 (permalink)  
Old December 21st, 2007, 02:54 PM
Registered User
 
Join Date: Dec 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You may try this, mizomizo...as an example.

#include "pThisClassA.h"
#include "ClassB.h"
#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
     pThisClassA<int> ThatPtr(new int);

     *ThatPtr = 7; // Dereference the "ThatPtr" arbitrarily.
     cout << *ThatPtr << endl;

     pThisClassA<ClassB> MyObject(new ClassB);

     MyObject->set(7); // Dereference "pThisClassA" and member select the set method.
     cout << MyObject->getValue() << endl;

     return (0);
}

Hope that helps,
Onassis


Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Power to the Programmers! James C Forum and Wrox.com Feedback 14 June 15th, 2003 10:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.