Click here to Skip to main content
15,905,504 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: size of dialog in resource editor Pin
Larry J. Siddens18-May-07 5:33
Larry J. Siddens18-May-07 5:33 
AnswerRe: size of dialog in resource editor Pin
David Crow18-May-07 6:43
David Crow18-May-07 6:43 
QuestionUse object of an external class Pin
dodoxor18-May-07 5:12
dodoxor18-May-07 5:12 
AnswerRe: Use object of an external class Pin
Larry J. Siddens18-May-07 5:26
Larry J. Siddens18-May-07 5:26 
QuestionRe: Use object of an external class Pin
dodoxor18-May-07 6:39
dodoxor18-May-07 6:39 
AnswerRe: Use object of an external class Pin
Mark Salsbery18-May-07 5:30
Mark Salsbery18-May-07 5:30 
QuestionRe: Use object of an external class Pin
dodoxor18-May-07 6:40
dodoxor18-May-07 6:40 
AnswerRe: Use object of an external class Pin
Mark Salsbery18-May-07 6:54
Mark Salsbery18-May-07 6:54 
dodoxor wrote:
Where and how must i have to declare Myclass ob=new Myclass()??


Here's one possible way - adding a MyClass pointer member object, allocated in the constructor,
freed in the destructor...
public ref class Form1 : public System::Windows::Forms::Form
{
private: 
   System::Windows::Forms::TabPage^ tabPage1;
...
protected:
   MyClass *pMyClassObject;
 
public:
   Form1(void)
   {
      InitializeComponent();
      //////......
      pMyClassObject = new MyClass();
   }
 
protected:
   ~Form1()
   {
      delete pMyClassObject;
   }
 
private: 
   System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) 
   {
      //here i want to use an object of the a class.
      pMyClassObject->Myfunction();
   }
 
   System::String^ loadtext(void)
   {
      //here i want to use the same object.
      int n;
      n=pMyClassObject->getint();
   }
}

Here's another possible way - adding a MyClass member object...
public ref class Form1 : public System::Windows::Forms::Form
{
private: 
   System::Windows::Forms::TabPage^ tabPage1;
...
protected:
   MyClass MyClassObject;
 
public:
   Form1(void)
   {
      InitializeComponent();
      //////......
   }
 
protected:
   ~Form1()
   {
   }
 
private: 
   System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) 
   {
      //here i want to use an object of the a class.
      MyClassObject.Myfunction();
   }
 
   System::String^ loadtext(void)
   {
      //here i want to use the same object.
      int n;
      n=MyClassObject.getint();
   }
}



"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

Questioncomplexclass.h ".SetTo" Pin
simoncoul18-May-07 5:07
simoncoul18-May-07 5:07 
AnswerRe: complexclass.h ".SetTo" Pin
led mike18-May-07 5:33
led mike18-May-07 5:33 
GeneralRe: complexclass.h ".SetTo" Pin
simoncoul18-May-07 5:47
simoncoul18-May-07 5:47 
QuestionRe: complexclass.h ".SetTo" Pin
Mark Salsbery18-May-07 5:33
Mark Salsbery18-May-07 5:33 
AnswerRe: complexclass.h ".SetTo" Pin
led mike18-May-07 6:05
led mike18-May-07 6:05 
GeneralRe: complexclass.h ".SetTo" Pin
Mark Salsbery18-May-07 6:13
Mark Salsbery18-May-07 6:13 
GeneralRe: complexclass.h ".SetTo" Pin
simoncoul18-May-07 6:23
simoncoul18-May-07 6:23 
GeneralRe: complexclass.h ".SetTo" Pin
led mike18-May-07 6:55
led mike18-May-07 6:55 
QuestionError in 'CWnd::Create' : function Pin
sawerr18-May-07 4:34
sawerr18-May-07 4:34 
AnswerRe: Error in 'CWnd::Create' : function Pin
Mark Salsbery18-May-07 4:55
Mark Salsbery18-May-07 4:55 
AnswerRe: Error in 'CWnd::Create' : function Pin
David Crow18-May-07 5:09
David Crow18-May-07 5:09 
QuestionHow to get path of tree elment in text format throgh CTreeCtrl class members Pin
Pankaj.Jain18-May-07 3:29
professionalPankaj.Jain18-May-07 3:29 
AnswerRe: How to get path of tree elment in text format throgh CTreeCtrl class members Pin
James R. Twine18-May-07 3:41
James R. Twine18-May-07 3:41 
QuestionTo use SQL server View Pin
mikobi18-May-07 3:26
mikobi18-May-07 3:26 
QuestionCreate Bitmap From buffer Pin
Md. Mazharul Islam Khan18-May-07 3:25
Md. Mazharul Islam Khan18-May-07 3:25 
AnswerRe: Create Bitmap From buffer Pin
Chris Losinger18-May-07 5:40
professionalChris Losinger18-May-07 5:40 
QuestionHow to send a dos command to system as we do in cmd prompt interface Pin
zhongwenjia18-May-07 2:53
zhongwenjia18-May-07 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.