|
You could put this in OnSize and check.
|
|
|
|
|
The problem is that after OnSize it shows all correct, that's why i use MoveWindow in my timer. But my problem is how to make that right after OnInit it draws correctly? I resolved it only with timer... And by the way.. WHY it's all working on MY computer and on any other not?!?! (I have VS2008 SP1 and Windows XP SP3)
|
|
|
|
|
You can try another method.
Create a custom message and map it to a handler using ON_MESSAGE[^].
In the OnInitDialog function to a PostMessage[^] for your custom message.
In the message handler you could put the code that is in the timer.
|
|
|
|
|
Solution found.
LRESULT MainDial::OnMyMsg(WPARAM, LPARAM)
{
CRect rr;
this->GetWindowRect(&rr);
rr.bottom-=1;
rr.right-=1;
MainDial::MoveWindow(rr);
return NULL;
}
with ON_MESSAGE use.
Big thnx.
modified on Friday, October 23, 2009 8:30 PM
|
|
|
|
|
|
I'm looking for a MEE that can handle number expressed with factions.
Example: A user may use 3.5 * 4 7/8 or 3 1/2 * 4.875
I see a lot of MEE but do not want to go through each one.
Any help, pointers would be helpful
Thanks
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
Are you looking for a seriously advanced one (see this thread), or just one to handle 4-5 basic operators? The latter cab be done via a basic RPN calculator.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
How terrible is it to find out what application has a particular file open?
Clues?
-peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Via code?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Absolutely!
I'd love to display status information in my app about why I am having trouble backing up a file.
"File in use by Microsoft Word"
I could of course "guess using the file associations", but it would be cooler to know the actual application using the file.
-peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Peter Weyzen wrote: Absolutely!
Several utilities made by SysInternals do this, but they work in conjunction with a file-system driver. Many years ago, there used to be a "How does it work?" blurb on their Web site. I think it was removed even before Microsoft bought them.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi,
Saw a lot of posts related to this but still not totally clear -
It appears that even if you override OnOK for all property pages only the first page(1) OnOK override is called. The others are never called even if the user hits OK when page 2-n is active.
Does this means it is difficult to perform additional OnOK processing of the data on pages 2-n when the user dismisses the sheet?
Thanks
modified on Friday, October 23, 2009 2:34 PM
|
|
|
|
|
|
al2500 wrote: The others are never called even if the user hits OK when page 2-n is active.
With a very basic app created, I found this to not be true. Each page's OnOK() method was indeed called.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
But normally you would need any modified page's OnOK called since the user may modify more than one or close from a different page.
Regardless, I think the best method (for me) is as follows (found it in a post here):
Add afx_msg void OnOK(); to the property sheet definition
Add ON_COMMAND(IDOK, OnOK) and
void CMyPropSheet::OnOK()
{
AfxMessageBox("Hello World");
CPropertySheet::EndDialog(IDOK);
}
to the implementation. Then you have access to data memebers of all pages.
|
|
|
|
|
al2500 wrote: But normally you would need any modified page's OnOK called...
Which is exactly what happens, plus the pages that were not selected (i.e., no modifications).
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
David,
Thanks for your help - I see now that it calls OnOK (using afx_msg void OnOK()) for any pages that were viewed and I initially expected all pages to call OnOk regardless so I did not "view" them when testing...
However, I have verified that it only calls OnOK for pages that were viewed. This is OK with me but it might be good to understand why your behavior is different.
My code is -
For each page definition-
afx_msg void OnOK();
For each implementation -
ON_COMMAND(IDOK, OnOK)
void CPageN::OnOK()
{
AfxMessageBox("PageN");
CPropertyPage::OnOK();
}
Again, thanks for the help. It's actually much cleaner to perform any data validation/storage in the page implementation vs. the sheet implementation.
|
|
|
|
|
Messing around trying to learn something and I'm having trouble seeing the time benefits in my openMP example.
Each array (pArray1 and pArray2) hold about 10meg of RGB bitmap data, bufferSize2 is the bmp file size. OpenMP is enabled in VS.
So I can run the following with or without #pragma and get the same 20Msec's or there about.
<br />
<br />
#pragma omp parallel for //<-no impact on time<br />
for(long loop=0;loop<bufferSize2;loop++)<br />
pArrayResult[loop]= ~(pArray1[loop] - pArray2[loop]);<br />
<br />
I can try the common openMP example:
<br />
#pragma omp parallel<br />
{<br />
printf("hello world");<br />
}<br />
and never get something that looks like the example warning
helhelloo w world orld
I always get
hello world hello world
I can try
<br />
#pragma omp parallel<br />
{ <br />
int ID=omp_get_thread_num();<br />
printf("Hello(%d)",ID);<br />
printf("world(%d)",ID);<br />
}<br />
and the result is always sequential
hello(0)world(0) hello(1) world(1)
Anyone have an idea as to why everything seems sequential? What am I doing wrong?
Thanks,
Andre
|
|
|
|
|
A common misconception about multi-threaded programs is that they produce faster code. This can only be true if you have more than one processor. Otherwise, the context switches will actually make your code slower. Multi-threaded programs do make some problems easier to solve, however.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Sorry for not being clearer... As the beginning of my post suggest I'm working on two 10 meg arrays. I "think" I was careful in how I split the work with respect to memory as well. I thought that workload would be perfect for the openMP test. And strangely enough I was sure to run it on a dual-core machine.
Thanks,
Andre
|
|
|
|
|
In my non-Unicode application, If I put in Chinese Text into a Rich Edit Control, it displays the chinese characters fine. I was wondering how would I be able to read that variable into a string that would hold the chinese Text, Can I somehow read that into binary? or am I going about this the wrong way to be able to read and write chinese Text in non-unicode app?
|
|
|
|
|
|
Hi,
(Traditional, Big 5)
I have one simple program with a dialog and Edit field that I would like to enter chinese Text (like Customer Address). Usually I Serailize this field, and I read it from a different application thru the Serialize() function and display it. CString is what I use for that variable, but I know it doesn't work with chinese characters.
|
|
|
|
|
Software2007 wrote: CString is what I use for that variable, but I know it doesn't work with chinese characters
CString (on a non-Unicode build) should work just fine with the Big 5 encoding (Code page 950).
If I understand your requirements correctly, you could read the text from the rich edit control as Unicode (see EM_STREAMOUT[^] and then convert it back to CP 950 with WideCharToMultiByte[^] function.
|
|
|
|
|
I cannot type in Chinese Text into the regular Edit field to begin with, it displays ???? instead.
But if I use RichEdit control, I guess, I would be able to put in Chinese text, but I am not sure how to hold it in strings to serialize it, then when I read it back thru Serialize again it would turn back into chinese.
|
|
|
|