Question about Application behaviour,...

Hi,

i have a simple MFC Application, that shows me the System Memory Usage.
But after a while the Applications GDI Objects Count grows to something
about >8.000 GDI Objects and its Virtual Memory (not much but step by step 
too)
 in less than 5 Minutes. I can see with ProcessExplorer that the application 
does have
a high count of page faults. I cant figure out why! The System then starts 
to react
slowly. The Timer invokes every seconds the member function with the code
following this text, sets the Position on a progress bar control and raws a 
transparent
text on the surface of the progress bar. My System is XP with all SPs and 
Updates available.


The main code of the application is a timer and a function
inside the Main Dialogs Class:

------------------------------------------------------------------

 TCHAR lpszPercentUsed[4];
 TCHAR lpszMemoryAvailable[20];
 TCHAR lpszMemoryTotal[20];
 TCHAR lpszMemoryUsed[20];



 LPMEMORYSTATUS lpMS;

 lpMS = (LPMEMORYSTATUS) malloc(sizeof(MEMORYSTATUS));
 ZeroMemory(lpMS,sizeof(MEMORYSTATUS));

 lpMS->dwLength = sizeof(MEMORYSTATUS);

 GlobalMemoryStatus(lpMS);

 wsprintf(lpszPercentUsed,"%d%%",lpMS->dwMemoryLoad);
 wsprintf(lpszMemoryTotal,"%d MB",lpMS->dwTotalPhys/1000000);
 wsprintf(lpszMemoryAvailable,"%d MB",lpMS->dwAvailPhys/1000000);
 wsprintf(lpszMemoryUsed,"%d MB", ((lpMS->dwTotalPhys - lpMS->dwAvailPhys) /
1000000));

 this->m_MemoryLoadedPB.SetPos(lpMS->dwMemoryLoad);
 this->UpdateData(FALSE);

 CDC *pDC = this->m_MemoryLoadedPB.GetDC();
 pDC->SetBkMode(TRANSPARENT);
 pDC->SetTextColor((COLORREF)0x00FFFFFF);
 pDC->UpdateColors();
 pDC->TextOut(3,0,lpszPercentUsed,3);

 this->m_MemoryTotal = lpszMemoryTotal;
 this->m_MemoryAvailable = lpszMemoryAvailable;
 this->m_MemoryUsed = lpszMemoryUsed;

 this->UpdateData(FALSE);


 //free memory
 free(lpMS);

 SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
 HeapCompact(GetProcessHeap(),HEAP_NO_SERIALIZE);

----------------------------------------------------------------------------

Its been a long time since a wrote some MFC Code. This Code is
written and compiled with Visual C++ 6. Maybe i did something
wrong or forget something...

Any ideas,...

Best regards

Kerem G�mr�kc�






0
kareem114 (144)
3/26/2007 3:23:39 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
555 Views

Similar Articles

[PageSpeed] 24

You are having problem with the GDI objects .....
arent you missing ReleaseDC .....

