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

    Question A simple problem

    Hi,
    Im tring to use a function i declare on my main.cpp file in a class function:

    it look something like this:

    main.cpp
    #include <Calc.h>

    void Log(String str)
    {
    *add to log file*
    }

    void main()
    {
    //Log File declare
    Calc ck(some numbers)
    }

    And i want to write to log file from the function in Calc class
    Its possiable???

    thnx

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: A simple problem

    Quote Originally Posted by shiranraviv View Post
    ... And i want to write to log file from the function in Calc class
    Its possiable???
    Yes.
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2009
    Posts
    2

    Unhappy Re: A simple problem

    How it is possiable?
    Because i tried everything i know...

    please help...

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: A simple problem

    Quote Originally Posted by shiranraviv View Post
    How it is possiable?
    Because i tried everything i know...
    Really?
    I didn't see anything you "tried".
    Victor Nijegorodov

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: A simple problem

    Quote Originally Posted by shiranraviv View Post
    How it is possiable?
    Because i tried everything i know...

    please help...
    Show us what you tried. Have a look at CStdioFile from MFC.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: A simple problem

    Pass whatever type of file you're using by reference to your function.

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