|
should not do?? can't we set a dialog (with WS_CHILD) as the child of another dialog? What else are you recommending?
|
|
|
|
|
Cool_Dev wrote: What else are you recommending?
I'm not recommending anything, merely pointing out Microsoft's notes about dialogs and whether they are child windows or popups. There is a difference in the way they operate.
It's time for a new signature.
|
|
|
|
|
ok.. that was the right context to point out it
|
|
|
|
|
My apologies, I misread the original question and thought it was a modal rather than modeless dialog.
It's time for a new signature.
|
|
|
|
|
Au contraire. A dialog makes a perfectly good child window, 'embedded' inside another window. It acts as a self-contained host for dialog controls.
|
|
|
|
|
You are right of course. Senility or brain fade hit me yesterday.
It's time for a new signature.
|
|
|
|
|
'S Ok. I should have read the entire thread before replying, as you recovered well.
|
|
|
|
|
Why do you want to modify the window style at runtime? It is easier to modify the dialog template in the resource editor and set the dialog as child there.
|
|
|
|
|
I have tried out with time interval 1 minute in vista as
NOTIFYICONDATA m_tnd;
m_tnd.uFlags = NIF_INFO;
m_tnd.dwInfoFlags = dwIcon;
m_tnd.uTimeout = uTimeout * 1000;
BOOL bSuccess = Shell_NotifyIcon (NIM_MODIFY, &m_tnd);
But in vista it always take OS settings. In OS it is set to 5 seconds and hence it disappears after 5 seconds.
Can my application control over it ? how ?
|
|
|
|
|
Hello all,
This is a macro from stdarg.h. I am trying to understand how does this work? But i got no idea.
<br />
#define STACKITEM int<br />
<br />
#define VA_SIZE(TYPE) \<br />
((sizeof(TYPE) + sizeof(STACKITEM) - 1) \<br />
& ~(sizeof(STACKITEM) - 1))<br />
In its definition, it says, it gives the size of object on the stack. I did not understand how is
this working.
Can anyone describe it for me?
Thanks
|
|
|
|
|
This macro rounds up the size of a variable type passed into variable length parameter list ...
The variable is rounded up to the size of a stack item, which will be the size of an int, 4 bytes on a 32-bit system. So even if you pass a char as one of the parameters, it will take up 4 bytes on the stack.
The extra code with the (sizeof(STACKITEM) -1) is meant to insure that if you pass in an item with size 0, you still get a 0.
This will happen on C when you pass in an empty struct or union.
C++ returns 1 for an empty class, struct, or union.
|
|
|
|
|
I assume that the expression
<br />
(sizeof(TYPE) + sizeof(STACKITEM) - 1)<br />
gives result 0 when there is no more data in stack(I may be wrong). But what about
<br />
& ~(sizeof(STACKITEM) - 1))<br />
what does that do altogether??
Thanks
|
|
|
|
|
~ is a bitwise NOT operation on a value.
So if you have x = binary 00110101, ~(00110101) => 11001010
if you use a bitwise & like this (x & (~x)) the result is 0
x: 00110101
~x: 11001010
------------
& 00000000
That would represent the case where the sizeof() returned 0.
To see how the macro will work with a different type:
(32-bit system)
sizeof(int) := 4
sizeof(short) := 2
VA_SIZE(short) =>
Start: ((2 + 4 - 1) & ~(4 - 1)) =>
Simplify: (5) & ~(3) =>
Convert To Binary: (101) & ~(011) =>
BitWise NOT: (101) & (100) =>
BitWise AND: (100) =>
Convert to Decimal: 4 bytes used on stack
The whole point of the macro is to round up the arguement to the size of stack entries, while returning 0 if the size of the parameter is 0 rather than automatically adding an empty stack item.
|
|
|
|
|
Hi guys, I am not sure why I got heap corruption error in this chunk of code. Anyone can help?
-inputEdits is a CArray of CEdit pointers
-the error I got is "HEAP CORRUPTION DETECTED after normal block at
CRT DETECTED that the application wrote to memory after end of heap buffer"
Thanks
CString msg;
for (int i =0 ; i < inputEdits.GetSize(); i++)
{
CString txt;
inputEdits.GetAt(i)->GetLine(0,txt.GetBuffer());
CString temp;
temp.Format("%s", msg);
msg.Format("%s%s,",temp, txt);
txt.ReleaseBuffer();
}
AfxMessageBox(msg);
|
|
|
|
|
Your CEdit, they are multiline (ES_MULTILINE) ?
the first Format looks wrong, there's nothing in msg in the first loop.
see the example on MSDN : http://msdn.microsoft.com/en-us/library/s7zy7cwk%28v=VS.80%29.aspx[^]
They seem to favor using the 2nd prototype of CEdit::GetLine (with the length or the line in the CEdit.
M.
Watched code never compiles.
|
|
|
|
|
Try:
inputEdits.GetAt(i)->GetLine(0, txt.GetBuffer());
txt.ReleaseBuffer();
...
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
You are directly manipulating the internal buffer of CString using GetBuffer(). You are wring some unknown number of characters into it using GetLine(). How do you know the buffer is big enough to contain all that data? Heap corruptions are often caused by "buffer overruns" and this smells like one.
According to the documentation, you need to tell it the size of the buffer you require for direct manipulation by specifying GetBuffer(size_needed) but you don't do that.
In most situations, you should use CString member functions to modify the contents of a CString object or to convert the CString to a C-style character string.
However, there are certain situations, such as working with operating-system functions that require a character buffer, where it is advantageous to directly modify the CString contents.
The GetBuffer and ReleaseBuffer member functions allow you to gain access to the internal character buffer of a CString object and modify it directly. The following steps show how to use these functions for this purpose:
Call GetBuffer for a CString object and specify the length of the buffer you require.
Use the pointer returned by GetBuffer to write characters directly into the CString object.
Call ReleaseBuffer for the CString object to update all the internal CString state information, such as the length of the string. After modifying a CString object's contents directly, you must call ReleaseBuffer before calling any other CString member functions.
|
|
|
|
|
The line:
inputEdits.GetAt(i)->GetLine(0,txt.GetBuffer());
is stomping all over the internal buffer of the CString. If you want to do this use something like CString::GetBufferSetLength to make sure there enough characters in the buffer for the edit control to overwrite. Remember to call CString::ReleaseBuffer afterwards to set the size of the string correctly.
Cheers,
Ash
|
|
|
|
|
Does anyone know if there is a topic or forum on this subject?
If not, is there much interest? I've had some success with this using Intel compiler tools and would like to see if others are on this path.
Many thanks!
Rob.
|
|
|
|
|
I'm all for multi-platforming including 64-bit multi-core
I haven't heard much about parellel though
-- Modified Monday, August 2, 2010 5:19 AM
|
|
|
|
|
Thanks for the feedback. I'd like to start a thread or something here about the topic. I had a project that really needed the performance boost and with some study was able to get the 64 bit running parallel.
I have an example program I'm planning to post after I sterilize my customers stuff.
If you want to get a head start, download Intel's 30 free trials of Parallel studio toolset and read up on OpenMP. Don't let it intimidate you cause there is alot of stuff. I switched to the Intel compiler a year ago and haven't looked back. It works great with MSVS 2008/2010.
The code I write of late is managed and native; just tons of fun.
Thanks!
Rob.
|
|
|
|
|
Hi there...Im a newbie
While using this function, how can I know things like
1) Manufacturer Identifier for Device Driver
2) Product Identifier for waveform input device
and other things similar to it...?? thanx
|
|
|
|
|
I have a MDI screen and I'm trying to display child CMDIChildWndEx windows with their own menus. I've seen on-line where "it's easy, just call SetMenu in CMDIChildWndEx::OnCreate".
int CChildFrame::OnCreate (LPCREATESTRUCT lpCreateStruct) {
if (CMDIChildWndEx::OnCreate (lpCreateStruct) == -1)
return -1;
m_menu.LoadMenu (IDR_POPUP_EDIT);
SetMenu (&m_menu);
return 0;
}
Apparently, I'm doing something wrong because I do that and I'm still not seeing a menu in my child window. I understand that child windows of a MDI are supposed to share a common menu but I have a specific case where I would like the child window to have its own menu. Anybody have any insight?
|
|
|
|
|
I don't think you can do this as child windows do not have menus of their own but share the menu of the frame window.
It's time for a new signature.
|
|
|
|
|
There is a classical way with the constructor of CMultiDocTemplate[^] ,
I see it as the primary mapping "DocumentToMenu"
Please try to find the construction in your code
or in the code generated by the application wizard.
virtual void BeHappy() = 0;
|
|
|
|