Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带字符串的Oracle Forms 6i SendMessage_Oracle_Delphi_Plsql_Sendmessage - Fatal编程技术网

带字符串的Oracle Forms 6i SendMessage

带字符串的Oracle Forms 6i SendMessage,oracle,delphi,plsql,sendmessage,Oracle,Delphi,Plsql,Sendmessage,我正在将pascal代码转换为PL/SQL,以便与Oracle Forms 6i一起使用。下面是我的pascal代码,工作非常好 program WebcamTest; //cswi //www.delphibasics.info const WM_CAP_DRIVER_CONNECT = 1034; WM_CAP_GRAB_FRAME = 1084; WM_CAP_SAVEDIB = 1049; WM_CAP_DRIVER_DISCONNECT = 1035; functio

我正在将pascal代码转换为PL/SQL,以便与Oracle Forms 6i一起使用。下面是我的pascal代码,工作非常好

program WebcamTest;
//cswi
//www.delphibasics.info
const
  WM_CAP_DRIVER_CONNECT = 1034;
  WM_CAP_GRAB_FRAME = 1084;
  WM_CAP_SAVEDIB = 1049;
  WM_CAP_DRIVER_DISCONNECT = 1035;

function SendMessageA(hWnd: Integer;
                      Msg: Integer;
                      wParam: Integer;
                      lParam: Integer): Integer;
                      stdcall;
                      external 'user32.dll' name 'SendMessageA';

function capGetDriverDescriptionA(DrvIndex: Cardinal;
                                  Name: PAnsiChar;
                                  NameLen: Integer;
                                  Description: PAnsiChar;
                                  DescLen: Integer) : Boolean;
                                  stdcall;
                                  external 'avicap32.dll' name 'capGetDriverDescriptionA';

function capCreateCaptureWindowA(lpszWindowName: PAnsiChar;
                                 dwStyle: Integer;
                                 x : Integer;
                                 y : Integer;
                                 nWidth : Integer;
                                 nHeight : Integer;
                                 ParentWin: Integer;
                                 nId: Integer): Integer;
                                 stdcall;
                                 external 'avicap32.dll' name 'capCreateCaptureWindowA';

function IntToStr(i: Integer): String;
begin
  Str(i, Result);
end;

var
  WebCamId : Integer;
  CaptureWindow : Integer;
  x : Integer;
  FileName : PAnsiChar;
begin
  WebcamId := 0;
  CaptureWindow := capCreateCaptureWindowA('CaptureWindow', 0, 0, 0, 0, 0, 0, 0);
  if CaptureWindow <> 0 then
  begin
    if SendMessageA(CaptureWindow, WM_CAP_DRIVER_CONNECT, WebCamId, 0) = 1 then
    begin
      for x := 1 to 20 do // Take 20 photos.
      begin
        SendMessageA(CaptureWindow, WM_CAP_GRAB_FRAME, 0, 0);
        FileName := PAnsiChar('C:\Test' + IntToStr(x) + '.bmp');
        SendMessageA(CaptureWindow, WM_CAP_SAVEDIB, 0, LongInt(FileName));
      end;
    end;
    SendMessageA(CaptureWindow, WM_CAP_DRIVER_DISCONNECT, 0, 0);
  end;
end.
因为我不确定如何将文件名传递为SendMessageA定义所要求的PLS_整数(请参见粗体,了解如何使用pascal实现此目的)。使用pascal,我可以将文件名强制转换为LongInt(这是否返回指向文件名的指针?如果是,我想用PL/SQL模拟这种转换)

注意:问题是关于如何将Pascal转换为PL/SQL。Pascal代码运行良好


有什么想法吗?

你的问题很让人困惑,因为它包含了很多不相关的代码。这让人觉得你在问一个关于如何用Pascal做某事的问题,而你提供了很少的文本来说明其他问题。我建议编辑以删除顶部的整个代码块,并将您包含的内容限制在
SendMessageA
行,并解释您在PL/SQL中遇到的问题。@Danny,在谷歌上搜索,我建议您最好从项目中创建一个库,并使用
ORA_FFI
包使用库,而不是尝试在PL/SQL中创建这样一个外观简单但相当复杂的东西。
SendMessageA(CaptureWindow, WM_CAP_SAVEDIB, 0, **LongInt**(FileName));