Results 1 to 2 of 2

Thread: เกี่ยวกับการทำงานของ MFC แบบ dialog base

  1. #1
    Anonymous
    Guest


    เกี่ยวกับการทำงานของ MFC แบบ dialog base

    คือจะเขียนโปรแกรมแบบนี้ครับ

    1. สร้างไฟล์ชื่อ 001.txt

    2. วนลูปเพื่อเขียนไฟล์ที่รับมาจาก keyboard แล้วแสดงผลออกทาง control

    3. ปิดไฟล์

    ติดปัญหาตรงที่เมื่อเราเปิดไฟล์โดยใช้ pointer แล้วจะประกาศตัวแปรที่ไหนให้เป็นแบบ golbal เพื่อให้ใช้ได้ทั้งโปรแกรม และต้องประกาศที่ function ไหนของ MFC

    คือยังไม่ค่อยเข้าใจลำดับการเรียกใช้ function ของ MFC น่ะครับ

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    187


    Re: เกี่ยวกับการทำงานของ MFC แบบ dialog base

    ประกาศตัวแปรไว้ที่ไหนก็ได้ครับนอก class
    Code:
    extern int g_int; // global varaible // in file .h
    Code:
    int g_int; // in file .cpp // ประกาศไว้แค่ไฟล์เดียวในโปรเจค
    ไฟล์ไหนจะใช้ตัวแปร global ก็ include ไฟล์ .h ข้างต้นก็ใช้งานได้แล้ว

Similar Threads

  1. Base 64
    By gawala in forum แนะนำ Software ต่างๆ
    Replies: 4
    Last Post: 31-08-2010, 09:00 PM
  2. ดีด Dialog box login เข้าฐานข้อมูลเวบ Kapook
    By _tuky_ in forum บทความ คอมพิวเตอร์ ทัวไป
    Replies: 0
    Last Post: 16-11-2009, 12:56 PM
  3. Replies: 6
    Last Post: 06-12-2007, 05:51 PM
  4. Replies: 1
    Last Post: 08-03-2005, 09:58 AM
  5. Replies: 0
    Last Post: 24-12-2003, 11:04 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •