Results 1 to 3 of 3

Thread: This is difficult to figure out...

  1. #1

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78

    This is difficult to figure out...

    Hey everybody. Before I start, I want to say how much of help everybody has been so far with me learning C++. Thanks.

    I am trying to make a header file which can easily call the Open and Save As dialog boxes. I had written a module in VB, but I'm having trouble translating it to C++. A copy of it is attached herein. If anybody can look at it and help me out, it would be greatly appreciated. Thanks.
    Attached Files Attached Files
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

  2. #2
    amac
    Guest
    I think you have missed the point of a header file...

    its used for definitions... or declarations...

    such as function declarations, or class definitions... etc

    You shouldn't have "code"...

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    yeah, create a file opensave.c(pp) too and put the code and the OPENFILENAME struct there. And use char * instead of char[] (I think it would produce a failure to use it that way.
    Also, I would make filename a char* instead of char**, use strcpy and ask the user to allocat space for the string. Else the user could attempt to save the pointer for later use, meenwhile he calls save or open another time and the old pointer suddenly contains crap (= false file). This error would be a ***** to find.
    You also might want to use TCHARs instead of chars to make it UNICODE compatible (use _tcscpy then).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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