|
tina- wrote: mybutton.Create("Button",BS_CHECKBOX ,r,this,100);
What is this ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: What is this?
pointer to the parent window, or is that the place i m committing mistake ?
how shall i get the pointer to the parent window ?
|
|
|
|
|
tina- wrote: pointer to the parent window...
Which is a?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
<br />
void CChildView::OnPaint() <br />
{<br />
CPaintDC dc(this);
<br />
<br />
CButton mybutton;<br />
RECT r;<br />
r.left=100;<br />
r.top=100;<br />
r.right=500;<br />
r.bottom=500;<br />
mybutton.Create("Button",BS_CHECKBOX ,r,this,100);<br />
mybutton.Invalidate();<br />
mybutton.UpdateWindow();<br />
mybutton.ShowWindow(SW_SHOW);<br />
}<br />
<br />
|
|
|
|
|
DavidCrow wrote: What class is the view derived from?
-> CWnd
|
|
|
|
|
Of course it is, just like any UI component. But more specifically, what class is the view derived from?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Of course it is, just like any UI component. But more specifically, what class is the view derived from?
it is like this ...
class CChildView : public CWnd
|
|
|
|
|
Normally, a view is derived from CView . With your requirement of wanting a button on it, why not use CFormView instead?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
is my code
<br />
void CChildView::OnPaint()<br />
{<br />
CPaintDC dc(this);
<br />
<br />
CButton mybutton;<br />
RECT r;<br />
r.left=100;<br />
r.top=100;<br />
r.right=500;<br />
r.bottom=500;<br />
mybutton.Create("Button",BS_CHECKBOX ,r,this,100);<br />
mybutton.Invalidate();<br />
mybutton.UpdateWindow();<br />
mybutton.ShowWindow(SW_SHOW);<br />
}<br />
correct enough to display a button ???
|
|
|
|
|
Hello everyone,
CRT is implemented a way that if developer provides DllMain, it will use the provided one, or else the default DllMain is used.
I am wondering how to implement similar selective linking approach? i.e. if there are more than one implementations of a method of the same signature, I can control which one has the higher priority to link, and if the highest priority one does not exist, the second priority one will be used (and compiler will have no duplicated method warning/error).
I do not think CRT implements the approach by using MACRO (if developer provides DllMain, developer needs to define some MACRO, but actually we do not define any macro when writing DllMain) to control the selective linking to DllMain.
Any ideas?
thanks in advance,
George
|
|
|
|
|
Hello everyone,
About the release method implementation of smart pointer of COM, there are two approaches below, and approach 1 is preferred is recommended by Inside COM -- should be better.
Anyone know why approach 1 is better than approach 2?
(m_pI is interface pointer to a COM interface of type T, and it is a member variable of the COM smart pointer class)
Approach 1:
void Release()
{
if (m_pI != NULL)
{
T* pOld = m_pI;
m_pI = NULL;
pOld->Release();
}
}
Approach 2:
void Release()
{
if (m_pI != NULL)
{
m_pI -> Release();
m_pI = NULL;
}
}
thanks in advance,
George
|
|
|
|
|
pointers is to be smarter than them. Otherwise they will leak on you.
|
|
|
|
|
Thanks Chris,
Any comments to my original question?
regards,
George
|
|
|
|
|
what is the difference between array to pointers and pointer to array.Is there any difference.
Thanks in advance
|
|
|
|
|
They're completely different types!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
philiptabraham wrote: array to pointers
There's nothing like that. May be you're talking about an array of pointers? If yes, the question then boils down to what a pointer is and what an array is.
Classic recommendation, buy a book.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
hello everyone,
i need to call my coding in c++ to matlab..it's about filter..i got read some materials about calling c++ to matlab but im not that understood..i dont know where to start and dont have clear view..i need some guidance..thank you
|
|
|
|
|
Maybe if you ask another 4 or 5 times, you'll get the answer your looking for.
|
|
|
|
|
Matlab has no documentation or a a place where users can ask questions?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I wrote two apps and I want to pass a string from one app to the other via SendMessage function.
The message handler will return LRESULT which is of LONG_PTR type. How do I return string types such as char *, wchar_t *, LPCTSTR, LPCSTR, LPCWSTR, and the likes by converting them to LRESULT/LONG_PTR?
|
|
|
|
|
Your two applications have separate address spaces so raw pointers can’t be passed between them, regardless of what casting tricks you try.
Steve
|
|
|
|
|
I see, and so, are there any ways to marshal data from one app to another?
|
|
|
|
|
There are many ways. Some that spring to mind:
- Use COM to do the work for you. This is not trivial because one application still needs to get a marshalled interface from the other.
- Use pipes. Again, you still need some mechanism to the a pipe handle to the other application.
- Use shared memory, perhaps in a DLL loaded into both .EXE’s.
- Use the WM_COPYDATA message. This is probably the easiest.
This list is by no means a complete one.
Steve
|
|
|
|
|
Thanks a lot, I'll start with WM_COPYDATA, I think it fits my purpose.
|
|
|
|