TAILIEUCHUNG - Teach Yourself Visual C++ 6 in 21 Days phần 10

Mở Wizard Class. Tạo một lớp mới cho hộp thoại mới. Cung cấp cho các lớp mới CMoveToDlg tên. Sau khi bạn tạo ra các lớp mới, thêm một biến để kiểm soát Edit Box. Xác định rõ loại biến như lâu dài và đặt tên là m_lRowNbr. 3. Thêm một mục nhập trình đơn menu chính của ứng dụng. Chỉ định các thuộc tính đơn như trong bảng . | Using MFC s Helper Classes 701 I One of the most useful aspects of these array classes is their capability to grow dynamically. Normal C C arrays are predefined in size and can be extended only by lots of messy reallocations of memory. The collection classes hide these reallocations so that you can simply call the Add member of an array object to add a new value. For example to add strings to a CStringArray you can use code similar to this CStringArray myStringArray Red Green Blue You can then find the size of an array by calling the GetSize function for example the following line used after the previous lines would return three items into nNumberOfltems int nNumberOfltems You can also set the array to a specific size using the corresponding SetSize function which will extend or truncate the array to the specified size you pass. Values can be set to the array by using the SetAt function that passes a zero-based index and the value to be stored. SetAt will assert whether the index is larger than the current array size. You can then retrieve values from the array using the GetAt function which will return the value at the index position that you specify. You might use these functions with a CWordArray like this CWordArray myWordArray 20 0 200 l9 500 TRACE Value at index position 19 is d n 19 These lines will set the first element of a 20-element array to 200 and the last to 500 and display the value 500 when executed. You can still grow the array by calling the Add function and find the uppermost valid index by calling GetUpperBound which will return the zero-based index or -1 if there are no elements present. You can use the operators to set and get values at a specific index just like a normal C array. For example the GetAt and SetAt functions in the previous lines could be replaced with the operators like this .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.