Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to use g_CmdManager class in MFC exe and Activex Control (Activex Control will loaded in MFC exe Collapse All
Subject Author Date
Rajneesh Jun 3, 2003 - 4:09 AM

Hi,
I have created a MFC exe.To give XP look i have used ProfUIS 2.21.
Now i have also created ActiveX control that has to be loaded in my MFC Exe .Here again i am using ProfUIS 2.21 for XP support.

In both of workspaces i have created separate profiles for g_CmdManager.

In Activex Control i have added these lines

#define __PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME    "ActiveX Profile COntroll"

//in OnInitDialog of Activex Dialog

g_CmdManager->ProfileSetup(__PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME);

g_CmdManager->g_bDisableCmdIfNoHandler=FALSE;

g_CmdManager->ProfileWndAdd(__PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME, m_hWnd);//Handle of Activex Dialog


g_CmdManager->UpdateFromToolBar( __PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME, IDR_MENU_TOOLBAR,false); //Tried both with false and true options

//end of OnInitDialog in Activex Dialog


//In onDestroy of Activex Dialog i have written
g_CmdManager->ProfileWndRemove( m_hWnd );



Now in On Right Click function of dialog i have written the code to show Menu. For that
i have used CExtPopupMenuWnd class.
//code is
CExtPopupMenuWnd * pPopupWnd =NULL;
pPopupWnd = new CExtPopupMenuWnd;

pPopupWnd->CreatePopupMenu(m_hWnd);
            
VERIFY(pPopupWnd!=NULL);

pPopupWnd->LoadMenu(m_hWnd,IDR_LISTMENU)==FALSE

pPopupWnd->TrackPopupMenu(TPMX_OWNERDRAW_FIXED|TPMX_NO_CMD_UI|TPMX_NO_HIDE_RARELY,ptClicked.x,ptClicked.y);
//End of code in OnightClick Menu.



In EXE where i am loading this Activex has separate Profile and Window handle.


Now when my control loaded in that dll with profuis docking style and user right click on Dialog of Activex Control,it shows me the menu that shows the list of already open docking windows.
It does not show me Activex Menu that i have loaded in On Right click. It goes in that function but loads different menu.

But when i doubleclick on DockingControl bar of Window ,than after it on Rightclick it shows me my menu.

SO that is the problem no 1.

Problem No 2 is that Whenever a menu is shown whether Activex Control’s menu or Exe’s Opened Docking window menu,it hangs my MFC Exe when i click on Control bar menu command’s.

So help me in both of these matters.

Technical Support Jun 3, 2003 - 9:04 AM

Dear Rajnesh,

We sent you two sample projects that, we hope, should answer your questions. If you encounter any problems, do not hesitate to contact us.

Rajneesh Jun 22, 2003 - 11:55 PM

The sample that you have sent me creates Activex Control direclty in CChildView class that is derived from CWnd.
What i want is to create in window that can be docked to my Mainframe class.For that i have used CExtControlBar class.I have created control in CExtControlBar derived class.
So i have mutilple CExtControlBar window classes and each window host a activex control that has its own menu that was created from ProfUis Menu class.
Now when i right click on my control that is docked with frame..first it shows me my menu and soon after that it show a menu that has list of all open CExtControlBar window.I don’t want this menu here. I only want my control,s own menu.

Technical Support Jun 24, 2003 - 10:02 AM

Dear Rajneesh,

Today we’ll send you a letter with an updated sample project attached. We hope it will meet all your requirements.