"Kerem G�mr�kc�" <kareem114@hotmail.com> wrote in message 
news:%23kwLHr7bHHA.2088@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> i have a simple MFC Application, that shows me the System Memory Usage.
> But after a while the Applications GDI Objects Count grows to something
> about >8.000 GDI Objects and its Virtual Memory (not much but step by step 
> too)
> in less than 5 Minutes. I can see with ProcessExplorer that the 
> application does have
> a high count of page faults. I cant figure out why! The System then starts 
> to react
> slowly. The Timer invokes every seconds the member function with the code
> following this text, sets the Position on a progress bar control and raws 
> a transparent
> text on the surface of the progress bar. My System is XP with all SPs and 
> Updates available.
>
>
> The main code of the application is a timer and a function
> inside the Main Dialogs Class:
>
> ------------------------------------------------------------------
>
> TCHAR lpszPercentUsed[4];
> TCHAR lpszMemoryAvailable[20];
> TCHAR lpszMemoryTotal[20];
> TCHAR lpszMemoryUsed[20];
>
>
>
> LPMEMORYSTATUS lpMS;
>
> lpMS = (LPMEMORYSTATUS) malloc(sizeof(MEMORYSTATUS));
> ZeroMemory(lpMS,sizeof(MEMORYSTATUS));
>
> lpMS->dwLength = sizeof(MEMORYSTATUS);
>
> GlobalMemoryStatus(lpMS);
>
> wsprintf(lpszPercentUsed,"%d%%",lpMS->dwMemoryLoad);
> wsprintf(lpszMemoryTotal,"%d MB",lpMS->dwTotalPhys/1000000);
> wsprintf(lpszMemoryAvailable,"%d MB",lpMS->dwAvailPhys/1000000);
> wsprintf(lpszMemoryUsed,"%d MB", ((lpMS->dwTotalPhys - lpMS->dwAvailPhys) 
> /
> 1000000));
>
> this->m_MemoryLoadedPB.SetPos(lpMS->dwMemoryLoad);
> this->UpdateData(FALSE);
>
> CDC *pDC = this->m_MemoryLoadedPB.GetDC();
> pDC->SetBkMode(TRANSPARENT);
> pDC->SetTextColor((COLORREF)0x00FFFFFF);
> pDC->UpdateColors();
> pDC->TextOut(3,0,lpszPercentUsed,3);
>
> this->m_MemoryTotal = lpszMemoryTotal;
> this->m_MemoryAvailable = lpszMemoryAvailable;
> this->m_MemoryUsed = lpszMemoryUsed;
>
> this->UpdateData(FALSE);
>
>
> //free memory
> free(lpMS);
>
> SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
> HeapCompact(GetProcessHeap(),HEAP_NO_SERIALIZE);
>
> ----------------------------------------------------------------------------
>
> Its been a long time since a wrote some MFC Code. This Code is
> written and compiled with Visual C++ 6. Maybe i did something
> wrong or forget something...
>
> Any ideas,...
>
> Best regards
>
> Kerem G�mr�kc�
>
>
>
>
>
> 


0
mubi (158)
3/26/2007 3:32:27 PM
"Mubashir Khan" <mubi@yahoo.com> schrieb im Newsbeitrag 
news:erceKw7bHHA.4872@TK2MSFTNGP03.phx.gbl...
> You are having problem with the GDI objects .....
> arent you missing ReleaseDC .....
>
> "Kerem G�mr�kc�" <kareem114@hotmail.com> wrote in message 
> news:%23kwLHr7bHHA.2088@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> i have a simple MFC Application, that shows me the System Memory Usage.
>> But after a while the Applications GDI Objects Count grows to something
>> about >8.000 GDI Objects and its Virtual Memory (not much but step by 
>> step too)
>> in less than 5 Minutes. I can see with ProcessExplorer that the 
>> application does have
>> a high count of page faults. I cant figure out why! The System then 
>> starts to react
>> slowly. The Timer invokes every seconds the member function with the code
>> following this text, sets the Position on a progress bar control and raws 
>> a transparent
>> text on the surface of the progress bar. My System is XP with all SPs and 
>> Updates available.
>>
>>
>> The main code of the application is a timer and a function
>> inside the Main Dialogs Class:
>>
>> ------------------------------------------------------------------
>>
>> TCHAR lpszPercentUsed[4];
>> TCHAR lpszMemoryAvailable[20];
>> TCHAR lpszMemoryTotal[20];
>> TCHAR lpszMemoryUsed[20];
>>
>>
>>
>> LPMEMORYSTATUS lpMS;
>>
>> lpMS = (LPMEMORYSTATUS) malloc(sizeof(MEMORYSTATUS));
>> ZeroMemory(lpMS,sizeof(MEMORYSTATUS));
>>
>> lpMS->dwLength = sizeof(MEMORYSTATUS);
>>
>> GlobalMemoryStatus(lpMS);
>>
>> wsprintf(lpszPercentUsed,"%d%%",lpMS->dwMemoryLoad);
>> wsprintf(lpszMemoryTotal,"%d MB",lpMS->dwTotalPhys/1000000);
>> wsprintf(lpszMemoryAvailable,"%d MB",lpMS->dwAvailPhys/1000000);
>> wsprintf(lpszMemoryUsed,"%d MB", ((lpMS->dwTotalPhys - lpMS->dwAvailPhys) 
>> /
>> 1000000));
>>
>> this->m_MemoryLoadedPB.SetPos(lpMS->dwMemoryLoad);
>> this->UpdateData(FALSE);
>>
>> CDC *pDC = this->m_MemoryLoadedPB.GetDC();
>> pDC->SetBkMode(TRANSPARENT);
>> pDC->SetTextColor((COLORREF)0x00FFFFFF);
>> pDC->UpdateColors();
>> pDC->TextOut(3,0,lpszPercentUsed,3);
>>
>> this->m_MemoryTotal = lpszMemoryTotal;
>> this->m_MemoryAvailable = lpszMemoryAvailable;
>> this->m_MemoryUsed = lpszMemoryUsed;
>>
>> this->UpdateData(FALSE);
>>
>>
>> //free memory
>> free(lpMS);
>>
>> SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
>> HeapCompact(GetProcessHeap(),HEAP_NO_SERIALIZE);
>>
>> ----------------------------------------------------------------------------
>>
>> Its been a long time since a wrote some MFC Code. This Code is
>> written and compiled with Visual C++ 6. Maybe i did something
>> wrong or forget something...
>>
>> Any ideas,...
>>
>> Best regards
>>
>> Kerem G�mr�kc�

