Note that there are some explanatory texts on larger screens.

plurals
  1. POOracle Forms 6i SendMessage with String
    primarykey
    data
    text
    <p>I am converting my pascal code to PL/SQL for use with Oracle Forms 6i. My pascal code below, works perfectly.</p> <pre><code>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 &lt;&gt; 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. </code></pre> <p>I have successfully translated all of the apis using the ora_ffi package.</p> <p>I am having trouble translating the below line from Pascal to PL/SQL (which saves the captured picture to a specified location identified by FileName).</p> <pre><code>SendMessageA(CaptureWindow, WM_CAP_SAVEDIB, 0, **LongInt**(FileName)); </code></pre> <p>because I am unsure how to pass the FileName as a PLS_INTEGER (see bold for how I achieve this with pascal) which the SendMessageA definition requires. With pascal I can just cast the FileName to LongInt (does this return a pointer to the FileName? If so, I would like to emulate this casting with PL/SQL).</p> <p>NOTE: The question is about how to convert <strong>Pascal</strong> to <strong>PL/SQL</strong>. The Pascal code works fine.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload