I have 3 functions that do sorting on a CArray.
CArrays are declared in header file:
// Do sorting for m_Integer here
// DO sorting for m_String
// Do sorting for m_Double
Now what i want to do is, have one generic function and then pass the CArray to that.
So far what i did is,
in Header file:
void sortAll(CArray<void*,void*> m_Array);
in CPP file:
void sortAll(CArray<void*,void*> m_Array)
int size = m_Array.GetSize();
m_Array.GetAt(0); // Error here
The error is that, it needs a class type and not a void type.
I am not sure how to proceed with writing a generic function to handle all different data types in one.
Any help is welcome!
I need to work with callback functions between different classes. With VS2010 I have done this already different times without any problem.
With VS2015 I cannot compile such code!
in Header in Class Declaration:
bool ProvideItemData(int nItem, int nSubItem);
//using namespace std::placeholders; // for `_1`
m_ListCtrl.SetOwnerData(std::bind(&CBlockEditView::ProvideItemData, this, std::placeholders::_1));
declaration in called class:
bool SetOwnerData(std::function <bool(int nItem,int nSubItem)> callback);
When compiling in VS2010, I get weird error messages:
c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1501): error C2440: 'return': cannot convert from 'std::_Unforced' to 'bool'
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1501): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(210): note: see reference to function template instantiation '_Rx std::_Invoke_ret<_Rx,_Callable&,_Ty,_Ty>(std::_Forced<_Rx,false>,_Callable &,_Ty &&,_Ty &&)' being compiled
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(208): note: while compiling class template member function 'bool std::_Func_impl<_Decayed,_Alloc,_Ret,int,int>::_Do_call(int &&,int &&)'
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(136): note: see reference to class template instantiation 'std::_Func_impl<_Decayed,_Alloc,_Ret,int,int>' being compiled
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(339): note: see reference to class template instantiation 'std::_Is_large<_Myimpl>' being compiled
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(318): note: see reference to function template instantiation 'void std::_Func_class<_Ret,int,int>::_Reset_alloc<_Ty,std::allocator<int>>(_Fx &&,const _Alloc &)' being compiled
I do not find any solution. So at the moment I do not have any idea, how to solve this issue!
1. I set tab order for control in a MFC dialog.
2. Started the application.
3. Clicked a button in dialog, whose tab order is 3.
4. A modal dialog displayed.
5. Closed the modal dialog.
Now the focus automatically moved to the control having tab order 0.
Since the focus was on the button just before the click, I would like to retain the selection on the same button.
I have a similar application (Win32 rather than MFC), but the focus stays in the correct place on return from the second dialog. I can only suggest you do some debugging to try to see what is happening under the covers.
Solution to what? We have no idea what your code is doing, or what you are doing when you run it, beyond your belief that the focus moves after you run some dialog. The only way to move forward with this is to write a very simple test program to demonstrate the problem and run some tests until you can isolate exactly what is happening.
I want to create an IDE which should have similar look and feel like Visual Studio itself.
For this I created a "Visual Studio Style" Project by usage of AppWizard.
Now I am wondering, how to implement "Windows Float" functionality?
What I mean exactely? e.g. when you look at Visual Studio's Solution Explorer window, there is a small down arrow in the title bar. When you click on it, a menue opens and you can change the window style to "float".
This feature I want to use instead of a non modal dialog, becaue this would be much more flexible.
Has anybody an idea, how to implement. Maybe it is also implement in the IDE Framework of the MFC, but I do not know how to activate??
How to use C to make a Mathematical / Statistical compiler for my final year project. i need help. Need someone that will put me through all the steps to achieve this project of mine. i havent actually seen any recent work on it. Thanks
Last Visit: 29-Jan-20 4:55 Last Update: 29-Jan-20 4:55