IE.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:2k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // IE.cpp : Defines the initialization routines for the DLL.
- //
- #include "stdafx.h"
- #include "IE.h"
- #include "MainFrame.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /*
- 协同浏览模块
- 接口
- 1 、 创建IE窗口
- 2 、 设定url
- 数据包的定义可以定义为
- 窗口号 id + url
- 窗口号是标志着IE窗口的唯一值,通过这个id可以通知远程同id号的窗口的url改变
- */
- BEGIN_MESSAGE_MAP(CIEApp, CWinApp)
- //{{AFX_MSG_MAP(CIEApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CIEApp construction
- CIEApp::CIEApp()
- {
- }
- /////////////////////////////////////////////////////////////////////////////
- // The one and only CIEApp object
- CIEApp theApp;
- //创建窗口
- extern "C" __declspec( dllexport ) CWnd * CreateIEWnd( void ( * OnIEURL )( void * wParam , CWnd * pWnd , char * buffer , int size ) , void * wParam , const char * user_name )
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CMainFrame * frame = new CMainFrame( );
- frame->OnIEURL = OnIEURL;
- frame->wParam = wParam;
- frame->user_name = user_name;
- return frame;
- }
- //设定消息
- extern "C" __declspec( dllexport ) void SetIEMessage( CWnd * pIEWnd , char * buffer , int size )
- {
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
- if( ! ::IsWindow( pIEWnd->GetSafeHwnd( ) ) || ! buffer )
- return;
- //解析数据包
- //id值
- int id = *( int * )buffer; buffer += sizeof( int );
- //2、用户名
- CString username = (char * )buffer; buffer += username.GetLength( ) + sizeof( char );
- //3、网址
- //转换为框架窗口
- CMainFrame * frame = ( CMainFrame * )pIEWnd;
- //查找对应的ie窗口
- CIEView * ieView = NULL;
- for( int i = 0 ; ; i ++ )
- {
- ieView = frame->GetView( )->GetIEView( i );
- //找到ie窗口
- if( ! ieView || ( ieView->ieid == id && ieView->username == username ) )
- break;
- }
- if( ! ieView )
- { //创建ie窗口
- ieView = frame->GetView( )->CreateIEView( );
- //给定用户名
- ieView->username = username;
- //给定id
- ieView->ieid = id;
- }
- ieView->Stop( );
- //浏览
- ieView->Navigate2( buffer );
- }
English
