LoadStr,TCustomForm.OldCreateOrder的疑问(200分)

A

autumn

Unregistered / Unconfirmed
GUEST, unregistred user!
1.LoadStr实际如何使用?(100分)
2.TCustomForm.OldCreateOrder在delphi4中的object inspector是可见的
但在delphi5中是不见了,怎么会试?(100分)
 
2.ObjectInspector - 右键 - 选中All。
 
不要使用LoadStr,他是为了兼容而设的,使用resourcestring 吧,Delphi自动LoadStr.

这是Delphi的帮助:

LoadStr loads the string resource given by Ident from the
application's executable file. If the string resource does not exist,
an empty string is returned.

Moving display strings into string resources makes an application
easier to localize without rewriting the program.

Note: LoadStr is provided primarily for backward compatibility.
To isolate string resources, use the resourcestring keyword in new
applications.
 
1, LoadStr 很好用的,参数是资源 id 号
to 沈前卫:
不用 LoadStr , LoadString 总行吧,
ResourceString 直接在源码里, 总觉得不舒服。
 
我看个其它代码,LoadStr里的参数可以是字串也可心是整形变量,
当然必须要先前定义。
如 DFK_DKFDF= 234234
LoadStr(DEK_DKFDF);返回字串.
 
1.我知道 LoadStr(资源ID)
但是我不知道资源ID所指的资源在那里,如何创建?
2.OldCreateOrder在实际上如何使用?
 
当然在资源文件里拉,在RES文件中定义字符串,可以设定资源ID,调用的时候
就是使用这个号了。
 
举个例子:

STRINGTABLE{
1, "Hello"
2, "Goodbye"
}

把上面几行存成一个.rc文件,如test.rc
在Delphi/bin下运行:brcc32 test.rc
生成一个test.res

在程序中加上{$R test.res}
调用 s:=LoadStr(2); s就是'Goodbye'了。
 
谢谢o*o,结束问题1
 
呵呵,我原来想全答的,想想人家应该知道吧,
唉。
 
SuperMMX:
我也知道rc to res制作的全过程.但是不知道在干什么。
举个例子说明问题最好。希望以后答问题都这样就好了!
有例子优先的分。

All:
OldCreateOrder的实际用法如何?举出例子优先的分.
 
多人接受答案了。
 
顶部