//声明: LoadString( hInstance: HINST; {EXE 或 DLL 的句柄} uID: UINT; {资源 ID} lpBuffer: PChar; {缓冲区} nBufferMax: Integer {缓冲区大小} ): Integer; {返回字串实际长度}学习使用资源文件系列
//假如有这样一个字符串资源: StringTable begin 0 "String_One" 1 "String_Two" end {上面给出了资源源文件, 关于资源文件的生成请参见:}
//调用代码: procedure TForm1.Button1Click(Sender: TObject); var sp: array[0..254] of Char; begin LoadString(HInstance, 0, sp, SizeOf(sp)); ShowMessage(sp); {String_One} LoadString(HInstance, 1, sp, SizeOf(sp)); ShowMessage(sp); {String_Two} end;