Hi Mubashir,

> You are having problem with the GDI objects .....
> arent you missing ReleaseDC .....

this->m_MemoryLoadedPB.ReleaseDC(pDC);

grfx%&�"$!?

Thanks,.....:-)

Beste regards,...

Kerem G�mr�kc�















0
kareem114 (144)
3/26/2007 3:44:38 PM
See below...
On Mon, 26 Mar 2007 17:23:39 +0200, "Kerem G�mr�kc�" <kareem114@hotmail.com> wrote:

>Hi,
>
>i have a simple MFC Application, that shows me the System Memory Usage.
>But after a while the Applications GDI Objects Count grows to something
>about >8.000 GDI Objects and its Virtual Memory (not much but step by step 
>too)
****
There is a serious bug in your code.  Consider downloading the Application Verifier from
Microsoft to study what is going on.
*****
> in less than 5 Minutes. I can see with ProcessExplorer that the application 
>does have
>a high count of page faults. I cant figure out why! The System then starts 
>to react
>slowly. 
****
There are a lot of issues here.  Page faults usually go up when you have too many objects,
so I suspect if you fix the reason for the 8000 GDI objects the paging problem will go
away.
****
>The Timer invokes every seconds the member function with the code
>following this text, sets the Position on a progress bar control and raws a 
>transparent
>text on the surface of the progress bar. My System is XP with all SPs and 
>Updates available.
>
>
>The main code of the application is a timer and a function
>inside the Main Dialogs Class:
>
>------------------------------------------------------------------
>
> TCHAR lpszPercentUsed[4];
> TCHAR lpszMemoryAvailable[20];
> TCHAR lpszMemoryTotal[20];
> TCHAR lpszMemoryUsed[20];
>
*****
I tend to get very nervours when I see global TCHAR variables used for this purpose.  Why
not local variables, and why not CStrings?  Note that if the result is 100%, You need FIVE
characters, so why do you create a buffer that is too small?
*****
>
>
> LPMEMORYSTATUS lpMS;
>
> lpMS = (LPMEMORYSTATUS) malloc(sizeof(MEMORYSTATUS));
> ZeroMemory(lpMS,sizeof(MEMORYSTATUS));
*****
Why are you allocating this from the heap?  Why not just declare a local variable
	MEMORYSTATUS status = {sizeof(MEMORYSTATUS) };
*****
>
> lpMS->dwLength = sizeof(MEMORYSTATUS);
>
> GlobalMemoryStatus(lpMS);
*****
GlobalMemoryStatus(&status);
****
>
> wsprintf(lpszPercentUsed,"%d%%",lpMS->dwMemoryLoad);
> wsprintf(lpszMemoryTotal,"%d MB",lpMS->dwTotalPhys/1000000);
> wsprintf(lpszMemoryAvailable,"%d MB",lpMS->dwAvailPhys/1000000);
> wsprintf(lpszMemoryUsed,"%d MB", ((lpMS->dwTotalPhys - lpMS->dwAvailPhys) /
>1000000));
*****
A MB is not 1000000.  It is 1024*1024.  

A rule of good programming is that you should forget that you ever heard of wsprintf or
printf.  If you are using VS2005, you can use sprintf_s, or you can load StrSafe.h and use
StringCchPrint, but do NOT use the obsolete and dangerous functions sprintf or wsprintf.

