Win32汇编如何读取INI文件中的中文键名和键值
对话框是用RadASM自带的设计器设计的.dlg文件,相关代码我附上:
;获取完整路径
invoke GetCurrentDirectory,MAX_PATH,addr szConfigName
mov esi,offset szConfigName
invoke lstrlen,esi
mov ecx,offset szConfig
.if byte ptr [esi+eax-1]=='\'
inc esi
.endif
invoke lstrcat,esi,ecx
invoke SendMessage,hWinListTH,LB_RESETCONTENT,0,0
invoke GetPrivateProfileSection,addr szSection,\
addr szBuffer,sizeof szBuffer,addr szConfigName ;
mov ebx,offset szBuffer
.while byte ptr [ebx]
;---------
;获取键值
;---------
mov esi,ebx
invoke lstrlen,esi
add esi,eax
.while byte ptr [esi]!="="
dec esi
.endw
inc esi
invoke lstrcpy,addr szValue,esi
;---------
;获取键名
;---------
mov edi,ebx
invoke lstrlen,edi
add edi,eax
.while byte ptr[edi]!="\"
dec edi
.endw
inc edi
invoke lstrcpy,addr szKey,edi
invoke SendMessage,hWinListTH,LB_ADDSTRING,0,addr szValue
invoke SendMessage,hWinListTH,LB_SETITEMDATA,eax,addr szKey
invoke lstrlen,ebx
add ebx,eax
inc ebx
.endw
这段代码在另一个程序中正常,不过对话框是我直接在.RC文件里创建的,请教问题可能在哪些地方??