Click here to Skip to main content
15,889,403 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC dll creation Pin
gopalraja6-May-09 0:14
gopalraja6-May-09 0:14 
AnswerRe: MFC dll creation Pin
Rajesh R Subramanian6-May-09 0:16
professionalRajesh R Subramanian6-May-09 0:16 
GeneralRe: MFC dll creation Pin
Ahmed Charfeddine6-May-09 4:10
Ahmed Charfeddine6-May-09 4:10 
GeneralRe: MFC dll creation Pin
Rajesh R Subramanian6-May-09 4:23
professionalRajesh R Subramanian6-May-09 4:23 
AnswerRe: MFC dll creation Pin
CPallini6-May-09 0:34
mveCPallini6-May-09 0:34 
QuestionHow to show the form created in Windows Form Library from an MFC application Pin
SivaGK5-May-09 23:59
SivaGK5-May-09 23:59 
AnswerRe: How to show the form created in Windows Form Library from an MFC application Pin
Stuart Dootson6-May-09 1:36
professionalStuart Dootson6-May-09 1:36 
QuestionHelp about Message loop please Pin
reply2am5-May-09 23:53
reply2am5-May-09 23:53 
Hi There,
I am using the following example to make Win32 tab control without using MFC.
Win32 SDK C Tab Control made easy[^]

There are some business reasons that I can only use Win32 API for this.

I am able to create the tab pages. But finding weird behaviour with the messageloop.

I am making an XLL, so my dialog is opened from a selection from Excel menu item.I get a dialog box with tabs on clicking this certain menu item. Each tab has some edit boxes and buttons. which all work fine except the TAB key doesnt work to move from one item to another.

I have implemented it the same way as in above program. The problem i face are:

1. When i click on the tabs, it shows me the correct child dialog. when i change the selection of tab, it goes to the correct next dialog. so everything works fine here. But when i click on any area in the child dialog (i.e to activate the message loop), The tab key starts working on that particular selected tab, BUT after this i am not able to select any other tab. On clickin on any other tab takes me to the first tab (iSel=0)
2. When I close the dialog box from the X button in top right corner; It closes the dialog box BUT it also closes my Excel window which i dont want.


This application I am developing to configure and test some connections. so I need the excel window open after i am done with the configurations.
Please reply if you read this message. I will appreciate any help.
Regards
Ajay
ajaymat@gmail.com

The code for message loop is here

HACCEL CAuthenticationAddin::CreateAccTable (VOID)
{
   static  ACCEL  aAccel[1];
   static  HACCEL  hAccel;

   aAccel[0].fVirt=FVIRTKEY;
   aAccel[0].key=VK_ESCAPE;
   aAccel[0].cmd=CMD_VK_ESCAPE;

   aAccel[1].fVirt=FVIRTKEY;
   aAccel[1].key=VK_RETURN;
   aAccel[1].cmd=CMD_VK_RETURN;

   hAccel=CreateAcceleratorTable(aAccel,1);
   return hAccel;
}


void CAuthenticationAddin::TabPageMessageLoop (HWND hwnd)
{
   MSG      msg;
   int      status;
   BOOL handled = FALSE;

   // Create Accelerator table

   HACCEL hAccTable = CAuthenticationAddin::CreateAccTable();

   while((status = GetMessage(&msg, NULL, 0, 0 )) != 0 && !stopTabPageMessageLoop)
   { 
      if (status == -1) // Exception

      {
         return;
      }
      else
      {
         // Dialogs do not have a WM_KEYDOWN message so we will seperate

         // the desired keyboard events here

         handled = TranslateAccelerator(hwnd,hAccTable,&msg);

         // Perform default dialog message processing using IsDialogM...

         if(!handled)
            handled=IsDialogMessage(hwnd,&msg);

         // Non dialog message handled in the standard way.

         if(!handled)
         {

            TranslateMessage(&msg);
            DispatchMessage(&msg);
         }
      }
   }
   if(stopTabPageMessageLoop) //Reset: do not PostQuitMessage(0)

   {
      DestroyAcceleratorTable(hAccTable);
      stopTabPageMessageLoop = FALSE;
      return;
   }

   // Default: Re-post the Quit message

   DestroyAcceleratorTable(hAccTable);
   PostQuitMessage(0);
   return;
}

VOID CAuthenticationAddin::ResetTabPageMessageLoop (HWND hwnd)
{
   //Toggle kill sw
   stopTabPageMessageLoop=TRUE;
   stopTabPageMessageLoop=FALSE;

   SetFocus(hwnd);
   CAuthenticationAddin::TabPageMessageLoop(hwnd);
}

AnswerRe: Help about Message loop please Pin
Stuart Dootson6-May-09 1:40
professionalStuart Dootson6-May-09 1:40 
AnswerRe: Help about Message loop please Pin
serzh836-May-09 1:54
serzh836-May-09 1:54 
GeneralRe: Help about Message loop please Pin
reply2am6-May-09 4:32
reply2am6-May-09 4:32 
GeneralRe: Help about Message loop please Pin
reply2am6-May-09 4:34
reply2am6-May-09 4:34 
GeneralRe: Help about Message loop please Pin
serzh836-May-09 5:33
serzh836-May-09 5:33 
QuestionRe: Help about Message loop please Pin
reply2am8-May-09 0:49
reply2am8-May-09 0:49 
AnswerRe: Help about Message loop please Pin
KarstenK8-May-09 1:10
mveKarstenK8-May-09 1:10 
Questiongetting complete file path Pin
MahaKh5-May-09 23:50
MahaKh5-May-09 23:50 
AnswerRe: getting complete file path Pin
Rajesh R Subramanian5-May-09 23:52
professionalRajesh R Subramanian5-May-09 23:52 
GeneralRe: getting complete file path Pin
MahaKh5-May-09 23:58
MahaKh5-May-09 23:58 
AnswerRe: getting complete file path Pin
«_Superman_»5-May-09 23:56
professional«_Superman_»5-May-09 23:56 
GeneralRe: getting complete file path Pin
MahaKh6-May-09 0:02
MahaKh6-May-09 0:02 
GeneralRe: getting complete file path Pin
Divyang Mithaiwala6-May-09 1:55
Divyang Mithaiwala6-May-09 1:55 
QuestionInconstitent CTreeCtrl due to Modal Dialog [modified] Pin
__GJ__5-May-09 23:46
__GJ__5-May-09 23:46 
AnswerRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
Stuart Dootson6-May-09 2:30
professionalStuart Dootson6-May-09 2:30 
GeneralRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
__GJ__6-May-09 4:56
__GJ__6-May-09 4:56 
GeneralRe: Inconstitent CTreeCtrl due to Modal Dialog Pin
Stuart Dootson6-May-09 6:44
professionalStuart Dootson6-May-09 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.