Also, although you declared the variables as TCHAR and use a Unicode-aware API wsprintf,
you use 8-bit format strings.  The strings should all be of the form _T("...").
*****
>
> this->m_MemoryLoadedPB.SetPos(lpMS->dwMemoryLoad);
> this->UpdateData(FALSE);
>
> CDC *pDC = this->m_MemoryLoadedPB.GetDC();
******
You should not be using GetDC.  You should not need to use this-> for a member variable.
You definitely do NOT want to be doing painting here.  What you WANT to do is to set up in
the MemoryLoadedPB object the necessary information to do the formatting, and then
invalidate it.  Let its OnPaint do the drawing.  This code is fundamentally wrong.

In general, you should also forget that you ever heard about GetDC.  If you want a DC, you
would use
	CClientDC dc(&m_MemoryLoadedPB);
but that would still result in incorrect code because you should not be doing drawing
here.
*****
> pDC->SetBkMode(TRANSPARENT);
> pDC->SetTextColor((COLORREF)0x00FFFFFF);
*****
0xFFFFFFF is not a color value.  What you would write here is
	pDC->SetTextColor(RGB(255, 255, 255)):
do not write assembly code unless you know what you are doing.  A hex value like this is
just the "assembly code" of color representation.  
*****
> pDC->UpdateColors();
*****
It is not clear that this is required here.
****
> pDC->TextOut(3,0,lpszPercentUsed,3);
*****
So why 3?  And why are you so confident that lpscPercentUsed has 3 characters?  If you
wanted to be accurate, you would do
	pDC->TextOut(3, 0, lpszPercentUsed, _tcslen(lpszPercentUsed));
or better still, use a CString instead of the relatively obsolete concept of using a TCHAR
array, and you would have done
	CString PercentUsed;  // no prefix required, avoid HN when possible
	PercentUsed.Format(_T("%d%%") ,lpMS->dwMemoryLoad);
	pDC->TextOut(3, 0, PercentUsed);

I avoid precomputing values and then showing them later; I tend to use string names like
s, and put the formatting and display next to each other as shown above.
*****

>
> this->m_MemoryTotal = lpszMemoryTotal;
> this->m_MemoryAvailable = lpszMemoryAvailable;
> this->m_MemoryUsed = lpszMemoryUsed;
****
So why didn't you format directly into these string variables?  Why use a dangerous and
obsolete mechanism to do the formatting (wsprintf) and then copy the string to a CString?
*****
>
> this->UpdateData(FALSE);
****
I would avoid using UpdateData unless there is some good reason to.  Setting values into
controls to be displayed is not in this set of reasons.  Simply call SetWindowText. It
avoids the issues of side effects of UpdateData such as other controls get updated, thus
changing the values the user has clicked on.  Just format the values into CStrings, and
then do
c_MemoryTotal.SetWindowText(MemoryTotal);
****
>
>
> //free memory
> free(lpMS);
*****
And where did you release the DC?  You wonder why you are leaking GDI objects...of COURSE
you are going to leak GDI objects, because you have a deliberately GDI leak built in. This
is why you should never use GetDC (use CClientDC or CPaintDC) but the whole point of doing
the drawing here is completely wrong and must be fixed by moving the drawing into the
OnPaint handler of the control you want the drawing done in.

And why do you need to free an object (the MEMORYSTATUS) that should never have been
allocated in the first place?
*****
>
> SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
****
Oh dear.  You are getting massive page faults, and you wonder why?  BECAUSE YOU ASKED TO
HAVE MASSIVE PAGE FAULTS.  Thats what -1, -1 means here, it means "make me have lots of
page faults, PLEASE!"
*****
> HeapCompact(GetProcessHeap(),HEAP_NO_SERIALIZE);
*****
And what do you think this is going to accomplish?  The answer is, fundamentally nothing.
It only has an effect if there are issues of heap coalescing due to massive heap activity,
which I see none of here
*****
>
>----------------------------------------------------------------------------
>
>Its been a long time since a wrote some MFC Code. This Code is
>written and compiled with Visual C++ 6. Maybe i did something
>wrong or forget something...
****
Several things wrong and a critical thing you forgot.  See above.
			joe
****
>
>Any ideas,...
>
>Best regards
>
>Kerem G�mr�kc�
>
>
>
>
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/27/2007 12:37:26 AM
That fixes only one of the many problems of this code.
				joe

