How do i make a pointer to point to a function. and i hope to have this pointer to be able to point to several type of functions? like CString getDate(); CString getMonth(int i); how can make a pointer to point either to these two functions?? thanxs in advance
aldeba
Posts
-
Function pointer wooes -
Platform SDK downloadsDo i need to upgrade my win98 to use the platform SDK may 2002? The compiler complained that RC.exe the resource compiler requires a newer version of windows. Anyone???
-
Platform SDK downloadsWhere can i download the windows platform sdk just for the use of Internet Protocol Helper or do i need to download the full CORE SDK from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ problem is that the SDK is kinda of big and i just need specifically the Internet Protocol Helper API. anyone? thanxs in advance
-
CString BasicsOut of topic. Interesting to see someone from C# coming to C++. Job requirements make you do this, or our of shear interest?
-
Directly creating a CFormView as a child?It should not be a problem to create a CFormView can be seen from this example http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0998/c++0998.htm&nav=/msj/0998/newnav.htm
-
How to change the size of a splitview?dumb me. Can be done with SetColumnInfo and SetRowInfo. Leave this thread here, just in case someone needs it :)
-
Directly creating a CFormView as a child?Why not just use a dialog box instead?
-
How to change the size of a splitview?How do i change the size of the split view? I tried this. m_splitWnd.GetPane(0,0)->SetWindowPos(NULL,0,0,10,10,SWP_NOMOVE); m_splitWnd.RecalcLayout(); does'nt seems to work. Anyone?
-
Changing the color of scroll barsyou can try reading this http://msdn.microsoft.com/msdnmag/issues/01/11/c/c0111.asp
-
splash screenstake a look here http://www.codeproject.com/dialog/index.asp#General or more specifically http://www.codeproject.com/dialog/splasher.asp hope this helps. Or u can just use a thread to close a modaless dialog box after a certain amount of time.
-
Getting bytes transferred for network adapter.What api should i be using to determine how much data was transferred or currently transferring for a network adapter?
-
MFC Combobox help please...Let's say the button is called IDC_BUTTON1 So i guess by now u should know how to do a event for IDC_BUTTON1? Hook on the msg BN_CLICKED. So let's say you have assigned the combobox to a variable called m_comboBox. This can be done thru class wizard. You would get void ClassName::OnButton1 { m_comboBox.AddString("....");// Your random data } Hope this helps.
-
ETSLayoutFormView, scrollbars missing.Anyone worked with ETSLayoutFormView? the scrollbars does not seems to appear. I guess SetScrollSizes(MM_TEXT, CSize(cx,cy)); in OnSize(UINT nType, int cx, int cy) is causing the scrollbar to be made for the size of the window and not the size of the form itself. Anyone?Thanxs in advance.
-
addin/program that display dialog resource with resource_idAh found it :) http://www.codeguru.com/misc/NITpick.html Just need to enable the annotate item with ID. Any other programs?
-
addin/program that display dialog resource with resource_idAny program that does this? This is required when i want to know the resource symbol/ID of the control on the dialog quickly. I hate clicking on properties and finding out what the symbol is. This is used for ETSLayout, when i'm adding the controls to the panes. Thanxs in advance!
-
Any way to intercept WM_SIZING with SDI/MDI applicationI need to restrict the resizing of the SDI application. I tried the method found in http://www.codeproject.com/useritems/mdibackgroundimage.asp to hook on to WM_SIZING and it worked. But i was wondering whether there was any other way, any msg i could overload? tried all the PreTranslateMessage and ProcessMessageFilter message map, but it did'nt work. This is a slightly modified one from winamp plugin. very slightly. i just wanted
WNDPROC pfnOldWndProc;
// new one
LRESULT CALLBACK pfnNewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam,LPARAM lParam)
{
CRect rect;switch (uMsg) { case WM\_SIZING : if ((wParam==WMSZ\_BOTTOMLEFT) || (wParam==WMSZ\_BOTTOMRIGHT)) wParam=WMSZ\_BOTTOM; else if ((wParam==WMSZ\_TOPLEFT) || (wParam==WMSZ\_TOPRIGHT)) wParam=WMSZ\_TOP; GetWindowRect(hwnd,rect); ((RECT\*)lParam)->left= rect.left; ((RECT\*)lParam)->right = rect.right; break; } return CallWindowProc(pfnOldWndProc, hwnd, uMsg, wParam, lParam);
}
and in InitInstance()
HWND hMain = GetActiveWindow(); pfnOldWndProc = (WNDPROC)GetWindowLong(hMain, GWL\_WNDPROC); SetWindowLong(hMain, GWL\_WNDPROC, (long)pfnNewWndProc);
-
Why does the statement completion does not always work?Thanxs. it's really a good addon for visual c++. Thanxs again! P.S. I think i'm getting spoilt by Visual Assist :)
-
Why does the statement completion does not always work?As above, is there any thing i need to follow in order for it to work? Sometime it works sometime it does'nt. Thanxs
-
Intializing combo box/control in CFormViewThanxs that did work. But still the controls in the FormView still have invalid handle to the window, it seems that the controls were not properly intialized to the correct window when it was replaced. i used the code from UsefulSplitterWnd,ReplaceView() CCreateContext context; BOOL bSetActive; if ((GetPane(row,col)->IsKindOf(pViewClass))==TRUE) return FALSE; // Get pointer to CDocument object so that it can be used in the creation // process of the new view CDocument * pDoc= ((CView *)GetPane(row,col))->GetDocument(); CView * pActiveView=GetParentFrame()->GetActiveView(); if (pActiveView==NULL || pActiveView==GetPane(row,col)) bSetActive=TRUE; else bSetActive=FALSE; // set flag so that document will not be deleted when view is destroyed pDoc->m_bAutoDelete=FALSE; // Delete existing view ((CView *) GetPane(row,col))->DestroyWindow(); // set flag back to default pDoc->m_bAutoDelete=TRUE; // Create new view context.m_pNewViewClass=pViewClass; context.m_pCurrentDoc=pDoc; context.m_pNewDocTemplate=NULL; context.m_pLastView=NULL; context.m_pCurrentFrame=NULL; CreateView(row,col,pViewClass,size, &context); CView * pNewView= (CView *)GetPane(row,col); if (bSetActive==TRUE) GetParentFrame()->SetActiveView(pNewView); RecalcLayout(); GetPane(row,col)->SendMessage(WM_PAINT); return TRUE; Anyone?
-
Intializing combo box/control in CFormViewNope, no response for breakpoint in OnUpdate().. :(