|
Hello,
In my CChildFrame in PreCreateWindow I am removing the WS_MINIMIZEBOX and the WS_MAXIMIZEBOX (this is what I want) then in Activate Frame I force the view to Full size.. I only want the "X" close button to be displayed but when I force the view in to maximize it displays the restore down button... anyone know how to remove this button (I dont want to just disable it)?
Thanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi,
I have a map<string,int>.I want to sort it on values(int).How do I do this?
Karteek
|
|
|
|
|
If the key is the int then it probably is already sorted but it may depend on your implementation of map because I am not sure that the standard requires it to be sorted. STLPORT and VC6STL both instert into a sorted map.
John
|
|
|
|
|
Hi,
I want to sort on values not keys
Karteek
|
|
|
|
|
Sorry. I was a little confused when I read the question..
John
|
|
|
|
|
Read here.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
You need to copy the values into another container and sort it there. You cannot reorder the values, since it may break the order of the keys.
--
Intellectualize my blackness[^]
|
|
|
|
|
Hi,
I´m catching Outlook Events by using the connectin points of the DispInterface.
It all works great, but when there is only on item, for example the last contact, in the folder contact, the event handler doesen´t fire.
What´s the problem and is there any solution known ?
My second question: The event handler does only catch Events for the TopLevel Folders such as Inbox ...
When the user created a subfolder under the inbox the event handler
does not fire.
Can someone pleas help me ?
Thanks a lot, Chris
|
|
|
|
|
i dont know about the last contact thing
but the subfolders ... dont u have set up the event handler for each container? sub-containers are simply containers at different levels afaik
"there is no spoon" biz stuff about me
|
|
|
|
|
No I only set up the event for main container such as Contact.
How can I do this ?
|
|
|
|
|
Hi!
I'm quite new to MFC, but I understand the concept.
In trying to modify code to include (in a dialog) a new button that changes the caption of a label and the button itself I get an assertion error in winocc.cpp line 247. This occurs when clicking on the button while running the debug.
I created the button in the ressource file and added the code to modify the label and button:
if(isFlat == true )
{
m_lblRatePerHourControl.SetWindowText(_T("Rate per hour"));
m_cmdTypeControl.SetWindowText(_T("Flat"));
isFlat = false;
}
else
{
m_lblRatePerHourControl.SetWindowText(_T("Rate"));
m_cmdTypeControl.SetWindowText(_T("Linear"));
isFlat = true;
}
I noticed the AFX_DATA code of other button/control so I figured that I might need something there, I tried adding manually:
CStatic m_lblRatePerHourControl;
CStatic m_cmdTypeControl;
Still doesn't work. I read somewhere that it could be the compiler that acts as if my addition was a mistake and removes something or it could be that the original dialog was created in a wizard...
Any ideas anyone?
Also, can anyone recommend a good MFC book?
|
|
|
|
|
frexxx wrote:
I get an assertion error in winocc.cpp line 247.
If this is VS6, line 247 of WINOCC.CPP is not an assertion. Line 229 perhaps?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Sorry, I forgot to mention this is in MS Visual Studio .Net 2003.
|
|
|
|
|
In that case, look at line 247 of WINOCC.CPP and see what condition caused the assertion to fire. It's likely an invalid window handle.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi!
I have a MFC MDI application where many CMDIChildWnd has splitterWnd.
How do I detect that one of my CMDIChildWnd age going to lose focus to another
CMDIChildWnd either through a menuselection or a mouseclick between windows?
MSc Bertil Morefält
|
|
|
|
|
The Message for loosing input-focus is WM_KILLFOCUS.
The stupid thing is that the User can click a Toolbar-button without your View loosing focus. That is a Bug, not a feature, and I have not found a way to circumvent it.
The easiest thing is to have all Tollbarbutton handler who are supposed to take the focus away from a certain view do this by hand. Then (and only then - within the toolbar button handler) your views are getting their WM_KILLFOCUS.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Hi all,
I've created new add in using the dev studio add in wizard.
i have only 1 command method there that does this:
STDMETHODIMP CCommands::My567CommandMethod()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CWinApp* pApp = AfxGetApp();
ATLASSERT(NULL != pApp);
if (NULL == pApp)
{
return E_FAIL;
}
CString szWorkspace;
POSITION posdt = pApp->GetFirstDocTemplatePosition();
while (NULL != posdt)
{
CDocTemplate* pdt = pApp->GetNextDocTemplate(posdt);
if (0 == strcmp("CProjectWorkspaceDocTemplate",
pdt->GetRuntimeClass()->m_lpszClassName))
{
POSITION posdoc = pdt->GetFirstDocPosition();
if (NULL == posdoc) break;
CDocument* pdoc = pdt->GetNextDoc(posdoc);
if (NULL == pdoc) break;
szWorkspace = pdoc->GetPathName();
if (0 == szWorkspace.GetLength()) break;
}
}
if(szWorkspace.IsEmpty())
{
return E_FAIL;
}
return S_OK;
}
the code above, just want to find the *.dsw file name.
i took it from the project "restore class view" appeared here in code project.....
in debug mode the value of POSITION posdt is null, therefor it doesn't find the file. when i tried to debug the project "restore class view"
it did had a value and did returned the proper dsw file.....
can any1 help me here???
thanks
p.s - here is a link to the "restore class view" project
http://www.codeproject.com/macro/restoreclassviewaddin.asp
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
hi everybody,
I am newbie in matlab C++. I am facing some problems during my work. I followed the Matlab manual in the mathworks website and wrote the code like this: --->>
mwArray A = 5;
int i, j = A;
for (i=0; i < j; i++)
cout << "Counting: " << i << endl;
after compiling, the visual C++ studio shows
d:\others\im\me.cpp(29) : error C2440: 'initializing' : cannot convert from 'class mwArray' to 'int'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
there is another problem:
i wrote in MATLAB C++
mArray x;
mArray X1;
X1 = x(1,colon());
max1=max(X1);
mwArray X2;
X2 =x(2,colon());
max2=max(X2);
max3=max(max1,max2);
after compiling,
D:\others\im\me.cpp(99) : warning C4003: not enough actual parameters for macro 'max'
D:\others\im\me.cpp(99) : error C2059: syntax error : ')'
D:\others\im\me.cpp(103) : warning C4003: not enough actual parameters for macro 'max'
D:\others\im\me.cpp(103) : error C2059: syntax error : ')'
D:\others\im\me.cpp(105) : error C2440: '?' : cannot convert from 'class mwArray' to 'bool'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\others\im\me.cpp(105) : fatal error C1903: unable to recover from previous error(s); stopping compilation
I would like to know how I can solve the above-mentioned problems. Thank you for your guidance.
I am using MATLAB 6.1 , MS Visual C++ 6.0 , Window 2000
vincent sim
|
|
|
|
|
I think this one of those cryptic error codes.
cannot convert from 'class mwArray' <br />
to 'int'
Means that it could not find a declaration for the conversion of mwArray so it chokes on the first operation that you do on it. Either you have an outdated version of the libraries, the include file is incorrect or missing, or there is no way to converst an mwArray into an integer.
The second problem looks like the macro max , which is a preprocessor directive and will go first will replace the occurances of max before it gets to it. Therefore you will have to put
#undef max
before it.
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
how to load an image using kodak imgedit activex control ...
i ma getting error while loading it ... any help????
|
|
|
|
|
|
actually i tried to load using the set image function but its showing some assertion failure ..can u please ehlp me out on how to go about it
|
|
|
|
|
I'm working on an MDI application using MFC in VC6.0. The application should run in Win98 or higher.
I need my application to notice and respond if the user changes their desktop display settings, changing the resolution or bit depth. I tried WM_DEVMODECHANGE but that seems to something different. I looked for WM_DISPLAYCHANGE but I couldn't find a way to add that using the wizards.
How do I get my MDI to receive notification of display changes?
|
|
|
|
|
Sometimes the user might move the dialog box around screen till it is partly outside the desktop. And you might want to bring the dialog box back into full view. There might also be a a situation where you did the development on a higher resolution and on your machine it comes up nice and full, but the final user might be using a lower screen resolution and thus part of the dialog will be out of the screen. Again you'd really want to make sure the dialog box is fully visible. Well, believe it or not, this can be accomplished with just one line of code.
SendMessage(DM_REPOSITION);
Smooth eh? Remember that this message only works for top level dialog boxes and will not work for child dialogs.
u can also check for GetSystemmetrix
|
|
|
|
|