On Mon, 26 Mar 2007 17:44:38 +0200, "Kerem G�mr�kc�" <kareem114@hotmail.com> wrote:

>
>"Mubashir Khan" <mubi@yahoo.com> schrieb im Newsbeitrag 
>news:erceKw7bHHA.4872@TK2MSFTNGP03.phx.gbl...
>> You are having problem with the GDI objects .....
>> arent you missing ReleaseDC .....
>>
>> "Kerem G�mr�kc�" <kareem114@hotmail.com> wrote in message 
>> news:%23kwLHr7bHHA.2088@TK2MSFTNGP05.phx.gbl...
>>> Hi,
>>>
>>> i have a simple MFC Application, that shows me the System Memory Usage.
>>> But after a while the Applications GDI Objects Count grows to something
>>> about >8.000 GDI Objects and its Virtual Memory (not much but step by 
>>> step too)
>>> in less than 5 Minutes. I can see with ProcessExplorer that the 
>>> application does have
>>> a high count of page faults. I cant figure out why! The System then 
>>> starts to react
>>> slowly. The Timer invokes every seconds the member function with the code
>>> following this text, sets the Position on a progress bar control and raws 
>>> a transparent
>>> text on the surface of the progress bar. My System is XP with all SPs and 
>>> Updates available.
>>>
>>>
>>> The main code of the application is a timer and a function
>>> inside the Main Dialogs Class:
>>>
>>> ------------------------------------------------------------------
>>>
>>> TCHAR lpszPercentUsed[4];
>>> TCHAR lpszMemoryAvailable[20];
>>> TCHAR lpszMemoryTotal[20];
>>> TCHAR lpszMemoryUsed[20];
>>>
>>>
>>>
>>> LPMEMORYSTATUS lpMS;
>>>
>>> lpMS = (LPMEMORYSTATUS) malloc(sizeof(MEMORYSTATUS));
>>> ZeroMemory(lpMS,sizeof(MEMORYSTATUS));
>>>
>>> lpMS->dwLength = sizeof(MEMORYSTATUS);
>>>
>>> GlobalMemoryStatus(lpMS);
>>>
>>> wsprintf(lpszPercentUsed,"%d%%",lpMS->dwMemoryLoad);
>>> wsprintf(lpszMemoryTotal,"%d MB",lpMS->dwTotalPhys/1000000);
>>> wsprintf(lpszMemoryAvailable,"%d MB",lpMS->dwAvailPhys/1000000);
>>> wsprintf(lpszMemoryUsed,"%d MB", ((lpMS->dwTotalPhys - lpMS->dwAvailPhys) 
>>> /
>>> 1000000));
>>>
>>> this->m_MemoryLoadedPB.SetPos(lpMS->dwMemoryLoad);
>>> this->UpdateData(FALSE);
>>>
>>> CDC *pDC = this->m_MemoryLoadedPB.GetDC();
>>> pDC->SetBkMode(TRANSPARENT);
>>> pDC->SetTextColor((COLORREF)0x00FFFFFF);
>>> pDC->UpdateColors();
>>> pDC->TextOut(3,0,lpszPercentUsed,3);
>>>
>>> this->m_MemoryTotal = lpszMemoryTotal;
>>> this->m_MemoryAvailable = lpszMemoryAvailable;
>>> this->m_MemoryUsed = lpszMemoryUsed;
>>>
>>> this->UpdateData(FALSE);
>>>
>>>
>>> //free memory
>>> free(lpMS);
>>>
>>> SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
>>> HeapCompact(GetProcessHeap(),HEAP_NO_SERIALIZE);
>>>
>>> ----------------------------------------------------------------------------
>>>
>>> Its been a long time since a wrote some MFC Code. This Code is
>>> written and compiled with Visual C++ 6. Maybe i did something
>>> wrong or forget something...
>>>
>>> Any ideas,...
>>>
>>> Best regards
>>>
>>> Kerem G�mr�kc�
>
>Hi Mubashir,
>
>> You are having problem with the GDI objects .....
>> arent you missing ReleaseDC .....
>
>this->m_MemoryLoadedPB.ReleaseDC(pDC);
>
>grfx%&�"$!?
>
>Thanks,.....:-)
>
>Beste regards,...
>
>Kerem G�mr�kc�
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
3/27/2007 12:38:04 AM
Reply:

