Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Paul Belikian

@Paul Belikian
About
Posts
170
Topics
22
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Uhhhh!!!! Header problem after installing (and uninstalling) VS2008 SP1.
    P Paul Belikian

    Try here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=239a9a68-211b-4ceb-9c2c-392b5ba5f617&displaylang=en[^]

    C / C++ / MFC help announcement csharp c++ visual-studio

  • Uhhhh!!!! Header problem after installing (and uninstalling) VS2008 SP1.
    P Paul Belikian

    Gee, what do you know - There's an update MS patch to fix VS2008 SP1 :mad: :mad::mad:

    C / C++ / MFC help announcement csharp c++ visual-studio

  • Uhhhh!!!! Header problem after installing (and uninstalling) VS2008 SP1.
    P Paul Belikian

    Well, I finally tracked it down. It makes NO sense to me but after I changed the order of the header files, I got an error specifying there was not enough memory to compile the resources - the message suggested using the /Zmxxx option which I did. This got me passed the errors and such. I did get another unrelated error at the step of embedding the manifest file: Mt.exe not found. I searched for the exe and it was not in the bin folder (where I assumed it was before installing SP1) sooo - I pointed the search path to use VS2005's MT.EXE. What a mess, but it compiles and runs now!

    C / C++ / MFC help announcement csharp c++ visual-studio

  • Uhhhh!!!! Header problem after installing (and uninstalling) VS2008 SP1.
    P Paul Belikian

    Hi, Thanks for your suggestion! The header file is rather large and is part of VC9, C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtr1common.h. After doing a Google search, I see that MS implemented a new specification in SP1 and a lot of people are getting these "explicit specialization" messages. I won't call them errors since I probably am missing something, however I'm just going to uninstall VS2008 and re-install it without SP1. At least the application could be compiled, and run before SP1 ...I just don't have time to track this down or learn the new requirements at this point. Thank you again, Paul

    C / C++ / MFC help announcement csharp c++ visual-studio

  • Uhhhh!!!! Header problem after installing (and uninstalling) VS2008 SP1.
    P Paul Belikian

    My little application was compiling fine as is until I installed the VS2008 SP1 yesterday. I mean it compiled fine, then I installed the update, then I recompiled and started getting the following error:

    1>------ Build started: Project: GTRNoteWorker, Configuration: Release Win32 ------
    1>Compiling...
    1>GTRNoteWorker.cpp
    1>Automatically linking with ToolkitPro1321vc90S.lib
    1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtr1common(252) : error C2766: explicit specialization; 'std::tr1::_Is_integral<int>' has already been defined
    1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtr1common(200) : see previous definition of '_Is_integral<int>'
    1>Build log was saved at "file://c:\Coding\GTRNoteWorker - 2008\x86\Release\BuildLog.htm"
    1>GTRNoteWorker - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    So I think OK, they tightened up something, so I checked to make sure I haven't included the header somewhere else ...then I realized that the error is stating that the thing has been defined already IN THE SAME HEADER file! I think I must be missing a define or something :mad: Any help would be appreciated! Thanks, Paul

    C / C++ / MFC help announcement csharp c++ visual-studio

  • User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked?
    P Paul Belikian

    Hi Roger - Really appreciate your articles, I've learned quite a few things from reading them! ;) The static controls are created dynamically; I specify the following as the style: #define DEFAULT_STATIC_STYLE ES_CENTER|WS_BORDER|BS_NOTIFY I do get the BN_CLICKED notifications, but not the BN_UNPUSHED notifications. Is there another flag that I need to set? I don't believe so, I suspect the CStatic control doesn't send that type of notification. :wtf: Thank you, Paul

    C / C++ / MFC c++ help question

  • User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked?
    P Paul Belikian

    Hello David, Thank you for replying. BN_UNPUSHED was the first thing I tried, yet I wouldn't get the notification. I suspect that notification isn't sent for static controls like it is sent for button controls. :| Regards, Paul

    C / C++ / MFC c++ help question

  • User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked?
    P Paul Belikian

    Yes thank you! I was playing with those in the static derived class - I need to be able to forward those messages in a similar manner and form as the BS_CLICKED message. In other words, the View handles the message in the following fashion: ON_CONTROL(BN_UNCLICKED, ID_BUTTONx, OnButtonUnClicked) afx_msg void OnButtonUnClicked(UINT nID) Now if I can only find the parameters in the SendMessage function to send such a message above...

    C / C++ / MFC c++ help question

  • User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked?
    P Paul Belikian

    Hello all, VC6, MFC, XP My application has a Formview based view with many static controls all over it. The CStatic controls are used in a similar fashion as CButtons are used: The user makes selections by pressing on them. I really do have my reasons for not using the CButton control, but even if I were to use it, I need to find a way to get notified when the 'button' is released. When they are pressed, I do get the BN_CLICKED messages, but I can not find any messages (in WinUser.h) that could be returned when the buttons are released. Is there such a message? Any suggestions or tips to get or simulate this message would be appreciated and be a great help! I'm working with a timer based work around, however the application really needs to track exactly how long the button is down. Best Regards, Paul

    C / C++ / MFC c++ help question

  • How to tell when a view loses focus when the user has the right mouse button down and moves out of the view?
    P Paul Belikian

    Oh, I have to admit I missed that suggestion before but it makes perfect sense. I've moved the code in OnLButtonUp()(keeping the ReleaseCapture() call) to OnCaptureChanged(). As is, it looks like it works in the same exact way as before but has the 'safety' features you stated. Thanks again! Best Regards, Paul

    C / C++ / MFC c++ database help tutorial question

  • How to tell when a view loses focus when the user has the right mouse button down and moves out of the view?
    P Paul Belikian

    Works perfectly! SetCapture() in the OnLButtonDown() handler and ReleaseCapture() in the OnLButtonUp() handler gives me better functionality. Now as long as the user lets go of the left mouse button anywhere, the view gets the mouse input and the OFF command is sent. Thank you for the direction and the links (and lesson)! Best Regards, Paul

    C / C++ / MFC c++ database help tutorial question

  • How to tell when a view loses focus when the user has the right mouse button down and moves out of the view?
    P Paul Belikian

    Hi All, VC++ 6, MFC, WinXP My application's main interface consists of a FormView with a few controls – a tab control and a custom CView based control. In operation, the user *should* (yes, I know …not in the real world) click and then release the left mouse button in this view make a selection. The act of clicking starts a process and the act of releasing ends the process. Specifically, the application sends MIDI notes, similar to a piano keyboard control: MIDI note ON when the left mouse button is pressed, and MIDI note OFF when the button released. I need to send a MIDI note OFF message if the user drags out of the selection window - that would stop the note from playing when the mouse leaves the window. The idea is as long as the left mouse button is pressed, the note will play. All works fine when the user clicks and releases in the same view but if they click, drag away, then release in a different view, the original view does not get notified and the selection remains - in other words, the note stays playing. I’ve looked through the forums and articles and have tried a few of the suggestions but have yet not found any method to get notified immediately when the mouse leaves the active view if the left button is still down. Most of the methods have a "delayed action" before they notify the original view and only seem to trigger if the user clicks on another view - AFTER they released the left mouse initially on that non-original view. I need to find a way to get notified immediately should the mouse leave the active view when its left button is down. Any suggestions and help would be appreciated. Paul

    C / C++ / MFC c++ database help tutorial question

  • Tooooooyyyyyyyy shop
    P Paul Belikian

    What if they offered free shipping? :laugh:

    The Lounge csharp php wpf com data-structures

  • Murphy is a B&*%#@^
    P Paul Belikian

    Nope, I'm not joking, why would I be joking? People also put formaldehyde on the fingertips in these situations.

    The Lounge csharp database question

  • Murphy is a B&*%#@^
    P Paul Belikian

    Crazy Glue on the finger tips

    The Lounge csharp database question

  • Anyway to stop a CView from being closed?
    P Paul Belikian

    Hello Judy, yes, thank you for the suggestion. I actually did go that route using the DocTemplate to find all the views that I needed to check before closing. I chose this method because I also have multiple types of documents in the app - here is the code: forgive the mess, I'm self-taught :-O

    void CMainFrame::OnClose()
    {
    #ifdef _USE_CMC6INVOICE_THREAD_

    POSITION pos, posView;
    	
    pos = theApp.m\_pCmc6InvoiceDocTemplate->GetFirstDocPosition();
    while(pos != NULL)
    {
    	CDocument \*pDoc = theApp.m\_pCmc6InvoiceDocTemplate->GetNextDoc(pos);
    	if(pDoc!= NULL)
    	{
    		posView = pDoc->GetFirstViewPosition();
    		while(posView != NULL)
    		{
    			CView \* pView = pDoc->GetNextView(posView);
    			if(pView->IsKindOf(RUNTIME\_CLASS(CCMC6InvoiceView)))
    			{
    				CCMC6InvoiceView \* pInv = (CCMC6InvoiceView \*) pView;
    				if(pInv->m\_clsInvoice->m\_pThread != NULL)
    				{
    					if(pInv->m\_clsInvoice->m\_pThread->GetActivityStatus() == THREAD\_NOTPREPARED\_TO\_TERMINATE) 
    					{
    						TRACE("Mainframe: OnClose() ->CMC6InvoiceView Thread Busy, Can't close yet...\\n");
    						Sleep(200);
    						PostMessage(WM\_CLOSE); 
    						return;
    					}
    				}
    			}
    		}
    	}
    }
    

    #endif
    #ifdef _USE_BACKGROUND_THREAD_
    DWORD dwExitCode;
    m_pBackThread->Stop(dwExitCode, 0);
    if(m_pBackThread->GetActivityStatus() == THREAD_NOTPREPARED_TO_TERMINATE)
    {
    TRACE("Mainframe: OnClose() ->BackProcess Thread Busy, Can't close yet...\n");
    Sleep(200);
    PostMessage(WM_CLOSE);
    }
    else
    {
    TRACE("Mainframe: OnClose() ->Can close now\n");
    m_pBackThread->Stop(dwExitCode);

    	// Save the current state for tool bars and menus.
    	SaveCommandBars(\_T("CommandBars"));
    	// Save the current state for docking panes.
    	CXTPDockingPaneLayout layoutNormal(&m\_paneManager);
    	m\_paneManager.GetLayout(&layoutNormal);
    	layoutNormal.Save(\_T("NormalLayout"));
    	
    	CMDIFrameWnd::OnClose();
    

    }
    #else
    // Save the current state for tool bars and menus.
    SaveCommandBars(_T("CommandBars"));
    // Save the current state for docking panes.
    CXTPDockingPaneLayout layoutNormal(&m_paneManager);
    m_paneManager.GetLayout(&layoutNormal);
    layoutNormal.Save(_T("NormalLayout"));

    CMDIFrameWnd::OnClose();
    

    #endif
    }

    C / C++ / MFC c++ question

  • Anyway to stop a CView from being closed?
    P Paul Belikian

    Mainframe seems to work fine and stops the thread running in the mainframe. However I need to stop the view from closing before the view's thread is stopped (each view has it's own thread and the mainframe has another thread):

    void CMainFrame::OnClose()
    {
    #ifdef _USE_BACKGROUND_THREAD_
    DWORD dwExitCode;
    m_pBackThread->Stop(dwExitCode, 0);
    if(m_pBackThread->GetActivityStatus() != CThread::THREAD_RUNNING)
    {
    TRACE("Mainframe: Thread Busy, Can't close yet...\n");
    PostMessage(WM_CLOSE);
    }
    else
    {
    TRACE("Mainframe: Can close now\n");
    m_pBackThread->Stop(dwExitCode);

    	// Save the current state for tool bars and menus.
    	SaveCommandBars(\_T("CommandBars"));
    	
    	// Save the current state for docking panes.
    	CXTPDockingPaneLayout layoutNormal(&m\_paneManager);
    	m\_paneManager.GetLayout(&layoutNormal);
    	layoutNormal.Save(\_T("NormalLayout"));
    	
    	CMDIFrameWnd::OnClose();
    

    }
    #else
    // Save the current state for tool bars and menus.
    SaveCommandBars(_T("CommandBars"));

    // Save the current state for docking panes.
    CXTPDockingPaneLayout layoutNormal(&m\_paneManager);
    m\_paneManager.GetLayout(&layoutNormal);
    layoutNormal.Save(\_T("NormalLayout"));
    
    CMDIFrameWnd::OnClose();
    

    #endif

    }

    C / C++ / MFC c++ question

  • Anyway to stop a CView from being closed?
    P Paul Belikian

    Thanks David, that is a good suggestion. I think my issue is that I'm not sure which (or what) message to hook in the view in order to wait for the event. :-O The messages I've tried do not stop the view from being closed; for example, if I put a Sleep(5000) call in the view's WM_DESTROY handler, the window is still closed instantly. I need a place where the view will remain open if I delay the WM_xxxxxx message. I'm doing this in case the user kills the app with the upper 'X' in the application's window ...perhaps I should look into that aspect. This is the only thread related thing I need to clean up. If the user doesn't kill the app while the background process is running (i.e. in the middle of loading a large database), all is well (but when do users wait for anything ? :laugh: ), however if they do kill the app, I need to stop the views from being closed before the thread is dead. The threads can be stopped in an orderly manner at any time. Thanks for your suggestion. Paul

    C / C++ / MFC c++ question

  • Anyway to stop a CView from being closed?
    P Paul Belikian

    VC6, MFC, XP Hi - I need to prevent a CView from being closed before a thread operation is complete. The mainframe also has a secondary thread and I've handled that situation by reacting to the WM_CLOSE message. The view, which has it's own worker thread, doesn't seem to get the WM_CLOSE message (even if I put the code in) and reacting to WM_DESTROY in the view is too late to stop it from being closed. Any suggestions? Thank you, Paul

    C / C++ / MFC c++ question

  • Functional Parameters
    P Paul Belikian

    Thank you too Richard, I appreciate your response!

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups