1、怎么将string转换成pAnsiChar?
例如:
var
l_iniPath:string ;
i:PAnsiChar ;
begin
//通过获取可执行文件路径,获取ini文件的路经
l_iniPath := ExtractFilePath(Application.ExeName);
l_iniPath := l_iniPath + 'Config.ini' ;
//转换string to Pchar,以适应 WritePrivateProfileString 函数
i:=@l_iniPath;
//结果会不如人意,我想是类型问题
WritePrivateProfileString('MBH_PHOTO','ScanPath','C:\Program Files\Canon\ScanGear Toolbox CS\SGTBox.exe',i);2、我用扫描仪扫描图片,图片存储在c:\scan\,每次扫描出来的图片是以scan1000.jpg ,scan1001.jpg,scan1002.jpg递增的,这是在扫描仪中设定的,我让他将文件存储为scan,jpg格式,然后设定一个基数,我设定从1000开始,扫描结果,就自动存成scan1001.jpg,
我现在想将扫描出来的图片改名,存到另一路经,但是这个文件名不是固定的,我原来的处理是这样的,在程序中调用批处理: del *.jpg //删除所有的jpg文件先
ren *.jpg temp.jpg //更改新扫描出来的文件改名为temp.jpg
copy //在考比 temp.jpg到目的文件夹我觉得很麻烦,有没有更好的办法,在delpi中如何实现的?请大家多提宝贵意见。3、我自己写的过程,函数,总出现过程前置,不满意之类的错物,是不是位置放得不正确?4、出现project project1.exe raised exception class EVarianTypeCaseError with message ''
Could not convert variant of type(null) into type (string)'.错误。
我写个查询都出这错误,学习中,关注中up