Actually, my question is about CMutex object not the kernel object created by CreateMutex(). CMutex is a MFC wrapper. Anyway, I suspect that you can create multiple CMutex objects that use the same named kernel object. I don't know how CMutex behaves exactly, as we don't have its source.
I suspect that you can create multiple CMutex objects that use the same named kernel object. I don't know how CMutex behaves exactly, as we don't have its source
Nope, if you try to create same named mutex it going to give your exception, simple technique is one would create it and other would open it!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
OK, I'm going mad here. I have a dialog class which I am creating from a dialog resource and displaying as modeless. I have data members assigned to the various controls and most of them work fine, except the CComboBox data member. I am trying to add some string data to the control in the CMyDialog::OnCreate(LPCREATESTRUCT lpCreateStruct) but it asserts because the control's hwnd is null. Do I need to do anything special with a CComboBox? My code is like this...
int CFlushDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
if (CDialog::OnCreate(lpCreateStruct) == -1)
SetWindowPos(NULL, m_nXPos, m_nYPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
m_comboDataMember.AddString("Hello"); // BOOM!// Other data members CEdit, CButton work OKreturn0;
As others have suggested, all GUI initialization should occur in OnInitDialog(). The fact that some controls work is probably more of a coincidence in how they're implemented but should not be an indication that this is the proper place for this.
I doubt on the term instance in case of pure virtual class.You can't create an instance of a class if it have a pure virtual function.May be the code is declaring the pointer of base class and assigning the instance of derived class.Like,
_base *pbase = new basederive();
Further question. What if you have two descendents from _base. How does the compiler know which one to instantiate?
This will be done with help of virtual pointer table.There are lot of articles in code project on this.Start from this link, ATL Under the Hood - Part 2
Yeah, its running on a remote machine, so I am doing an 'attach to process' in VS. pdbs are on the remote machine with the exes and dlls (best way to handle symbols for VS IMO). OS symbols are stored on the dev machie locally and off Microsofts symsrv.
But weird, just cant step into the code. Its not even complaining about lack of source code and offering the view assembler approach.
Cant really devote time to finding out why its not doing it, too much real work to do else where.
I dug a bit deeper and in fact the _base pointer instance is new'ed as the sub classes.
And now I saw that, I remember from about 12 years ago, that I have seen this before. Spent the last 10 years pretty much 100% in the kernel so I guess I got a bit rusty with the old C++ inheritance game.