|
Thanks, that clears it up!
|
|
|
|
|
I noticed in the microsoft windows library they had two versions of what i assumed with similar files.
filename.h/filename.cpp and filenameEx.h/filenameEx.cpp
Anyone know how this "Ex" suffix is used? and what the relationship if any between the non-Ex and the "Ex" version?
Kind regards,
David
|
|
|
|
|
it really depends on the company/implementation - I doubt there's any 'standard' meaning, eg 'Example', 'Extension' - the only way to know for sure is a side-by-side comparison using [insert name of your favourite diff/compare tool here]
|
|
|
|
|
david21742 wrote: Anyone know how this "Ex" suffix is used? and what the relationship if any between the non-Ex and the "Ex" version? I always interpreted it as an "extended" version.
"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
|
|
|
|
|
Basically it stands for an extended version.
Microsoft follows 2 conventions for extensions or newer versions of files / APIs / classes.
MFC has a CDialog class which is now extended to CDialogEx .
CDialogEx exists in a file called AfxDialogEx.h
There are several extended versions of APIs that follow this convention -
CreateWindow - CreateWindowEx
RegOpenKey - RegOpenKeyEx
The other convention that is followed is to add the numbers 2, 3, 4 ... to the end of the name.
Files that follow this convention are -
AfxPriv.h , AfxPriv2.h
AfxCmn.inl , AfxCmn2.inl , AfxCmn3.inl
This convention is followed by the COM interfaces -
IClassFactory , IClassFactory2
IPersistFolder , IPersistFolder2 , IPersistFolder3
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
thank you very much. i had to name something where it was in appropriate to overload, and I couldn't think of an appropriate name. i saw something in microsoft's thread or mutex library that used that naming convention. I should have realized Ex meant "extended", duh. Kind regards,
|
|
|
|
|
I have an ATL dialog based applications.
I have a custom list control derived from CListCtrl with message map
BEGIN_MESSAGE_MAP( MyListCtrl, CListCtrl )
ON_NOTIFY_REFLECT( NM_CUSTOMDRAW, &MyListCtrl::OnNMCustomDraw )
END_MESSAGE_MAP()
void MyListCtrl, ::OnNMCustomDraw( NMHDR *pNMHDR, LRESULT *pResult )
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<nmlvcustomdraw*>( pNMHDR);
// Take the default processing
*pResult = CDRF_DODEFAULT;
if( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
{
*pResult = CDRF_NOTIFYITEMDRAW;
}
else if( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
{
int nRow = static_cast<int>(pLVCD->nmcd.dwItemSpec );
if( true == MyArray[nRow].bIsOlder )
{
pLVCD->clrText = RGB( 128, 128, 128 );
}
pResult = CDRF_DODEFAULT;
}
}
But I am not getting ant reflected message from the parent dialog.
I know that it can be done by using the REFLECT_NOTIFICATIONS() in the parent class. But I read that we have to derive the CListCtrl from CContained window. Is it the right way, if so what are things I have to take care.
Is there any better solution to resolve this issue?
aks
|
|
|
|
|
|
Hello everyone, there is an article in Chinese discussing MS Detours API hooking library and Mhook library. I don't understand how to download the attachment and I can't understand the article. Could anyone who understands Chinese help me out here? Much appreciated in advance!! Please
|
|
|
|
|
well, you might want to include the link to the article so people can find it
|
|
|
|
|
|
|
You're right. It's already been posted there now. Thanks
|
|
|
|
|
Based on the "Visual C++ 2008 Feature Pack" sample VisualStudioDemo
I have a toolbar (CMFCToolbar) in a docking pane (CDockPane) that contains operations to be done on the content of the docking pane.
Currently, all the toolbar buttons are "aligned" from the left side; as it is expected when working with a toolbar.
Is there a way to move the right-most button in the toolbar to be at the right-most side or the rect (of the toobar) ?
for example ( in ascii art) to have something like this (toolbar is between [] )
==================================================
| [button1|button2|button3| button4] |
|------------------------------------------------|
| |
The toolbar rect spans the whole width of the docking pane (also resizes when the docking pane resizes)
Looking at the CMFCToolbar documentation and code (afxtoolbar.cpp/.h) does not seem to offer some API to do that.
So, Am I chasing a wild goose?
Thanks.
Max.
I'd rather be phishing!
|
|
|
|
|
Yes, of course...
void CYourToolBar::AdjustLocations()
{
__super::AdjustLocations();
if (GetSafeHwnd())
{
int iCount(GetCount());
if (iCount)
{
CRect crClient(0, 0, 0, 0);
GetClientRect(crClient);
CMFCToolBarButton* pcButton(GetButton(iCount - 1));
if (pcButton)
{
CRect crPos(pcButton->Rect());
if (crClient.right > crPos.right)
{
crPos.OffsetRect(crClient.right - crPos.right, 0);
pcButton->SetRect(crPos);
UpdateTooltips();
}
}
}
}
}
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
modified 12-Dec-14 7:37am.
|
|
|
|
|
Excellent !!!
plug the code right in and works nearly ok; I have some minoe redraw issue that should be easy to track down.
Thanks.
I'd rather be phishing!
|
|
|
|
|
Hi All,
I'm facing the following strange problem using MFC Grid Control (by Chris Maunder) in my VS2010 MFC application:
I've included the CGridCtrl control in a dialog in order to let the user to edit data. It works fine but sometime when I open the dialog the cells content is not displayed but it's covered by the cell background color.
Unfortunately I can't solve the problem because it only happens randomly. I tried to call Invalidate() to both the CGridCtrl control and the dialog but it doesn't solve.
Any help would be greatly appreciated.
Thanks in advance.
Gianni
|
|
|
|
|
Normally we would tell you to post this question in the forum at the bottom of the article: MFC Grid control 2.27[^], but I think it is ok for you to post it here as well.
Although Chris is around all the time, he is obviously very busy so there is no guarantee he is able to answer your question.
It is a very old project by now (it is article #8 here on CodeProject!), but I see that Chris did update it not too long ago. In your explanation of the problem, you need to include which version of Windows you are running it on an make sure to mention whether it is 32 or 64 bits.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Hi,
I have a C++ program with MFC.
I utilize the OnPrint() mechanism to print a Cstring line by line with pDC->TextOut().
That is working the first time I print.
If I repeat the print job, the page is blank.
I don't understand why.
Here is a portion of OnPrint():
CString resToken;
I print the Cstring one line at a time.
pDC->(TextOut(pt.x, pt.y + j * m_nHautLigne, resToken);
Does it have a better way to do the printing?
Why the page is blank the second time?
Do I have to reset something?
Thanks,
|
|
|
|
|
From things you've said, I think you're talking about printing on paper instead of a screen.
There is indeed a process to follow when doing so, it involves telling the print sub-system that you've printed a page and wish to print another in the same print-job.
If indeed producing a hard-copy output is your aim, you may find the following of some use: Answer --> I want to print an image from a class library project without any gui.[^]
You can and should enumerate the available printers in your system and allow the user to choose from them. In this example, I've simply used the printer's name, as seen in Control Panel\Hardware and Sound\Devices and Printers in Win7.
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|
|
Gagnon Claude wrote:
pDC->(TextOut(pt.x, pt.y + j * m_nHautLigne, resToken); That does not really tell us anything useful. You need to show where in your code you check for end of page, and exactly what index values you start with on the second page.
|
|
|
|
|
Hi All,
I can see that exe files have file info including company name, version, ... How do I add the same information to a text file?
Thanks,
Henry
henryh
|
|
|
|
|
No way except writing that in the file itself. That informations are put in specific fields of the file with a well defined format that Windows understand and show you as field in its Property Dialog.
|
|
|
|
|
Thanks. I have a hex record file and now I have to open the file, go through the translation, just to see what version of the file!! Any suggestion is appreciated.
Thanks,
Henry
henryh
|
|
|
|
|