当我在代码中使用Delphi指令时,例如:
{$IFDEF something}
.
.
.
{$ENDIF}
Run Code Online (Sandbox Code Playgroud)
我在哪里为项目分配"某事"这个词?我在一些地方试过项目选项,但它没有用.猜猜我找不到正确的.
我需要有关如何解决这个问题的建议.我有一些图片数据:*.jpg,*.bmp ...我需要从中提取数据.数据是字母数字文本.我在德尔福工作.
我正在尝试使用以下代码在ODBC数据源管理器中在用户DSN中创建一个新条目:
procedure TForm1.FormCreate(Sender: TObject);
var strAttributes: string;
wideChars : array[0..1000] of WideChar;
pfErrorCode: DWORD;
errMsg: PChar;
begin
strAttributes := 'DSN=' + 'example_DSN' + Chr(0);
strAttributes := strAttributes + 'DESCRIPTION=' + 'description' + Chr(0);
strAttributes := strAttributes + 'SERVER=' + 'testserver' + Chr(0);
strAttributes := strAttributes + 'DATABASE=' + 'somedatabase' + Chr(0);
StringToWideChar(strAttributes, wideChars, 12);
if not SqlConfigDataSource(0, ODBC_ADD_DSN, 'SQL Server', wideChars) then
begin
errMsg := AllocMem(SQL_MAX_MESSAGE_LENGTH);
SQLInstallerError(1, @pfErrorCode, errMsg, SQL_MAX_MESSAGE_LENGTH, nil);
MessageBox(0, errMsg, PChar('Add System DSN Error #' + IntToStr(pfErrorCode)), …Run Code Online (Sandbox Code Playgroud) 我需要强制Delphi中的alt + shift来制作应用程序的语言.我尝试用keybd_event调用它两次,但它没有做到这一点.
在以前的Delphi版本中,代码如下:
var InBuf: array[1..45] of Byte;
Count := InStream.Read(InBuf, SizeOf(InBuf));
Run Code Online (Sandbox Code Playgroud)
用正确的值填充变量InBuf(每个字节都有一个值).现在在Delphi XE中,数组的每个第二个字节都是0,我想是因为Byte数据类型是Delphi XE中的Unicode性质的两倍大.但是,我的流已经生成并且需要通过这个过程,所以我需要另一种类型(可能?),如果有人遇到这个问题,那是Byte的一半大小或另一种解决方案.谢谢