RegisterWithMapServer
long RegisterWithMapServer(BSTR client_name, long window_handle, VARIANT dispatch_pointer);
RegisterWithMapServer registers the map server client name and main window handle with FalconView. Map server clients MUST call this function once at start up BEFORE calling any of the other functions. The parameter _dispatch_pointer_ should be of type VT_DISPATCH and should contain a pointer to the client's IDispatch interface for the callback object.
Parameters
| Name | Description |
| client_name | the name of the client application |
| window_handle | the main window handle (i.e., the main HWND) of the client application |
| dispatch_pointer | contains a pointer to the client's IDispatch interface |
Returns
- 0 (success)
- Currently RegisterWithMapServer always returns zero (0), but future implementations may return -1 (failure) if _window_handle_ is not a valid window handle.
Remarks
- Other map server functions calls may not succeed if RegisterWithMapServer has not been called.
- In Visual Basic, _dispatch_pointer_ is the βMeβ pointer to the form implementing the callbacks.
- In FalconView 4.0 and later, if _dispatch_pointer_ is not of type VT_DISPATCH, RegisterWithMapServer will return FAILURE (-1). Check the error log, \pfps\falcon\error_log.txt, for additional information (such as the type of the VARIANT passed into the method). See this discussion topic for more details on Failures.
- In C#, make sure your class has the [System.Runtime.InteropServices.ComVisible(true)] attribute, either explicitly or implicitly. If it doesn't, then the dispatch pointer will be VT_UNKNOWN rather than VT_DISPATCH and cause RegisterWithMapServer to fail.
-- Main.ChrisBailey - 02 Mar 2005