Similar Artilces:

Open Outlook veiwer in my application
Hi, I want to open MicroSoft Outlook Veiwer in my application(using visual studio.net). How can i do this? Please define Microsoft Outlook Viewer? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After furious head scratching, Mallikarjun asked: | Hi, | I want to open MicroSoft Outlook Veiwer in my application(using visual | studio.net). | How can i do this? The Outlook View Control, which is included in OL2002/3 and a ...

Question about accelerator keys
Hi all of you, When I assign an accelerator key to a button name "Show options" an assign the accelerator key as 'o', the 'o' in 'Show' is underlined. I there anyway to tell VBA that I want the 'o' in 'options' underlined? In this particular case, maybe I can make o in options, a capita letter and get away with it but in general can we select the nt occurence of the letter to be underlined? Thanks. Ra -- Message posted from http://www.ExcelForum.com Hi! AFAIK Excel selects the first occurrence of the chosen symbol. Al -- Message poste...

how to run other application from ur program
dear friends, i m new to MFC ,but i want to open application like notepad using MFC . i want to send window messages like VK_LWIN VK_UP VK_UP and certain no of other messages to open any other application. how is it possible. Seems like you want a CreateProcess() function. Read about the parameters you provide for this program. You may also use a very simple function ShellExecute(), but it may not give you much flexibility like a control over the process you're creating. Here is an example of opening notepad.exe: ShellExecute(NULL, "open", "notepad.exe", GetPathName...

odd scroll bar behaviour in access, keeps returning to top
hi i have a user here, using ms office 2003, and he has noticed that when scrolling through ms access or excel, that often the vertical scroll bar he is using will return to the top position. this is the same for excel. its a bit of an issue, as he would be clicking through databases with thousands of rows of data, and it keeps retuning to the top of the row. i did notice that a program called ifinger kept popping up as this was happening. but i could not find info on the web linking this product with the issue he is having. if any one has any suggestions, id appreaciate it. Regards ...

