五彩積水鳳梨花

五彩積水鳳梨花
五彩積水鳳梨花

2010/01/28

直接用 OLE OBJECT 顯示圖檔


string emp_id
blob emp_pic //設定Blob變數
emp_id = '123'
Selectblob pic into :emp_pic from emp where id=:emp_id; //選取Blob的資料
//將Blob資料指定給ole_1的objectdata
ole_1.objectdata = emp_pic

沒用過 , 可以的話應該不錯

WINDOW EVENTS

WINDOW EVENTS

ActivateJust before the window becomes active
ClickedUser clicks in an unoccupied area of the window (any area with no visible, enabled control)
CloseWhen window is closed.
CloseQueryWhen you remove a window from display (close it)
DeactivateWhen window becomes inactive.
DoubleClickedWhen user double-clicks in an unoccupied area of the window (any area with no visible, enabled object).
DragDropWhen a dragged control is dropped on the window.
DragEnterDragged control enters the window.
DragLeaveDragged control leaves the window.
DragWithinDragged control is within the window.
HideJust before the window is hidden.
HotLinkAlarmAfter a DDE server app has sent (changed) data and the client DDE application has received it.
Key

When user presses a key and the insertion point is not in RichTextEdit or DataWindow edit

control.

MouseDown

When the user presses the left mouse button in an unoccupied area of the window (any area with

no visible,enabled object).

MouseMoveWhen the pointer is moved within the window.
MouseUp

When user releases the left mouse button in an unoccupied window area (any area with

no visible, enabled object).

OpenWhen a script executes the Open function for a window.
OtherWhen a Windows message occurs that is not a PowerBuilder event.
RButtonDownWhen right mouse button is pressed in an unoccupied window area (any area with no visible, enabled object).
RemoteExecWhen a DDE client application has sent a command.See the platform note at the beginning of this section
RemoteHotLinkStart

When a DDE client application wants to start a hot link.

RemoteHotLinkStopWhen a DDE client application wants to end a hot link.
RemoteRequestWhen a DDE client application requests data.
RemoteSendWhen a DDE client application has sent data.S
ResizeWhen the user or a script opens or resizes a window.
ShowWhen a script executes the Show function for this window. The event occurs just before the window is displayed.
SystemKeyWhen the insertion point is not in a line edit and the user presses ALT or ALT + another key
TimerWhen a specified number of seconds elapses after the Timer function has been called.
ToolbarMovedIn an MDI frame window, when the user moves the FrameBar or SheetBar

WINDOW - CENTRE ON OPENING

WINDOW - CENTRE ON OPENING

Put this function in an ancestor window:

Function: wf_center()

int iScreenHt, iScreenWid

environment le_env

// Get screen size from environment

GetEnvironment( le_env )

iScreenHt = PixelsToUnits( le_env.ScreenHeight, YPixelsToUnits! )

iScreenWid = PixelsToUnits( le_env.ScreenWidth, XPixelsToUnits! )

// Centre me!

this.Move( ( iScreenWid - this.Width ) / 2, ( iScreenHt - this.Height ) / 2 )

TCP/IP ADDRESS

TCP/IP ADDRESS

Structure: str_wsadata

unsignedinteger version

unsignedinteger highversion

character description[257]

character systemstatus[129]

nsignedinteger maxsockets

unsignedinteger maxupddg

string vendorinfo

External function declarations:

function int WSAStartup (uint UIVerionrequested, ref str_wsadata lpWSAdata)library "wsock32.DLL"

function int WSACleanup() library "wsock32.DLL"

function int WSAGetLastError() library "wsock32.DLL"

function int gethostname(ref string name, int namelen) library "wsock32.DLL"

function string GetHost(string lpszhost,ref blob lpszaddress) library "pbws32.dll"

PowerScript code:

String ls_ipaddress, ls_hostname

Blob{4} lb_hostadress

Integer li_version, li_rc

str_wsadata lstr_wsadata

ls_hostname = Space(128)

li_version = 257

If WSAStartup(li_version, lstr_wsadata) = 0 Then

If GetHostName(ls_hostname, Len(ls_hostname)) <>

li_rc = WSAGetLastError()

Else

GetHost(ls_hostname, lb_hostadress)

ls_ipaddress = String(Asc(String(BlobMid(lb_hostadress, 1, 1)))) + "."

ls_ipaddress += String(Asc(String(BlobMid(lb_hostadress, 2, 1)))) + "."

ls_ipaddress += String(Asc(String(BlobMid(lb_hostadress, 3, 1)))) + "."

ls_ipaddress += String(Asc(String(BlobMid(lb_hostadress, 4, 1))))

li_rc = 0

End If

Else

li_rc = WSAGetLastError()

End If

WSACleanup()