Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WapOpen

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This function opens a handle for sending a WAP message.


HRESULT WapOpen(
  const WAP_LAYER wlLayer,
  const DWORD dwLocalPort,
  WAP_HANDLE* const pwhHandle,
  HANDLE* const phMessageAvailableEvent 
);

wlLayer

[in] A WAP_LAYER structure containing the WAP layer for which to open the handle.

dwLocalPort

[in] Local port to use. This port is similar to a sockets port, and is used by WAP applications in sending and receiving PDUs. If the requested port is already in use, the function will fail. If a specific local port is not required, a value of 0 can be passed in for this parameter.

pwhHandle

[out] Pointer to the handle to open. This handle will be used in subsequent WAP function calls.

phMessageAvailableEvent

[out] Pointer to the handle for an event to signal when a new WAP packet arrives. The WAP provider creates this event and destroys it via WapClose. For more information, see the "Remarks" section.

Returns S_OK if successful. If unsuccessful, this function returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL.

Only one WAP client can have a handle bound to a specific local port at a time. The current event handle will be destroyed on a call to WapClose. Behavior is undefined if the user destroys the event handle directly, instead of by calling WapClose.

Applications should only wait on the event by calling suitable Microsoft Win32® API functions (WaitForSingleObject, WaitForMultipleObjects, and so on). They should should not use the handle with any other API function, for example, SetEvent, ResetEvent.

Headerwap.h
LibraryWap.lib
Windows Embedded CEWindows Embedded CE 6.0 and later
Windows MobilePocket PC 2002 and later, Smartphone 2002 and later

Community Additions

Show:
© 2014 Microsoft