Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dialog Client -> 100% CPU Usage ?

Posted on 1999-07-30
12
Medium Priority
?
208 Views
Last Modified: 2013-12-26
I have generated a Dialog Client with AppExpert. Its CPU usage is almost 100%. Does anybody know the cause?
Borland C++ Version 5.0B
NT 4.0
0
Comment
Question by:moczar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
12 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1299154
I make same thing (but for Windows 95) and don't see
any problem. Can be problem in tool, that counts
CPU usage. What tool you use and do you sure, that
this tool works correct in NT?
0
 

Author Comment

by:moczar
ID: 1299155
I did the followings:
'File Menu'->'New'->'AppExpert...'
In the 'AppExpert Application Generation Options' dialog:
Window Model: Dialog Client, NO Document/View
Application->Basic Options: Features to include: ALL CLEARED!
Application->Advanced Options: Normal(sizeable), Standard Windows
Application->OLE 2 Options: NOT OLE2 container, NOT OLE2 server
Main Window Basic Options: Caption, Border Max box, Min box, System menu, Visible, Thick frame, Clip children

With these options, the AppExpert generates a client, which is a single dialog box. It has an 'OK' button and a 'Cancel' button only. On NT, the task manager reports that this application consumes 100% CPU. I did not try this program on W95.

0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1299156
I think, BC must make something as:

#include <owl/pch.h>

#include "clntnapp.h"
#include "clntndlc.h"


//{{TClientNDlgClient Implementation}}


//--------------------------------------------------------
// TClientNDlgClient
// ~~~~~~~~~~
// Construction/Destruction handling.
//
TClientNDlgClient::TClientNDlgClient(TWindow* parent, TResId resId, TModule* module)
:
  TDialog(parent, resId, module)
{
  // INSERT>> Your constructor code here.
}


TClientNDlgClient::~TClientNDlgClient()
{
  Destroy();

  // INSERT>> Your destructor code here.
}
In this text i don't see any problem, not important:
Windows 95/NT.
I guess, you count CPU during work with BC ?!
Close you BC, open ONLY you Aps and count.
If this not helps, post text of Dialog.
Alex
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1299157
moczar, are you jet interresing in you Q?
If you find a reply, interesting what? And you must
cancel you Q! If you don't find reply,
do you test my remark?
Alex
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1299158
Based on you silence i decide that my code helps you.
Alex
0
 

Author Comment

by:moczar
ID: 1299159
Sorry for the delay, I was out of the office for a week.

Unfortunately the problem still persists. I tried my test program on NT and W98. In both cases the Borland was closed. In both system the program used 100% CPU. My code is the same as yours and I also can not see the problem in it.
The following code was purely generated by AppExpert, I did not add any line to it.
I tried to generate SDI and MDI client applications too, they worked correctly.

Thanks, L.Moczar


/////////////////////////////////
//TestApp.cpp
/////////////////////////////////
#include <owl/pch.h>

#include <stdio.h>

#include "testapp.h"
#include "tstdlgcl.h"                        // Definition of client class.


//{{TTestApp Implementation}}


//
// Build a response table for all messages/commands handled
// by the application.
//
DEFINE_RESPONSE_TABLE1(TTestApp, TApplication)
//{{TTestAppRSP_TBL_BEGIN}}
  EV_COMMAND(CM_HELPABOUT, CmHelpAbout),
//{{TTestAppRSP_TBL_END}}
END_RESPONSE_TABLE;


//--------------------------------------------------------
// TTestApp
//
TTestApp::TTestApp() : TApplication("Test")
{

  // INSERT>> Your constructor code here.
}


TTestApp::~TTestApp()
{
  // INSERT>> Your destructor code here.
}


