Article # 150, added by Geoworks, historical record
| first | previous | index | next | last |

Example of AccessPointControlClass and how to use it.



Q. How do N9000C applications usually select the access point to use
   if there are several alternative choices in TCP/IP domain?

A. An AccessPointControlClass object is used. Here is an example of
   how such an object would be defined.

   @chunk TCHAR AccessPointText[] = "Internet access points";
   @object ComplexMonikerClass AccessList = {
	ComplexMoniker = AccessPointControlClass;
	CMI_iconBitmap = CMB_SERVICES_DEFINE;
	CMI_topText = @AccessPointText;
	CMI_textStyle = @default & TS_BOLD;
	GCI_output = process;
	APCI_editMsg = MSG_SERVICES_EDIT_ACCESS_POINT;
	APCI_accessType = APT_INTERNET;
	ATTR_GEN_CONTROL_REQUIRE_UI = (APCF_LIST | APCF_EDIT);
	ATTR_COMPLEX_MONIKER_PLACE_BITMAP_AT_LEFT;
	HINT_INDENT_CHILDREN;
	HINT_DRAW_IN_BOX;
	HINT_DRAW_SHADOW;
	HINT_EXPAND_HEIGHT_TO_FIT_PARENT;
	HINT_FIXED_SIZE = {
            ( SST_PIXELS | FOAM_DEFAULT_COMPONENT_WIDTH ),
            0,
            0
        };
   }


Q. If I go to see the list of available internet access points I only
   see the access point name of each entry in the list. That name would
   be an obvious choice for a "key" to find one specific access point?

A. The user identifies access points by name. The system identifies them
   by their ID number. The access point controller displays the names to
   the user, and passes the ID number of the selection to the
   application. The ID is what is used as part of the address.

   Applications should keep track of the ID internally and translate that
   to the name only when displaying the access point to users. This way
   the most current name will always be displayed. If the user types in
   a name, translate it to the ID immediately and store that.


Q. If so, it is still somewhat unclear what property to search for when
   using AccessPointGetStringPropertyBuffer() to find the name of the
   access point name displayed in the access point list?

A. You'd do something like this:

   AccessPointGetStringPropertyBuffer( myid,
                                       (char*)APSP_NAME,
                                       &mybuf,
                                       &buflen );