How do I make the framework force an update_command... macro/function with a command id? instead of wainting for the system to go into idle state. Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
Jawache
Posts
-
Forcing ON_UPDATE_COMMAND_UI -
OpenGL in Release modeHi, I'm trying to make some MultiThreaded OpenGL code work in release mode. Normaly it just comes up as a grey screen in release but works fine in debug. I've eliminated it being an Optimisation error and have managed to recreate the error in Debug mode by adding NDEBUG instead of _DEBUG. Before I start delving into this properly I was wondering if anyone has had the same problem, re: OpenGL. Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Mapping Accelerator to Dialog Boxes.I should just RTFM before I start posting shouldn't I. Figured it out from here: http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q222/8/29.ASP&NoWebContent=1 Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Mapping Accelerator to Dialog Boxes.I can't seem to map my accelerator keys to my dialog. I have mapped the Accelerator 'Alt + 1' to my Dialog class but the functions are not being called? If I map the accelerator keys to my MainFrame (to try to forward them to my Dialog) then the functions are not called when the dialog box is displayed. No matter what I do I cannot seem to use accelerator keys when a dialog box is being displayed. I know I'm doing something stupid becuase I've seen this functionality before. Any ideas? Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
base class calling derived class' functionsYou need to declare thye base class functions as virtual aswell as the derived class Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Maximising CMDIChildWndIt works now if i just use cs.style = WS_CHILD | WS_VISIBLE | WS_MAXIMIZE; in PreCreateWidow. Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Maximising CMDIChildWndCheers, but that doesn't work either. The only other code I have in the class is the OnCreateClient function. Its displaying a splitter window as bellow:
BOOL CSegmentationFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//calculate client size
CRect cr;
GetClientRect( &cr);
// Window Styles
DWORD dwStyle = WS_BORDER | WS_CHILD | WS_VISIBLE;// Main splitter wnd, two rows 1 columns if ( !m\_mainSplitterWnd.CreateStatic( this, 2, 1 ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB\_OK | MB\_ICONERROR ); return FALSE; } // Top splitter win, 2 rows 4 columns (To hold the slice views) if ( !m\_topSplitterWnd.CreateStatic( &m\_mainSplitterWnd, 2, 4, dwStyle ,m\_mainSplitterWnd.IdFromRowCol(0,0) ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB\_OK | MB\_ICONERROR ); return FALSE; } // Bottom Splitter window, 1 row 2 columns ( to hold the form and histogram view ) if ( !m\_botSplitterWnd.CreateStatic( &m\_mainSplitterWnd, 1, 2, dwStyle ,m\_mainSplitterWnd.IdFromRowCol(1,0) ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB\_OK | MB\_ICONERROR ); return FALSE; } // Top Slice Views for (int row = 0; row < 2; row ++) { for (int col = 0; col < 4; col ++) { if ( !m\_topSplitterWnd.CreateView( row, col, RUNTIME\_CLASS(CSliceView), CSize(cr.Width()/4, cr.Height()/3), pContext ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB\_OK | MB\_ICONERROR ); return FALSE; } } } // Bottom Slice Views if ( !m\_botSplitterWnd.CreateView( 0, 0, RUNTIME\_CLASS(CSegmentationForm), CSize(cr.Width()/2, cr.Height()/3), pContext ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB\_OK | MB\_ICONERROR ); return FALSE; } if ( !m\_botSplitterWnd.CreateView( 0, 1, RUNTIME\_CLASS(CHistogramView), CSize(cr.Width()/2, cr.Height()/3), pContext ) ) { MessageBox( "Error setting up splitter frames!", "Init Error!", MB\_OK | MB\_ICONERROR ); return FALSE; } return true; //CMDIChildWnd::OnCreateClient(lpcs, pContext);
Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Maximising CMDIChildWndI'm trying to create an MDI app, I want any child windows to be automatically Maximised at all times. I've overidden the Create function and removed the style WS_SYSMENU and added the style WS_MAXIMIZE. (see bellow) The window wtill doesn't display maximised though? What am I missing? Cheers
BOOL CSegmentationFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CMDIFrameWnd* pParentWnd, CCreateContext* pContext)
{
// Remove the System Menu from the Frame
dwStyle ^= WS_SYSMENU ;// Create a Maximised Window dwStyle |= WS\_MAXIMIZE ; return CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext);
}
Asim Hussain e: asim@jawache.net w: www.jawache.net
-
STL in DLL'sI have a DLL class that I am exporting, // Observer Class class APA_API CStateObserver { ... } class APA_API CStateMachine { public: void PushObserver(CStateObserver * inpObserver); private: std::deque m_dqObservers; } APA_API is the define that resolves to the correct __dellspec(lalalalalal) etc... I get this compiler warning message, warning C4251: 'm_dqObservers' : class 'std::deque >' needs to have dll-interface to be used by clients of class 'CStateMac I have 'Warnings as Errors' set so this warning is a real problem. What are my options? Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Prgramatically Press a CButtonI am doing to embedded programming with a footswitch, I want a CButton to be 'pressed' when the footswitch is pressed and released when the footswitch is released? Does anyone know how I can programatically give the CButton the 'Pressed' look? Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Is DLLMain required?I'm trying to convert some static libraries we have to DLLs. I'm trying to keep the code as portable as possible so I really would not like to use any windows headers. 1) Can I just leave out the Dllmain function and just use delspec(dllimport/export) etc... for the class declarations. 2) Is it possible to just change some project settings to covert a project from a static library to a dll? (I remember in my makefile/*nix days all i had to do was change a flag). Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Simulating ToolBar PressThanks... Just figured that one out for myself.. i was using AfxGetApp()->SendMessage(ID_TOOLBAR_BUTTON, 0, 0); and wondering why it wasn't working?!?!?!? Thanks again... Asim. Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Simulating ToolBar PressHow can I simulate a toolbar press, not just the PressButton function since this does not call the function, but the actuall calling of the function related to the toolbar button. Cheers Asim Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Prgramatic Control of ToolbarI'm using the MFC version of the function CToolBarCtrl::PressButton( int nID, BOOL bPress = TRUE ); It does give the UI of a button in a pressed state. How do I actually call the function associated with a toolbar button (without clicking on it with the mouse button)? Cheers Asim Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Prgramatic Control of ToolbarHi, I would like to control the toolbar (highlights and presses) by using the keyboard. (Left/Right and Enter). I can do all the UI of it, but i would like to simulate a button press ( and have it call thre relevant function ) right now all that I can do it make it look like the button is being pressed. Any Ideas? Cheers Asim. Asim Hussain e: asim@jawache.net w: www.jawache.net
-
autorun appYep linking statically is fine... Or as long as you place the DLLS the app needs in the same directory as the applcation it elf... Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Static member variable pointer.Just a quick question, when I have a static member pointer var.. class Poo { static Poo * _poo } -- implemented Poo * Poo::_poo = new Poo(); Poo::Poo()...... Do I look after the destruction of the pointer or does that happen automatically Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Programable State Machine, XML?Hi, I've been given the task of creating a programmable state machine, ( a class that will take in an input file that will denote the allowable states and actions etc... ) I was thinking of implementing it in XML or something. Has this been done before? Any hints/tips/code? Cheers Asim Asim Hussain e: asim@jawache.net w: www.jawache.net
-
Transparent Bitmap?Hi, I'm trying to add bitmaps to the menu in my vc++6 app. The problem is that my bitmaps have a purple background and this is displayed in the menu. How do i load a bitmap and set a color to transparency? cheers Asim Hussain e: asim@jawache.net w: www.jawache.net
-
DecompressionCan anyone recommend a simple way of decomressing an archive. I've had a look at zlib and ZipArchive and they are a bit too bloated for the functionality i'm looking for. Just a very basic method of decompressing an archive into a folder? Cheers Asim Hussain e: asim@jawache.net w: www.jawache.net