|
I stated "For Win32, I believe the default packing of 8 is used."
I believe that's wrong Actually it varies all over the place. 4 is used in general it seems
but there are many cases of 2 and 1.
Here's a link to an article by an old MS programmer: Alignment (part 2): Packing[^]
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi,
I'd like to make my CFrameWnd subclass not resize any smaller than a certain size. Everywhere I web-search, I see that the suggested way to do this is:
void CWndDerived::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
// set the minimum tracking width
// and the minimum tracking height of the window
lpMMI->ptMinTrackSize.x = 200;
lpMMI->ptMinTrackSize.y = 150;
}
I type this into my (very simple) app, and set a breakpoint at the start of this function. It is never called.
Is this method still valid? (under Visual Studio 2005 c++)
Thanks,
Max
|
|
|
|
|
maxmaven wrote: CWndDerived
Are you sure this class window is window you are trying to resize ?
A quick test in simple SDI app, shows result as expected.
|
|
|
|
|
Can you tell me exactly what you did? And are you in Visual Studio 2005, C++?
I did:
SDI: doesn't work
SDI + DocView architecture: doesn't work
SDI + Split Window: doesn't work
Are you setting anything special? Or adding more than just the
OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) function?
Thank you,
Max
|
|
|
|
|
Have you seen David's[^] reply ?
Are you sure macro ON_WM_GETMINMAXINFO is there as messsage map entry ?
|
|
|
|
|
I do not have a message map entry. How do I add one for ON_WM_GETMINMAXINFO?
Max
|
|
|
|
|
maxmaven wrote: How do I add one for ON_WM_GETMINMAXINFO?
As has already been mentioned, use ClassWizard.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
maxmaven wrote: I type this...
Did you use ClassWizard to add it? Is BEGIN_MESSAGE_MAP() correct?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
All I did was cut and paste the code into MainFrm.cpp, and add the function to the class declaration in MainFrm.h.
Max
|
|
|
|
|
Then you are missing the entry in BEGIN_MESSAGE_MAP() . It's fine to add the actual code (i.e., that which is in between the curly braces) to your functions/methods, but use ClassWizard to add the prototypes.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How do I add the message map entry using a wizard? Do I use the "Add Member Function" wizard?
Thanks,
Max
|
|
|
|
|
Ctrl+W, unless you are using VS200x. Otherwise, see here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
assert(0); /// for this statement I am getting the following error
error C2065: '__MODULE__' : undeclared identifier
Thanks in advance
Ashok
|
|
|
|
|
Looks like you're missing a #include.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I included the required header file...
Thanks in advance,
Ashok.
|
|
|
|
|
Christian Graus wrote: Looks like you're missing a #include.
Seems that would have resulted in:
error C2065: 'assert' : undeclared identifier
instead. With VS6, __MODULE__ is not even part of the assert() macro so I'm not sure what to even suggest.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Where did you get the __MODULE__ predefined macro from?
If you right click on "assert" and choose "Go to Declaration" then what file do you end up in?
It should be assert.h ( which you should be including with #include <assert.h> ).
In the RTL code with VS2003, it only uses these macros: __FILE__ and __LINE__
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
ya exactly,
assert(0);
and printf("\nHere %s %d \n",__FILE__,__LINE__); // for both statements I am getting the same error.
I included assert.h and tried but am unable to find the __MODULE__ predefined macro..
thanks in advance,
Ashok
|
|
|
|
|
Hmm I can't reproduce this at all. It works for me in console and GUI app builds no problems.
In Google search __MODULE__ shows up related to linux and python.
It's nowhere in the CRT or Platform SDK headers though.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I am using coledatasource::dodragdrop function for drag and drop. when i drag and drop between applications, i get an assertion in the source side in the following code
CCmdTarget::~CCmdTarget()
{
#ifndef _AFX_NO_OLE_SUPPORT
if (m_xDispatch.m_vtbl != 0)
((COleDispatchImpl*)&m_xDispatch)->Disconnect();
ASSERT(m_dwRef <= 1);#endif
#ifdef _AFXDLL
m_pModuleState = NULL;
#endif
}
can anyone help me solve this problem?
Thanks
|
|
|
|
|
Hi! All
I want to copy Some data which is stroed in TChar Buff in to a CString Variable.
How i do this. The TChar Buff has Raw data in which there are number of zeros present between raw data
Ansh
|
|
|
|
|
aaaan wrote: TChar Buff in to a CString Variable.
C'tor of CString or assignement operator will take care of that.
e.g
CString csString(pCharArr);
or
Cstring csString = pCharArr;
aaaan wrote: The TChar Buff has Raw data in which there are number of zeros present between raw data
Can you explain this?
|
|
|
|
|
prasad_som wrote: Can you explaing this?
Meaning that you can't do something like:
CString str = "Now\0is\0the\0time\0for\0all...";
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
ya i m unable to store data like CString str = "Now\0\0\0\0\0is\0\0\0\0the\0time\0for\0all..."
|
|
|
|
|
Of course. Why would you think it was even possible?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|