|
std::map <iCString,unsigned int> mCounters;
//This function populate the "mCounters" map
GetCounters(mCounters);
map< iCString,unsigned int>::iterator it;
for (map<iCString,unsigned int>::iterator it = mCounters.begin();
it = mCounters.end(); ++it)
{
}
I am getting the error mentioned in the subject... what is the mistake I am doing ?
Fulll Error message
------------------
error C2451: conditional expression of type 'std::_Tree_iterator<_Mytree>' is illegal
1> with
1> [
1> _Mytree=std::_Tree_val<std::_tmap_traits<icstring,unsigned int,std::less<icstring="">,std::allocator<std::pair<const icstring,unsigned="" int="">>,false>>
1> ]
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
|
|
|
|
|
You missed a symbol from the middle of your for loop expression.
it = mCounters.end()
should be
it != mCounters.end()
|
|
|
|
|
|
(This does reference previous projects but I suggest deserves a new thread as it is a particular issue with TB_HIDEBUTTON and no other API).
I have discovered some apparently random behaviour of TB_HIDEBUTTON on Windows 7 64-bit. I have not tested on any other OS but suppose the problem will be duplicated to some degree or other.
First, I have a project (of my own) which successfully enumerates the toolbar buttons in the Notify Area.
One starting project to illustrate the idea, is this:
http://www.codeproject.com/Articles/10807/Shell-Tray-Info-Arrange-your-system-tray-icons
(This is an old project - for my Win7 it needs modifying to make the TBBUTTON structure fixed to 6 reserved bytes, also a mod to find the hwnd Win 7 "User Promoted Notification Area", so it's not a perfect sample but good enough to illustrate the type of code loop i'm using.)
I've used TB_BUTTONCOUNT to obtain a count of buttons on the Notification Toolbar, have entered a loop iterating over those items as i, and have created memory in the target process to retrieve the TBBUTTON structure and its TRAYDATA structure. I have then used GetWindowThreadProcessId to get tray.hwnd and from there have been able to extract all the required information in my loop regarding the target button. This all works.
The problem is, that being in my loop of i, I can successfully delete buttons with TB_DELETEBUTTON (and also, in the sample above with mods, can successfully use TB_MOVEBUTTON as well.) I'm therefore certain that my loop of i is pointing at the correct button. My pointer enumerator (actually an index i for SendMessage) appears to be, therefore, correct, as in, it is pointing at the correct button on the list in each iteration. That's logical.
However, TB_HIDEBUTTON produces bizarre and unexpected results - it hides the wrong button every time.
The only thing I can suppose in this circumstances is that the TB_HIDEBUTTON API has a wierd bug.
Can anyone confirm what is the problem hiding buttons with this API?
LRESULT hideResult = SendMessage(hTrayWnd, TB_DELETEBUTTON, i, 0 );
LRESULT hideResult = SendMessage(hTrayWnd, TB_HIDEBUTTON, i, 1 );
|
|
|
|
|
According to the documentation[^], the WPARAM value should be the command id of the button, not an index.
|
|
|
|
|
Correct. The API def for DELETEBUTTON specifies an Index whereas Command Identifier is presumably the idCommand field of TBBUTTON.
The API docs are different for each function.
Having tested this using the idCommand field of TBUTTON, rather than the Index, it works.
Problem solved. Many thanks.
|
|
|
|
|
please how to fix this problem ?
I installed Micrsoft viuasl studio profissional 2013
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win64.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
No supported SDK or compiler was found on this computer.
For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win64.html
Error using mex (line 206)
Unable to complete successfully.
|
|
|
|
|
I thought you could include this in VS by just adding a DLL file?
But Google[^] should explain how to do it.
|
|
|
|
|
Hi All,
I am using VS 2010 (SP1). When I am trying to use Edit and continue for debugging X64 bit application, I am getting the following error,
"the source file has changed it no longer matches the version of the file used to build the application being debugged"
Is there anyway to get rid of this?
OS: Win2008server (64 bit)
Thanks,
SMA
|
|
|
|
|
|
Hi Richard,
Thanks for your reply..Its mainly intended for VS2013. I am not able to do for VS2010
Thanks,
SMA
|
|
|
|
|
Well now you know where to look you can get any specific details for VS2010.
|
|
|
|
|
Hi Richard,
Thanks again for your reply. Actually I came to know from link that "Edit and continue" feature is not available for X64 bit application in VS2010..In order to be make sure I wanted to hear it from expert team who had already having hands on experience on this.
Thanks,
SMA
|
|
|
|
|
Well thanks for your comment, but I have never used Edit & Continue in 20 years of Windows programming.
|
|
|
|
|
I'm going to have to second Richard on this... I've never used Edit & Continue... I wouldn't depend on a feature that's not really widely used as that (none of the other developers in my company use it either).
|
|
|
|
|
I have never used it either.
Rather curious as to what development methodology would be in use such that this would be a feature that one could ever rely on in a non-trivial way.
|
|
|
|
|
Yeah, I'd be curious too. It's not a very helpful feature, sounds more like a feature added for the sake of adding bullet point highlights for a new release of VS.
|
|
|
|
|
I very rarely use it to fix minor typo-like errors, such as replacing < with <= , or changing literal values in assignments or function calls to something else. The reason is that I'm often confronted with deep levels of function calls with multiple nested loops, and getting back to the same point of debugging can be very time consuming.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
True, but nothing that you couldn't do with a bookmark and/or a conditional break point.
|
|
|
|
|
Hi,
No it is not implemented for 64 bit. Furthermore x64 edit and continue for unmanaged is not implemented on VS versions all the way up to VS2013++.
Best Wishes,
-David Delaune
|
|
|
|
|
I have a class (taken from somewhere). Here, I have a member like this:
public:
void SetBitmapDataSize(const int x, const int y);
private:
int m_PixelNumberX;
int m_PixelNumberY;
vector<vector<COLORREF> > BitmapData;
and SetBitmapDataSize is implemented:
void CBitmapOp::SetBitmapDataSize(const int x, const int y)
{
m_PixelNumberX = x;
m_PixelNumberY = y;
if((x>=0) && (y>=0))
{
BitmapData.resize(m_PixelNumberX);
for(int x = 0; x < m_PixelNumberX; x++)
BitmapData[x].resize(m_PixelNumberY);
}
}
Now, I want to replace vector<vector<colorref> > with this CArray:
I had tried:
private:
int m_PixelNumberX;
int m_PixelNumberY;
CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> > m_arrBitmapData;
my question is, how can replace vector.resize method, and how can I return CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> > data type ?
Thank you.
modified 4-Sep-14 8:17am.
|
|
|
|
|
Flaviu2 wrote: my question is, how can replace vector.resize method... Have you tried this.
Flaviu2 wrote: ...and how can I return CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> > data type ? From where?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Ok, resize issue has been solved.
Secondly, as long m_arrBitmapData is private memeber, I want to return this memeber through a public method, I mean from this class ...
Something like that:
public:
CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> > GetBitmapArray(){return m_arrBitmapData;}
because this trial give me:
error C2558: class 'CArray<class CArray<unsigned long,unsigned long &>,class CArray<unsigned long,unsigned long &> >' : no copy constructor available
|
|
|
|
|
Just return a constant reference as in
const CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> > & GetBitmapArray()
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
I think is working ... I have one more question: there is a way to pass a paramanter as CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> >, just like:
void SetPlotData(CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> > InputArray);
and
void CGraphCtrl::SetPlotData(CArray< CArray<COLORREF, COLORREF&>, CArray<COLORREF, COLORREF&> > InputArray)
{
if ((m_PixelNumberX>0) && (m_PixelNumberY > 0))
{
PlotData = InputArray;
}
}
because code above doesn't work:
error C2582: 'CArray<class CArray<unsigned long,unsigned long &>,class CArray<unsigned long,unsigned long &> >' : 'operator =' function is unavailable
As soon as I solve this error, my program will run ...
modified 5-Sep-14 4:55am.
|
|
|
|
|