Re: Beep Sound while executing the application

From: Neelesh K J Jain (NeeleshKJJain_at_discussions.microsoft.com)
Date: 01/03/05


Date: Sun, 2 Jan 2005 22:17:01 -0800

Mr. Johan,
   Can you please tell me in bit more detailedly, When I am debugging the
application then the beep sound is coming when the following if condition is
passed.
        if (!ProcessShellCommand(cmdInfo))
            return FALSE;

After this if condition the beep sound is coming and as per your suggestion
also the creation of Status bar is present in MainFrame class then also the
beep is coming from the system.

Thanking you,
Happy New Year.

"Johan Rosengren" wrote:

> Neelesh,
>
> The function is not exactly giving much of a hint of what isgoing wrong. The
> only suspicious construct is the creation of the statusbar, which really
> should not go here (rather in the mainframe). Have you tried commenting out
> that line?
>
> Johan Rosengren
> Abstrakt Mekanik AB
>
> "Neelesh K J Jain" <NeeleshKJJain@discussions.microsoft.com> a écrit dans le
> message de news:6DFED76E-C3B2-4592-BD37-4530667F6162@microsoft.com...
> > Hello Friends,
> > Whenever my application is starting its producing a beep sound and for
> > some other application it is not producing the beep sound. The code am
> using
> > in the InitInstance() is as follows:
> > BOOL CMMTRansApp::InitInstance()
> > {
> > AfxEnableControlContainer();
> >
> > AfxInitRichEdit();
> > // Standard initialization
> > // If you are not using these features and wish to reduce the size
> > // of your final executable, you should remove from the following
> > // the specific initialization routines you do not need.
> >
> > #ifdef _AFXDLL
> > Enable3dControls(); // Call this when using MFC in a shared DLL
> > #else
> > Enable3dControlsStatic(); // Call this when linking to MFC statically
> > #endif
> >
> > // Change the registry key under which our settings are stored.
> > // TODO: You should modify this string to be something appropriate
> > // such as the name of your company or organization.
> > SetRegistryKey(_T("Local AppWizard-Generated Applications"));
> >
> > LoadStdProfileSettings(); // Load standard INI file options (including
> MRU)
> >
> > // Register the application's document templates. Document templates
> > // serve as the connection between documents, frame windows and views.
> >
> > CSingleDocTemplate* pDocTemplate;
> > pDocTemplate = new CSingleDocTemplate(
> > IDR_MMTRANS_MENU,
> > RUNTIME_CLASS(CMMTRansDoc),
> > RUNTIME_CLASS(CMainFrame), // main SDI frame window
> > RUNTIME_CLASS(CMMTRansView));
> > AddDocTemplate(pDocTemplate);
> >
> > // Enable DDE Execute open
> > EnableShellOpen();
> > RegisterShellFileTypes(TRUE);
> >
> > // Parse command line for standard shell commands, DDE, file open
> > CCommandLineInfo cmdInfo;
> > ParseCommandLine(cmdInfo);
> >
> > // Dispatch commands specified on the command line
> > //AfxMessageBox("Test");
> > if (!ProcessShellCommand(cmdInfo))
> > return FALSE;
> >
> > //AfxMessageBox("Test1");
> > // The one and only window has been initialized, so show and update it.
> >
> > m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
> > // Setting the window title
> > ((CMainFrame*)AfxGetMainWnd())->SetWindowTitle();
> >
> > // Commented by Neelesh Jain
> > // Creation of the Translated Volume Progress bar
> > // should be done only after the Status bar is created.
> > // If not commented then the positioning of the progress bar is not exact
> > one.
> >
> > //display the translated volume progress bar
> > //((CMainFrame*)AfxGetMainWnd())->CreateTVolProgressBar();
> >
> > m_pMainWnd->UpdateWindow();
> >
> > return TRUE;
> > }
> >
> > I don't want to have the beep sound when the application is being
> executed.
> > Please help me regarding this problem
> >
> > Thanks in advance
> >
> > --
> > Quality is not an accident. Its the outcome of SmartWork
>
>
>