//--------------------------------------------------------
// TTestApp
// ~~~~~
// Application intialization.
//
void TTestApp::InitMainWindow()
{
  if (nCmdShow != SW_HIDE)
    nCmdShow = (nCmdShow != SW_SHOWMINNOACTIVE) ? SW_SHOWNORMAL : nCmdShow;

  TSDIDecFrame* frame = new TSDIDecFrame(0, GetName(), 0, false);
  frame->SetFlag(wfShrinkToClient);

  // Assign ICON w/ this application.
  //
  frame->SetIcon(this, IDI_SDIAPPLICATION);
  frame->SetIconSm(this, IDI_SDIAPPLICATION);

  SetMainWindow(frame);

}



//{{TSDIDecFrame Implementation}}


TSDIDecFrame::TSDIDecFrame(TWindow* parent, const char far* title, TWindow* clientWnd, bool trackMenuSelection, TModule* module)
:
  TDecoratedFrame(parent, title, !clientWnd ? new TTestDlgClient(0) : clientWnd, trackMenuSelection, module)
{
  // INSERT>> Your constructor code here.

}


TSDIDecFrame::~TSDIDecFrame()
{
  // INSERT>> Your destructor code here.

}


//--------------------------------------------------------
// TTestApp
// ~~~~~~~~~~~
// Menu Help About Test command
//
void TTestApp::CmHelpAbout()
{
}



int OwlMain(int , char* [])
{
  TTestApp   app;
  return app.Run();
}

/////////////////////////////////
//Tstdlgcl.cpp
/////////////////////////////////
#include <owl/pch.h>

#include "testapp.h"
#include "tstdlgcl.h"


//{{TTestDlgClient Implementation}}


//--------------------------------------------------------
// TTestDlgClient
// ~~~~~~~~~~
// Construction/Destruction handling.
//
TTestDlgClient::TTestDlgClient(TWindow* parent, TResId resId, TModule* module)
:
  TDialog(parent, resId, module)
{
  // INSERT>> Your constructor code here.
}


TTestDlgClient::~TTestDlgClient()
{
  Destroy();

  // INSERT>> Your destructor code here.
}


0
 

Author Comment

by:moczar
ID: 1299160
The problem still persists. Please see my previous comment!
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1299161
moczar, i test you code to NT 4.0 with help of
TaskMenager. No cpu 100%! cpu = 0%, as must be!
my EMail is shrlin@apelker.co.il Can you post me all
you Test Project(and i can test it) or i send you my Test Project and you can test it (write you EMail).
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1299162
moczar??
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1299163
Dear Laslo, i get you EMail, test you text and i don't see
next very important code:

void TSDIDecFrame::SetupWindow()
{
  TDecoratedFrame::SetupWindow();

  // INSERT>> Your code here.

}
If you version of Borland (5.0B?) not make it,
it is error of Borland!
My version: 5.01 make it!
You can easy test it, but i don't : exectly
today i lost my NT :-( .  
Alex
0
 

Author Comment

by:moczar
ID: 1954059
I don't see the importance of TSDIDecFrame::SetupWindow(). The TSDIDecFrame class is derived from TDecoratedFrame, and the code fragment you wrote does not contain any additional code. By the way, I have checked the situation by virtualizing the TDecoratedFrame::SetupWindow() in TSDIDecFrame. It did not solve the problem.
I agree that the bug can be in Borland C++ v5.0B. But where, and how to solve it?
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 600 total points
ID: 1954738
1. I find my NT and test you EXE file: no some
   dll (bids50f.dll).
2. I copmile and link you project. All OK!
3. I test it with TaskMenager: cpu = 0!
And now i know the problem: you have BC 5.0 BETA!
That means, that there are many many errors in you
version of BC! My recomendation: get rid of BETA and
buy/steal/get from friend normal version: better 5.02
I work with 5.01 and this is good version(with corrections
of many problems of 5.0 : parts of them you can find
in www.inprice.com , 2-3 was discussed in EE: see PAQs
in OWL).
BRW I risk to reply, becourse i hope, that is a final
of discussion.
Good Luck with BC 5.02  
Alex
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question