home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / workshop / prog / msconf / confsdk.exe / TEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-23  |  18.2 KB  |  638 lines

  1. /* ----------------------------------------------------------------------
  2.  
  3.     CNFTEST sample for Microsoft ActiveX Conferencing
  4.  
  5.     Unpublished work.
  6.     Copyright (c) 1996, Microsoft Corporation
  7.     All rights reserved.
  8.  
  9.     MODULE: test.c
  10.     
  11.     PURPOSE: This file calls the Scrapi APIs to establish the 
  12.     meeting connection and to perform other operations such as
  13.     information exchange. Selecting function names from the menu 
  14.     or using the toolbar buttons tests each function.
  15.     
  16.     COMMENTS: Following structures are used by the function.
  17.   
  18.         CONFADDR: Describes the meeting connection address.
  19.         CONFINFO: Describes the meeting settings.
  20.         CONFERECDIR: Describes the default receive directory
  21.                      for transferred files.
  22.         CONFNOTIFY: Describes the notification callback.
  23.         CONFUSERINFO: Describes a user within a meeting.
  24.     
  25.     Log1, Log2, Log3, Log4 are all macros defined in global.h
  26.     These functions call the Log function to print the messages
  27.     to the message window.
  28.  
  29.     
  30.     FUNCTIONS:
  31.     LONG CALLBACK MyNotifyProc()- Callback function will take
  32.         care of the meeting events    by the notification codes
  33.     VOID CmdConnect()-  Establishes the connection. Calls
  34.         ConferenceConnect. 
  35.     VOID CmdDisconnect()-  Disconnects the meeting. Calls
  36.         ConferenceDisconnect. 
  37.     VOID CmdGetInfo()- Calls ConferenceGetInfo
  38.     VOID CmdSetInfo()- Calls ConferenceSetInfo
  39.     VOID CmdSendData()- Calls ConferenceSetInfo
  40.     VOID CmdSendFile()- Calls ConferenceSendFile
  41.     VOID CmdShareWindow()- Calls ConferenceShareWindow
  42.     VOID CmdUnShareWindow()- Calls ConferenceShareWindow
  43.         with the CONF_WINDOW_UNSHARED code
  44.     VOID CmdIsWindowShared()- Calls ConferenceIsWindowShared
  45.     VOID CmdSetRecDir()- Calls ConferenceSetInfo and ConferenceGetInfo
  46.     VOID CmdEnumUser()- Calls ConferenceGetInfo
  47.     VOID CmdEnumConf()- Calls ConferenceGetInfo
  48.     VOID CmdSetNotifyProc()- Calls ConferenceSetInfo
  49.  
  50.   ----------------------------------------------------------------------- */
  51.  
  52. #include "main.h"
  53.  
  54. // Static Strings
  55. static char _szConnect[]        = "Connect";
  56. static char _szDisconnect[]     = "Disconnect";
  57. static char _szGetInfo[]        = "GetInfo";
  58. static char _szSetInfo[]        = "SetInfo";
  59. static char _szSendData[]       = "SendData";
  60. static char _szSendFile[]       = "SendFile";
  61. static char _szShareWindow[]    = "ShareWindow";
  62. static char _szUnShareWindow[]  = "UnShareWindow";
  63. static char _szIsWindowShared[] = "IsWindowShared";
  64. static char _szSetRecDir[]      = "SetRecDir";
  65. static char _szSetGuid[]        = "SetGuid";
  66. static char _szLaunchRemote[]   = "LaunchRemote";
  67. static char _szEnumUsers[]      = "EnumUsers";
  68. static char _szEnumConfs[]      = "EnumConfs";
  69.  
  70. LONG CALLBACK MyNotifyProc(HCONF hConf, DWORD dwCode, DWORD dwParam, LPVOID lpv1, LPVOID lpv2);
  71.  
  72. VOID DumpUserInfo(LPCONFUSERINFO lpUserInfo);
  73. VOID DumpConfInfo(LPCONFINFO lpConfInfo);
  74.  
  75.  
  76.  
  77. /*  C M D  C O N N E C T */
  78. /*----------------------------------------------------------------------------
  79.     %%Function: CmdConnect
  80.  
  81.     CmdConnect function executes when the user selects ConferenceConnect 
  82.     from the Test menu. 
  83.  
  84.     This function reads the conference connection address from 
  85.     the user and takes the initial conference settings information 
  86.     and then calls the ConferenceConnect function to establish a 
  87.     meeting between two systems.
  88.  
  89. ----------------------------------------------------------------------------*/
  90. VOID CmdConnect(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  91. {
  92.     CONFERR dwResult;
  93.     CONFADDR confAddr;
  94.     CONFINFO confInfo;
  95.  
  96.     if (!DlgConferenceConnect())
  97.         return;
  98.  
  99.     LogTestStart(_szConnect);
  100.  
  101.     InitStruct(&confAddr);
  102.  
  103.     confAddr.dwAddrType = gPref.iAddrType;
  104.     confAddr.psz = gPref.szDefName;    // default name
  105.     switch (gPref.iAddrType)
  106.         {
  107.     case CONF_ADDR_IP:
  108.         confAddr.dwIp = DwIpAddrFromSz(gPref.szDefName);
  109.         Log4(LOG_ALWAYS, "IPAddr=%d.%d.%d.%d",
  110.                 HIBYTE(HIWORD(confAddr.dwIp)),
  111.                 LOBYTE(HIWORD(confAddr.dwIp)),
  112.                 HIBYTE(LOWORD(confAddr.dwIp)),
  113.                 LOBYTE(LOWORD(confAddr.dwIp)) );
  114.         break;
  115.     case CONF_ADDR_MACHINENAME:
  116.         Log1(LOG_ALWAYS, "Machine Name [%s]", confAddr.psz);
  117.         break;
  118.     case CONF_ADDR_PSTN:
  119.         Log1(LOG_ALWAYS, "Telephone number [%s]", confAddr.psz);
  120.         break;
  121.     default:
  122.         Log2(LOG_ALWAYS, "Unknown string [%s] (addrType=%d)", 
  123.             (confAddr.psz == NULL) ? "<null>" : confAddr.psz, gPref.iAddrType);
  124.         break;
  125.         }
  126.  
  127.     InitStruct(&confInfo);
  128.     confInfo.dwMediaType = gPref.dwMediaType;
  129.     lstrcpy(confInfo.szConferenceName, gPref.szConferenceName);
  130.  
  131.     dwResult = ConferenceConnect(&gPref.hConf, &confAddr, &confInfo);
  132.     LogResult(_szConnect, 1, dwResult);
  133.     Log1(LOG_ALWAYS, "hConf = %08X", gPref.hConf);
  134.     LogTestStop(_szConnect);
  135. }
  136.  
  137.  
  138.  
  139. /*  C M D  D I S C O N N E C T */
  140. /*----------------------------------------------------------------------------
  141.     %%Function: CmdDisconnect
  142.  
  143.    This function executes when the user selects ConferenceDisconnect
  144.    from the Test menu.
  145.  
  146.    Function disconnects the meeting by calling the 
  147.    ConferenceDisconnect function.  
  148.  
  149. ----------------------------------------------------------------------------*/
  150. VOID CmdDisconnect(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  151. {
  152.     CONFERR dwResult;
  153.  
  154.     LogTestStart(_szDisconnect);
  155.  
  156.     dwResult = ConferenceDisconnect(gPref.hConf);
  157.     LogResult(_szDisconnect, 1, dwResult);
  158.  
  159.     gPref.hConf = NULL;
  160.  
  161.     LogTestStop(_szDisconnect);
  162. }
  163.  
  164.  
  165.  
  166. /*  C M D  G E T  I N F O */
  167. /*----------------------------------------------------------------------------
  168.     %%Function: CmdGetInfo
  169.  
  170.     Returns information about the specified meeting.
  171.  
  172.     This example calls the ConferenceGetInfo API twice to 
  173.     display the current meeting name and number of users
  174.     and to display the current receive directory for the local
  175.     machine.
  176.  
  177. ----------------------------------------------------------------------------*/
  178. VOID CmdGetInfo(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  179. {
  180.     CONFERR dwResult;
  181.     CONFINFO confInfo;
  182.     CONFRECDIR confRecDir;
  183.  
  184.     LogTestStart(_szGetInfo);
  185.  
  186.     InitStruct(&confInfo);
  187.     dwResult = ConferenceGetInfo(gPref.hConf, CONF_ENUM_CONF, &confInfo);
  188.     LogResult(_szGetInfo, 1, dwResult);
  189.     if (CONFERR_SUCCESS == dwResult)
  190.     {
  191.         DumpConfInfo(&confInfo);
  192.     }
  193.  
  194.     InitStruct(&confRecDir);
  195.     dwResult = ConferenceGetInfo(gPref.hConf, CONF_GET_RECDIR, &confRecDir);
  196.     LogResult(_szGetInfo, 2, dwResult);
  197.     if (CONFERR_SUCCESS == dwResult)
  198.     {
  199.         Log1(LOG_ALWAYS, "  Receive Directory [%s]", confRecDir.szRecDir);
  200.     }
  201.  
  202.     LogTestStop(_szGetInfo);
  203. }
  204.  
  205.  
  206.  
  207. /*  C M D  S E T  I N F O */
  208. /*----------------------------------------------------------------------------
  209.     %%Function: CmdSetInfo
  210.  
  211.     Sets current meeting information.
  212.  
  213.     This example uses the ConferenceSetInfo API to register a callback
  214.     procedure for the current meeting.
  215.  
  216. ----------------------------------------------------------------------------*/
  217. VOID CmdSetInfo(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  218. {
  219.     CONFERR dwResult;
  220.     CONFNOTIFY confNotify;
  221.  
  222.     LogTestStart(_szSetInfo);
  223.  
  224.     InitStruct(&confNotify);
  225.     confNotify.pfnNotifyProc = MyNotifyProc;
  226.  
  227.     dwResult = ConferenceSetInfo(gPref.hConf, CONF_SET_NOTIFY, &confNotify);
  228.     LogResult(_szSetInfo, 1, dwResult);
  229.  
  230.     LogTestStop(_szSetInfo);
  231. }
  232.  
  233.  
  234.  
  235. /*  C M D  L A U N C H  R E M O T E */
  236. /*----------------------------------------------------------------------------
  237.     %%Function: CmdLaunchRemote
  238.  
  239. ----------------------------------------------------------------------------*/
  240. VOID CmdLaunchRemote(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  241. {
  242.     DWORD dwResult;
  243.     CONFDEST confDest;
  244.  
  245.     if (!DlgLaunchRemote())
  246.         return;
  247.  
  248.     LogTestStart(_szLaunchRemote);
  249.  
  250.     InitStruct(&confDest);
  251.     confDest.dwUserId = gPref.dwRemoteId;
  252.     confDest.guid = gPref.guidRemote;
  253.  
  254.     dwResult = ConferenceLaunchRemote(gPref.hConf, &confDest, 0);
  255.     LogResult(_szLaunchRemote, 1, dwResult);
  256.  
  257.     LogTestStop(_szLaunchRemote);
  258. }
  259.  
  260. /*  C M D  S E N D  D A T A */
  261. /*----------------------------------------------------------------------------
  262.     %%Function: CmdSendData
  263.  
  264.     Sends data to other meeting participants.
  265.  
  266.     This example uses the ConferenceSendData API to transmit
  267.     application specific data to all other meeting members.
  268.  
  269.     Note: currently all members of a meeting will receive
  270.     any data transmitted by this API. 
  271.  
  272. ----------------------------------------------------------------------------*/
  273. VOID CmdSendData(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  274. {
  275.     CONFERR dwResult;
  276.     CONFDEST confDest;
  277.  
  278.     if (!DlgSendData())
  279.         return;
  280.  
  281.     LogTestStart(_szSendData);
  282.  
  283.     InitStruct(&confDest);
  284.     confDest.guid = gPref.guid;
  285.     confDest.dwUserId = gPref.dwRemoteId;
  286.  
  287.     dwResult = ConferenceSendData(gPref.hConf, &confDest,
  288.         gPref.szData, CbSz(gPref.szData), 0);
  289.  
  290.     LogResult(_szSendData, 1, dwResult);
  291.     LogTestStop(_szSendData);
  292.     return;
  293. }
  294.  
  295.  
  296. /*  C M D  S E N D  F I L E */
  297. /*----------------------------------------------------------------------------
  298.     %%Function: CmdSendFile
  299.  
  300.     Sends a file to other meeting participants.
  301.  
  302.     This example uses the ConferenceSendData API to transmit
  303.     application specific data to all other meeting members.
  304.  
  305.     Note: currently all members of a meeting will receive
  306.     any data transmitted by this API. 
  307.  
  308. ----------------------------------------------------------------------------*/
  309. VOID CmdSendFile(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  310. {
  311.     CONFERR dwResult;
  312.     CHAR  szFileName[MAX_PATH];
  313.  
  314.     LogTestStart(_szSendFile);
  315.  
  316.     if (!FGetFileName(szFileName))  // Get the file name
  317.         return;
  318.  
  319.     dwResult = ConferenceSendFile(gPref.hConf, NULL, szFileName, CONF_SF_NOWAIT);
  320.     LogResult(_szSendFile, 1, dwResult);
  321.  
  322.     LogTestStop(_szSendFile);
  323. }
  324.  
  325. /*  C M D  S H A R E  W I N D O W */
  326. /*----------------------------------------------------------------------------
  327.     %%Function: CmdShareWindow
  328.  
  329.     Shares this test application with other meeting participants.
  330.  
  331.     The coolest API in the world!  This example uses the 
  332.     ConferenceShareWindow API to share this test application 
  333.     with all other meeting participants.
  334.  
  335. ----------------------------------------------------------------------------*/
  336. VOID CmdShareWindow(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  337. {
  338.     CONFERR dwResult;
  339.  
  340.     LogTestStart(_szShareWindow);
  341.  
  342.     dwResult = ConferenceShareWindow(hwnd, gPref.hConf, CONF_SW_SHARE);
  343.     LogResult(_szShareWindow, 1, dwResult);
  344.  
  345.     LogTestStop(_szShareWindow);
  346. }
  347.  
  348.  
  349. /*  C M D  U N  S H A R E  W I N D O W */
  350. /*----------------------------------------------------------------------------
  351.     %%Function: CmdUnShareWindow
  352.  
  353.     Unshares this test application with other meeting participants.
  354.  
  355.     The 2nd coolest API in the world!  This example uses the 
  356.     ConferenceShareWindow API to stop sharing this test application 
  357.     with all other meeting participants.
  358.  
  359. ----------------------------------------------------------------------------*/
  360. VOID CmdUnShareWindow(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  361. {
  362.     CONFERR dwResult;
  363.  
  364.     LogTestStart(_szUnShareWindow);
  365.  
  366.     dwResult = ConferenceShareWindow(hwnd, gPref.hConf, CONF_SW_UNSHARE);
  367.     LogResult(_szUnShareWindow, 1, dwResult);
  368.  
  369.     LogTestStop(_szUnShareWindow);
  370. }
  371.  
  372. /*  C M D  I S  W I N D O W  S H A R E D */
  373. /*----------------------------------------------------------------------------
  374.     %%Function: CmdIsWindowShared
  375.  
  376.     Checks to see if the specified window has been shared successfully.
  377.  
  378.     This example uses the ConferenceIsWindowShared API to check the
  379.     shared status of this test application.  The ConferenceIsWindowShared
  380.     API returns TRUE if the window is currently shared, FALSE if not.
  381.  
  382. ----------------------------------------------------------------------------*/
  383. VOID CmdIsWindowShared(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  384. {
  385.     BOOL  fShared;
  386.  
  387.     LogTestStart(_szIsWindowShared);
  388.  
  389.     fShared = ConferenceIsWindowShared(hwnd, &gPref.hConf);
  390.     Log3(LOG_ALWAYS, "%s Test 1 Result=%d [%X]", _szIsWindowShared, fShared, gPref.hConf);
  391.  
  392.     LogTestStop(_szIsWindowShared);
  393. }
  394.  
  395.  
  396. /*  C M D  S E T  R E C  D I R */
  397. /*----------------------------------------------------------------------------
  398.     %%Function: CmdSetRecDir
  399.  
  400.     Set the file transfer receive directory on the local machine
  401.  
  402.     This example uses the ConferenceSetInfo API
  403.  
  404. ----------------------------------------------------------------------------*/
  405. VOID CmdSetRecDir(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  406. {
  407.     CONFERR dwResult;
  408.     CONFRECDIR confRecDir;
  409.  
  410.     LogTestStart(_szSetRecDir);
  411.  
  412.     InitStruct(&confRecDir);
  413.  
  414.     if (!FGetDirectory(confRecDir.szRecDir))
  415.         return;
  416.  
  417.     dwResult = ConferenceSetInfo(gPref.hConf, CONF_SET_RECDIR, &confRecDir);
  418.     LogResult(_szSetRecDir, 1, dwResult);
  419.  
  420.     dwResult = ConferenceGetInfo(gPref.hConf, CONF_GET_RECDIR, &confRecDir);
  421.     LogResult(_szSetRecDir, 2, dwResult);
  422.  
  423.     Log1(LOG_ALWAYS, "Receive Directory [%s]", confRecDir.szRecDir);
  424.  
  425.     LogTestStop(_szSetRecDir);
  426. }
  427.  
  428.  
  429. /*  C M D  E N U M  U S E R */
  430. /*----------------------------------------------------------------------------
  431.     %%Function: CmdEnumUser
  432.  
  433.     Walk the roster of meeting participants and display user info
  434.  
  435.     This example uses the ConferenceGetInfo API in a loop to display
  436.     user information for all meeting attendees.
  437.  
  438. ----------------------------------------------------------------------------*/
  439. VOID CmdEnumUser(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  440. {
  441.     CONFERR dwResult;
  442.     CONFUSERINFO confUserInfo;
  443.  
  444.     LogTestStart(_szEnumUsers);
  445.  
  446.     InitStruct(&confUserInfo);
  447.  
  448.     for ( ; ; )
  449.     {
  450.         dwResult = ConferenceGetInfo(gPref.hConf, CONF_ENUM_USER, &confUserInfo);
  451.         if (CONFERR_SUCCESS != dwResult)
  452.         {
  453.             if (CONFERR_ENUM_COMPLETE != dwResult)
  454.                 Log1(LOG_ALWAYS, "ConferenceGetInfo result=%d", dwResult);
  455.             break;
  456.         }
  457.         DumpUserInfo(&confUserInfo);
  458.     }
  459.     LogTestStop(_szEnumUsers);
  460. }
  461.  
  462.  
  463. /*  C M D  E N U M  C O N F */
  464. /*----------------------------------------------------------------------------
  465.     %%Function: CmdEnumConf
  466.  
  467.     Enumerate all conferences on the current machine.
  468.  
  469.     Not a very interesting example since we only allow one conference
  470.     at a time right now.  But this example shows how to list all
  471.     conferences on the machine.
  472.  
  473. ----------------------------------------------------------------------------*/
  474. VOID CmdEnumConf(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  475. {
  476.     CONFERR dwResult;
  477.     CONFINFO confInfo;
  478.  
  479.     LogTestStart(_szEnumConfs);
  480.  
  481.     InitStruct(&confInfo);
  482.  
  483.     for ( ; ; )
  484.     {
  485.         dwResult = ConferenceGetInfo(gPref.hConf, CONF_ENUM_CONF, &confInfo);
  486.         if (CONFERR_SUCCESS != dwResult)
  487.         {
  488.             if (CONFERR_ENUM_COMPLETE != dwResult)
  489.                 Log1(LOG_ALWAYS, "ConferenceGetInfo result=%d", dwResult);
  490.             break;
  491.         }
  492.         DumpConfInfo(&confInfo);
  493.         if (0 == confInfo.hConf)
  494.         {
  495.             Log(LOG_ALWAYS, "Null hConf field!");
  496.             break;
  497.         }
  498.     }
  499.     LogTestStop(_szEnumConfs);
  500. }
  501.  
  502.  
  503. /*  C M D  S E T  G U I D */
  504. /*----------------------------------------------------------------------------
  505.     %%Function: CmdSetGuid
  506.  
  507. ----------------------------------------------------------------------------*/
  508. VOID CmdSetGuid(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  509. {
  510.     DWORD dwResult;
  511.     CONFGUID confGuid;
  512.  
  513.     if (!DlgGuid())
  514.         return;
  515.  
  516.     LogTestStart(_szSetGuid);
  517.  
  518.     InitStruct(&confGuid);
  519.     confGuid.guid = gPref.guid;
  520.     confGuid.pszApplication  = gPref.szAppName;
  521.     confGuid.pszCommandLine  = gPref.szCmdLine;
  522.     confGuid.pszDirectory  = gPref.szCurrDir;
  523.  
  524.     dwResult = ConferenceSetInfo(gPref.hConf, CONF_SET_GUID, &confGuid);
  525.     LogResult(_szSetGuid, 1, dwResult);
  526.  
  527.     LogTestStop(_szSetGuid);
  528. }
  529.  
  530.  
  531. /*  M Y  N O T I F Y  P R O C */
  532. /*----------------------------------------------------------------------------
  533.     %%Function: MyNotifyProc
  534.  
  535.     The conference notification handler.
  536.  
  537.     Currently this callback sinmply displays the notification messages
  538.     and relevant information in the message window.  
  539.  
  540. ----------------------------------------------------------------------------*/
  541. LONG CALLBACK MyNotifyProc(HCONF hConf, DWORD dwCode, DWORD dwParam, LPVOID lpv1, LPVOID lpv2)
  542. {
  543.     // print the text of the notification message
  544.     Log4(LOG_ALWAYS, "[%s]\t[%08X] (%08X, %08X)", GetConfnString(dwCode), dwParam, lpv1, lpv2);
  545.  
  546.  
  547.     // display user or meeting information in the message box.
  548.     switch (dwCode)
  549.         {
  550.     case CONFN_CONFERENCE_INIT:
  551.     case CONFN_CONFERENCE_START:
  552.     case CONFN_CONFERENCE_STOP:
  553.     case CONFN_CONFERENCE_ERROR:
  554.         DumpConfInfo(lpv2);
  555.         break;
  556.  
  557.     case CONFN_USER_ADDED:
  558.     case CONFN_USER_REMOVED:
  559.         DumpUserInfo(lpv2);
  560.         break;
  561.  
  562.     case CONFN_PEER_ADDED:
  563.         Trace("Peer Added: dwUserId=%X (%d)", dwParam, dwParam);
  564.         break;
  565.     case CONFN_PEER_REMOVED:
  566.         Trace("Peer Removed: dwUserId=%X (%d)", dwParam, dwParam);
  567.         break;
  568.  
  569.     case CONFN_WINDOW_SHARED:
  570.     case CONFN_WINDOW_UNSHARED:
  571.         break;
  572.  
  573.     case CONFN_DATA_SENT:
  574.         Log2(LOG_NORMAL, "Data Send: [%s] %d bytes", lpv2, dwParam);
  575.         break;
  576.     case CONFN_DATA_RECEIVED:
  577.         Log2(LOG_NORMAL, "Data Recv: [%s] %d bytes", lpv2, dwParam);
  578.         break;
  579.  
  580.     case CONFN_FILESEND_START:
  581.     case CONFN_FILESEND_PROGRESS:
  582.     case CONFN_FILESEND_COMPLETE:
  583.     case CONFN_FILESEND_ERROR:
  584.     case CONFN_FILERECEIVE_START:
  585.     case CONFN_FILERECEIVE_PROGRESS:
  586.     case CONFN_FILERECEIVE_COMPLETE:
  587.     case CONFN_FILERECEIVE_ERROR:
  588.         break;
  589.  
  590.     default:
  591.         break;
  592.         } /* dwCode */
  593.  
  594.     return 0;
  595. }
  596.  
  597.  
  598.  
  599. /*  C M D  S E T  N O T I F Y  P R O C */
  600. /*----------------------------------------------------------------------------
  601.     %%Function: CmdSetNotifyProc
  602.  
  603.     Set the notification callback for the conference.
  604.  
  605.     Sets or Unsets the notification callback procedure for the conference.    
  606.  
  607. ----------------------------------------------------------------------------*/
  608. VOID CmdSetNotifyProc(HWND hwnd, WORD wCmd, WORD wNotify, HWND hwndCtrl)
  609. {
  610.     CONFERR dwResult;
  611.     CONFNOTIFY confNotify;
  612.     static BOOL _fSetNotify = fFalse;
  613.  
  614.     InitStruct(&confNotify);
  615.     confNotify.pfnNotifyProc = MyNotifyProc;
  616.     confNotify.guid = gPref.guid;
  617.  
  618.     dwResult = ConferenceSetInfo(NULL,
  619.         _fSetNotify ? CONF_REMOVE_NOTIFY : CONF_SET_NOTIFY, &confNotify);
  620.  
  621.     if (CONFERR_SUCCESS == dwResult)
  622.     {
  623.         _fSetNotify = !_fSetNotify;
  624.  
  625.         Log(LOG_ALWAYS,
  626.             _fSetNotify ? "Notification callback established"
  627.             : "Notification callback removed");
  628.     }
  629.     else
  630.     {
  631.         Log1(LOG_ALWAYS, "*** ConferenceSetInfo result=%s",
  632.             GetConferrString(dwResult));
  633.     }
  634.  
  635.     CheckMenuItem(ghMenu, IDM_SET_NOTIFY,
  636.         _fSetNotify ? MF_CHECKED : MF_UNCHECKED);
  637. }
  638.