|
Maybe you're statically linking to MFC and other libraries...
Concussus surgo.
When struck I rise.
|
|
|
|
|
I am statically linking with MFC for all builds - including the normal debug one. I don't see why my hybrid release/debug version should be double the size of the debug one. I have other statically linked apps that don't exhibit this problem, so there must be something I have missed in the project settings...
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
Check the resulting executables with dumpbin.exe. At least you'll know what exactly causes the release unstripped to be that large.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
hello,
i want to convert texts to bitmaps. the text's font , size
and other font attributes will be given . the program will
convert the text to bitmap. please help me with necessary code and their explanation.
my e-mail address is
smshahed@yahoo.com
and
nejhum@bttb.net.bd
thank you ,
sm shahed nejhum
|
|
|
|
|
|
In windows you can close a dialog with the x-button on the top-right corner or you press alt-F4.
But, if you start a dialog based application, the dialog also closes when you press enter or escape (ok or cancel).
Can I disable this standard behaviour?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
override PreTranslateMessage
then add this code:
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
// Don't let CDialog process the Escape key.
if ((pMsg->message == WM_KEYDOWN) && ((pMsg->wParam == VK_ESCAPE) || (pMsg->wParam == VK_ENTER))
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
tnx, it works.
VK_ESCAPE is defined somewhere, but VK_ENTER isn't. any headerfile to include? or is it VK_RETURN?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Have a look at this [msdn page][^] to answer your question
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
yeah, VK_RETURN
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
And let's say there's another control in the dialog, one that needs the enter-key (ex. TreeCtrl in editlabel mode).
if we override the pretranslatemessage like you showed above, we have to manualy take care of all that. Or am I wrong?
we can't dispatch it to the CDialog::PreTranslateMessage member, cause the enter key will close the dialog.
A member like CDialog::SetAutoClose(TRUE/FALSE) doesn't exits, is it?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
here's how i handle it in http://www.codeproject.com/property/saprefs.asp[^].
BOOL CSAPrefsSubDlg::PreTranslateMessage(MSG* pMsg)
{
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
{
GetParent()->PostMessage(WM_CLOSE);
return TRUE;
}
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN))
{
TCHAR szClass[10];
CWnd* pWndFocus = GetFocus();
if (((pWndFocus = GetFocus()) != NULL) &&
IsChild(pWndFocus) &&
(pWndFocus->GetStyle() & ES_WANTRETURN) &&
GetClassName(pWndFocus->m_hWnd, szClass, 10) &&
(lstrcmpi(szClass, _T("EDIT")) == 0))
{
pWndFocus->SendMessage(WM_CHAR, pMsg->wParam, pMsg->lParam);
return TRUE;
}
return FALSE;
}
return CDialog::PreTranslateMessage(pMsg);
}
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
some more comments. This is what I just read today:
The following keys are active in a dialog:
...
Enter: Press the button if the focus is on a button. Otherwise it presses the default button. One button in a dialog can be given the BS_DEFPUSHBUTTON style. If no button is the default, Enter generates WM_COMMAND with IDOK.
Esc: Generates WM_COMMAND with IDCANCEL.
So in your case, you need to overwrite the virtual function OnOK and OnCancel.
|
|
|
|
|
Allright,
deprecating OnOK and OnCancel works
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I tried to do this:
GetListCtrl().SetItemState( j,LVIS_SELECTED|LVIS_FOCUSED , LVIS_SELECTED|LVIS_FOCUSED );
But there is no any changing in my CListView derivied class.
|
|
|
|
|
hi,
i have these values in demo.txt:-
1
2
3
4
5
6
7
8
9
when i do
//...
ifstream file("demo.txt");
while(!file.eof())
{
int nValue = 0;
file>>value;
values.push_back(nValue);//some vector
}
file.close();
//...
i get the last number 9 read twice;Why?
|
|
|
|
|
here you go.. this should work.. I think...
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
void main()
{
vector<int> values;
ifstream file("demo.txt");
while(!file.eof())
{
int nValue = 0;
file>>nValue;
values.push_back(nValue);
cout << nValue << endl;
}
file.close();
}
well.. I'm assuming it will. Oh.. and sometimes have a new line at teh end of a file will give you an arbitary value.. SO don't put in a new line at eh end.
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
how to get mathematical symbols in a list box? \ooo doesn't seem to work!Should i change the font or something?
|
|
|
|
|
If the symbols belongs to another fontset, you should indeed change the listbox fonts.
|
|
|
|
|
There is a white strip with a formatted date in a date/time picker. How can I change the background color of that white strip? I tried just about everything I know.
Any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Look into SetTextBkColor. I do not know what control you are using or if you built one. But the SetTextBkColor function should be able to help you. It sets the background colour for the text within a control which is different from the background colour of the control it self. Setting the colour to be equal to that of your control will make your text look better. Hope this helps.
|
|
|
|
|
I need to get the exact time in ms. Anyone know how?
Cheers,
Ali
|
|
|
|
|
If you don't mind using 100-ns intervals since 12:00 AM, January 1st, 1601, then GetSystemTimeAsFileTime is the way to go.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I'm trying to create a custom control which contains a few input fields.
I've read Chris Maunders tutorial courses about 'the art of subclassing' and 'create your own custom control' which are btw great, but still I can't seem to find out where to begin.
Basically I want to create a small control with 2 input fields, some text and a button or 2. Let's say a login control containing username, password and a connect button.
There are a lot of good articles about subclassing for instance a CEdit field, but I can't find one that handles my question.
Does anybody know if it is possible to create this control starting from a dialog? Or should I just sublass a CWnd and add the Edit/static fiels and button myself. How to do this?
I really can't figure out how to start, so it should be great if anyone can point me out how to start.
Thanks in advance
Wim
|
|
|
|
|
You'll need a child dialog. Derive your class from CDialog, create a dialog template with 'child' style set, add controls on the dialog surface and add event handlers. At runtime, you'll need easy method for placing child dialog on the parent. I'm usually using 'dummy' static control which provides the initial position and size and it's replaced with child dialog.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|