MFC based client server application query?
Hi experts I have developed an client server application using MFC sockets support. The server is a dialog based application & the client is an SDI application. I am having problem with sending data from client to server. After starting the server application, i start the client and try to connect & send data to server using the following code. void CMainFrame::OnConnect() { CSimpleSDIsockclientApp *pApp = (CSimpleSDIsockclientApp*)AfxGetApp(); int res = pApp->ClientSocket.Create(40000); if(res) { MessageBox("Client Socket at port no. 40000 Successf...

VLOOKUP Formula Question
I've got data from two different spreadsheets, but need the product cos from Data Range A to put next to the sales price of Data Range B. Data Range A Model Number Product Cost A 0.10 B 0.20 C 0.30 Data Range B Model Number Size Sales Price A 8x10 $1.00 B 5x7 $2.00 C 4x6 $3.00 What formula do I use if I want to get the SALES PRICE from Range B an put it right next to the Product Cost -- Message posted from http://www.ExcelForum.com Hi Try using the following using your proper filenam...

Combined IF Statement Question
I'm trying to get a formula that if any one of the cells in A3:A9 are "No" then add the corresponding B3:B9, if "Yes" then don't add. I have six differenting connecting sum areas that all need to be combined in one formula. How can I do this? -- JustLearning =SUMIF(A3:A9,"No",B3:B39) -- David Biddulph "Cindi" <Cindi@discussions.microsoft.com> wrote in message news:B7FDD15D-C14C-4E27-85A9-2E7AC14E2AA2@microsoft.com... > I'm trying to get a formula that if any one of the cells in A3:A9 are "No" > then...

2 Questions #3
What are some -strategies- to testing formulas? :confused: Please describe the steps to creating a chart. :confused: Thank you! :cool -- shein ----------------------------------------------------------------------- sheiny's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1509 View this thread: http://www.excelforum.com/showthread.php?threadid=26857 Hi Sheiny If you want to know the correct way to create a chart - these are the steps. Enter ytour data into the cells. Select the data and then click on the Chart Wizard on the Standard Toolbar - (the one w...

question on multiple email domains
what options do I have to accomplish the following: hosting email for 2 email domains on same exchange 2003 server (domainA and domainB). DomainA and domainB represent different divisions of one company but many users will be doing work for both divisions and therefore need to have the 2 email addresses. Here is the critical part: when email sent to say, rsmith@domainA is recevied by rsmith and rsmith replies, it must come 'from' rsmith@domainA, and when email is sent to rsmith@domainB and rsmith replies it must come 'from' rsmith@domainB. This is because it is the same ...

VBA Question #4
Hi: I have BASIC programming skills but have never had the opportunity to use VBA inside Excel. Using a UDF, I need to know how to take the contents of a cell and pass it to a variable inside my user defined function. I am trying to take the results in one cell and if it matches, then take the information from two other cells and multiply them together. I've poured over the VBA documentation and see how to push a value into a cell, but can't find any examples of retrieving a cell's content. Thanks in advance! -- Steve Spence Independent AMSOIL Dealer AMSOIL - The "...

A stupid Question?
I am a beginner of mfc. Here i have a question on how can i export a dialog from a project to others thx a lot^^ Open both the projects together in the workspace. Now drag the resources between projects as needed. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "adams" <a@a.com> wrote in message news:bogk5k$fkm$1@justice.itsc.cuhk.edu.hk... | I am a beginner of mfc. | Here i have a question on how can i export a dialog from a project to others | thx a lot^^ | | i can't drag the resources between two opened project can you expand in detail thank a lot "Ajay K...

Two "getting started" questions from a newcomer.
Two questions 1. When I open Outlook, it doesn't automatically bring up my dialer to access my mail, as does Outlook Express. In other words, whenever I click on my Express shortcut, my dialer appears, permitting me to dial up and check my mail. But when I click on the Outlook shortcut, the program opens, but then I have to call the dialer up separately 2. When Outlook opens, I always see this window labeled Microsoft LDAP Directory. It doesn't matter whether I click "okay" or "cancel," because nothing seems to happen. How do I stop this window from popping ...

formula question #28
I need to do a formula as follows. If the amount in column A is < $1500 calculate it by .034. If the amount is > $1500 then they get .00 of only the amount over %1500. Know how to do IF statements but can't seem to figure out how to calculate only on the amount under a certain value and not on the amount over that value. So results should be $1500*.034 = $51.00 00-1700 *.00 = $00.00 Total Commission $51.00 Help!!!! Thanks if you can do this.:confused: :rolleyes: -- Sharon D. ------------------------------------------------------------------------ ...

Question about CSocket::Receive()
I have a class derived from CSocket. I have a vague recollection that I only get one shot at calling Receive() in my override of OnReceive(). What I mean by that is that if there's 2k of data to be read but I only read 1k when I call Receive() then the other 1k gets lost. Or can I call Receive() more than once within OnReceive() but after I exit OnReceive() I lose any data that didn't read? I can't remember where I've read this or something along those lines and I can't see it in the documentation. It may be that I'm completely mistaken and it's just my ...

Question about Forms collection
I have a super form with a tabbed control that has 6 tabs each with its own sub form(s). A Total of 8 forms involved. Form Hierarchy is as Follows Super Form Family Tab Family Contacts Sub Form Information Tab Information Sub Form Performance Tab Performance Search Form Performance Sub Form Product Product Search Form Product Sub Form Reports Reports Sub form I have been coding a set of business rules for this database and I've come across a problem According to Access Help Menu the...

vc++ 6.0 application runs on windows 20003 (64 bit CPU 32 bit OS)
Hi I have a VC++ 6.0 application runs on windows 20003 (64 bit CPU and 32 bit OS), it does not work. The same application runs fine on Windows XP and Windows 2000. When I debug it with VC++ 6.0, the break points and the source code totally messed up. I have a if else statement, the debug goes from inside if goes to else block if (...) { ....................... } else { ............... } Does any one have any idea about this? Thank you for your help There is no content whatsoever in the phrase "does not work". There is always a specific statement as to why something do...

Newbie questions
Hi there After many years of using Outlook express I am locking at moving over to Outlook. What I am about to ask has probable been asked a thousand times on the group, but I'm new here so I'm sorry. I am using Outlook 2000 I have run Outlook for the first time and said yes to the default directory where the files are held, thinking that I would be able to change it after like in express, but I can't see how, where or how do I change this directory? I have a main pc and a notebook, don't know if this can be done but can I sync the data between the 2 systems? If ...

Simple pie chart question
I'm a teacher trying to make a pie chart illustrating a part of a whole as a percent. I have two columns, one column (A1-A10)contains the total possible points for assignments 1 -10 the other column (B1- B10)contains the points earned for assgnments 1-10. the cell below each column has a formula that displays the sum of cells X1 - X10. So if a student has earned 75 points out of a possibe 100 you will see 100 in cell A11 and 75 in cell B11. OK. My question is how do I make a pie chart that will display something that looks like it is 75% one color and 25% another. I keep getting ...

questions on redeployment tool to copy production to test
In our environment, we have production and test CRM systems on two different domains/forest. Both have CRM running right now. Our objective is to refresh the CRM data in the test environment from Production. 1. The guide says that we need to create a new OU before starting the deployment tool. Do we need to create a new OU for our test system again. The OU is already present. What do we need to do to the OU and the users in it already in the test environment? 2. After the deployment wizard step in the document, the next step is Install Microsoft CRM. Do we need this step as it is alr...

Multilanguage support in MFC application
Hello, I’m looking for a library/tool to add multilanguage support to my MFC application. The different translations must be based on a text file, one for each language. There are many application (IZArc for instance) that employs this solutions. Anyone knows or use something like this? Thanks. It is possible to embed different language UIs into the application's RC file, but I prefer to create a single RC file for each language then use Visual Studio to build them into resource-only DLLs. When the user selects a language, the application dynamically loads the corresponding DLL...

HA design question 07
We are looking to use CCR on our Mailbox servers, but we only have one CAS server in the currently design. If we loose the HAS server can the Outlook 2007 client still connect to the mailbox? Do the Outlook 2007 clients connect directly to the Mailbox server or through the CAS server? My understanding is that Outlook will still function if you lose your only CAS. OWA, Activesync, and Autoconnect will fail though. Question: If you're building a HA environement you want at least two HT servers, right? Install your CAS role on your two HT servers and voila. "Ryan Sanders&qu...

Application or object defined error
Hi, When I run the following code, I am getting the Application or object defined error. The second line is a single line in my code. The VBE highlights the portion after "Then" in the second line. Sub Cleancolumn1() For i = 1 To ThisWorkbook.Worksheets("Sheet1").Cells(Rows.Count, 14).End(xlUp).Row If Left(Cells(i, 14), 1) = "'" Then ThisWorkbook.Worksheets("Sheet1").Cells(i, 14) = Right(Cells(i, 14), Len(Cells(i, 14)) - 1) Next i End Sub What is going wrong? Thanks in advance for the help. Regards, Raj Hi Raj Do you mea...

Excel question, will pay for answer, commission schedule calculati
Hi...having a problem with an excel formula, maybe you can help. I am willing to pay for an answer via paypal, just let me know your price. Email me at busselle (at) gmail (dot) com Here are the basics (numbers are examples for simplicity): 1) Scenario is a sales rep is trying to get people to invest money. The sales rep gets paid a commission when that happens. 2) The commission is based on how long the person keeps their money in (amount of money invested does not change). For the first year, 20%. 2nd year, 10%. 3rd year and on, 1%. Let's do an example. Say I am a sales rep...

FRx question-selecting amount from account
I have the following account in my report with the following data: W-TOC-3850- -US 1/29 (3,520.00) 1/30 (261.84) I only want the 1/30 amount to show up in the report. How would I set that in the row area (or would it be set in the row area)? Thanks for all help in advance. -- Dave Christman System Developer On Mar 22, 10:59=A0am, Dave Christman <DaveChrist...@discussions.microsoft.com> wrote: > I have the following account in my report with the following data: > W-TOC-3850- =A0 -US > 1/29 =A0 =A0 =A0 =A0(3,520.00) > 1/30 =A0 =A0 =A0 =A...

Capabilities Question
Hi, Being a developer I thought I would go to the source! Sorry if this is a sort of sales question. Do you think the Service module would cater for a Web Design Company job system? We currently use a SharePoint service to do this but like the looks of Dynamics. Core parts of the system should; 1. Jobs Description 2. Time & Cost Management 3. Job Status (New, Awaiting Customer, etc) 4. Reporting 5. Task logging etc 6. Maintenance Contracts (Ie Pay $x up front and service times deducted from allowance) Do you think Dynamics can handle this and would I need to mod it? Thank...