红联Linux门户
Linux帮助

请教关于结构体问题!!

发布时间:2007-04-13 17:49:26来源:红联作者:jk1983
有两个结构体:
其一:typedef struct _rcafilelist{
HWND hwnd ;
INT8U filelist_status ;
INT8U total_items ;
INT8U focused_item_index ;
INT8U first_item_index ;
INT8U list_levels ;
INT8U title_length ;

INT32U deactive_bmp ;
INT32U deactive_focused_bmp ;
INT32U unselected_bmp;
INT32U selected_bmp ;
INT32U selected_left_bmp ;
INT32U selected_right_bmp ;
INT32U selected_both_bmp ;
INT32U picked_bmp ;
INT32U focused_picked_bmp ;

INT16U deactive_bmp_type ;
INT16U deactive_focused_bmp_type ;
INT16U unselected_bmp_type;
INT16U selected_bmp_type ;
INT16U selected_left_bmp_type ;
INT16U selected_right_bmp_type ;
INT16U selected_both_bmp_type ;
INT16U picked_bmp_type ;
INT16U focused_picked_bmp_type ;

INT16U filelist_bmp_start_x ;
INT16U filelist_bmp_start_y ;
INT16U filelist_title_start_x ;
INT16U filelist_title_start_y ;

DRAWINFO list_up_arrow_info;
DRAWINFO list_down_arrow_info;
DRAWINFO filelist_hint_info ;
TFILELISTITEM* filelist_items;

GETFILEENTRYS get_next_entrys ;
GETFILEENTRYS get_prev_entrys ;
CDNEWENTRY cd_new_entry ;
GETENTRYFULLNAMEANDTYPE get_entry_full_name ;
CDROOTENTRY cd_root_entry ;

INT16U index[MAX_INDEX_BAK];
INT16U focus[MAX_INDEX_BAK];
}TFILELIST ;
其二:
typedef struct _hwnd {
PHWND parent;
PHWND children;
PHWND siblings;
PWNDCLASS pClass;
INT32U style;
RECT winrect;
CHARSTR win_name[MAX_LENGTH_OF_WIN_CONTROL_NAME];
INT16U win_id ;
INT8U draw_info_num;
PDRAWINFO draw_info ;
WINPROC WinProc ;
INT32S userdata;
} HWND ;

而后定义了:1、PHWND hwnd;
2、TFILELIST *pList = (TFILELIST *)hwnd ;
3、 pList->filelist_hint_info.draw_data = (INT32U)EMPTY_FOLDER_HELP_STR ;
问题只是在第二句:
结构体之间的强制类型转换,到底内部是如何进行偏移地址转换的?
文章评论

共有 57 条评论

  1. 83.97.193.* 于 2007-07-17 17:08:07发表:

    http://0ae1d8b66dbbebc7d2f37ad2e501b8a1-t.xkktxb.org 0ae1d8b66dbbebc7d2f37ad2e501b8a1 http://0ae1d8b66dbbebc7d2f37ad2e501b8a1-b1.xkktxb.org 0ae1d8b66dbbebc7d2f37ad2e501b8a1 http://0ae1d8b66dbbebc7d2f37ad2e501b8a1-b3.xkktxb.org 8d1f2bfe3cbc5359328d95464cab8b7c