Home COM GDI+ WebBrowser Data Access

ICommandText Interface

 

IID_ICommandText

{0C733A27-2A1C-11CE-ADE5-00AA0044773D}

 

 

This interface is mandatory on commands.

 

A command object can have only one text command. When the command text is specified through ICommandText::SetCommandText, it replaces the existing command text.

 

Documentation: ICommandText

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

ICommand Methods

Description

Cancel

Cancels the current command execution.

Execute

Executes the command.

GetDBSession

Returns an interface pointer to the session that created the command.

ICommandText Methods

Description

GetCommandText

Returns the text command set by the last call to ICommandText::SetCommandText.

SetCommandText

Sets the command text, replacing the existing command text.

 

GetCommandText

 

DECLARE FUNCTION Proto_ICommandText_GetCommandText ( _
  BYVAL pthis AS DWORD PTR _

, BYREF pguidDialect AS GUID _

, BYREF ppwszCommand AS DWORD _

  ) AS LONG

 

FUNCTION ICommandText_GetCommandText ( _
  BYVAL pthis AS DWORD PTR _

, BYREF pguidDialect AS GUID _

, BYREF strCommand AS STRING _

  ) AS LONG


  strCommand = ""
  LOCAL HRESULT AS LONG
  LOCAL bstrlen AS LONG
  LOCAL ppwszCommand AS DWORD
  CALL DWORD @@pthis[6] USING Proto_ICommandText_GetCommandText (pthis, pguidDialect, ppwszCommand) TO HRESULT
  IF ISTRUE ppwszCommand THEN
     bstrlen = lstrlenW(BYVAL ppwszCommand)
     IF ISTRUE bstrlen THEN
        strCommand = PEEK$(ppwszCommand, bstrlen * 2)
        strCommand = ACODE$(strCommand)
     END IF
     CoTaskMemFree ppwszCommand
  END IF
  FUNCTION = HRESULT

END FUNCTION

 

 

SetCommandText

 

FUNCTION ICommandText_SetCommandText ( _
  BYVAL pthis AS DWORD PTR _

, BYREF rguidDialect AS GUID _

, BYVAL strCommand AS STRING _

  ) AS LONG


  LOCAL HRESULT AS LONG
  strCommand = UCODE$(strCommand) & $NUL
  CALL DWORD @@pthis[7] USING ICommandText_SetCommandText (pthis, rguidDialect, strCommand) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Page last updated on Saturday, 11 November 2006 03:33:08 +0100