|
One to certainly consider is Rational Quantify for Windows NT
http://www.rational.com/products/vis_quantify/index.jtmpl
Here are some feature benefits from their page:
Automatically pinpoints application performance bottlenecks
Profiles all parts of your Windows® NT application — including components with or without source code
Quickly analyzes your executables -- no rebuild is required
Provides thorough and repeatable performance data
Supports Visual Basic, Visual C++ and Java applications
Companion tool for Rational Purify and Rational PureCoverage for Windows NT, and integrated with Rational Visual Test and Rational ClearQuest
Integrated with Visual Studio 6.0
|
|
|
|
|
I have some code that includes a function that draws a simple graph in a CButton using GDI calls (FillRectangle and Polyline). The purpose of this code is to allow selection of foreground and background colors. The "graph" in the CButton shows what the selection(s) will look like. I call the function in question when one of the color buttons is pushed and it works fine in those instances. So, I placed calls to the function in OnInitDialog (after the CDialog::OnInitDialog call), but it does not do the drawing. I've walked thru the code and it all appears to be executing correctly, but the graph is not displayed. Any ideas?
Thanks, so much.
|
|
|
|
|
Try initiating a redraw on it with an Invalidate.
Windows might not be thinking it needs to paint the control, or your MFC DC for the dialog is not valid yet.
At least after the dialog is inited, there will be a paint message in the queue for that control to execute the drawing.
|
|
|
|
|
try looking at OnCtlCOlor Function
AFter InitDialog it would call this function
which does the painting of all dialog controls
and the dialog
RObin
|
|
|
|
|
Hello fellow programmers
I have a simple question :
how can I determine the language of windows at run-time ??
Thanx in advance for any help
Have nice day !
|
|
|
|
|
I used the function ::GetLocaleInfo() from the Platform SDK in the past for my projects.
|
|
|
|
|
GetUserDefaultLangID() and GetSystemDefaultLangID()
GetUserDefaultLangID() gets you the language you've chosen from the keyboard (Alt+Shift to toggle between say Korean and French or whatever you have setup).
GetSystemDefaultLangID() gets you the fact that the box is
set up for Swahili or whatever.
The returned value is encoded in two parts, the primary
language and any appropriate sublanguage.
You'll need to lookup the language codes to determine the
values (For example English is 9 and is represented by LANG_ENGLISH).
Cheers
|
|
|
|
|
For those who have had experience with using the GridCtrl control, I was wondering if you knew how to incorporate bounds checking for individual cells into an app that used GridCtrl. Any suggestions would be appreciated! Thanks!
|
|
|
|
|
What sort of bounds checking are you referring to?
|
|
|
|
|
I am referring to the case where a user will enter a value/string into a cell and the program will check to make sure that the value/string is an appropriate entry. if not, a windows message box would pop up letting the user know the entry was innapropriate and the string would be reset. If anyone can help, please do! Thanks!
|
|
|
|
|
Hello,
I need to create a string from an int. The string should be always 6
characters long and prefixed by "0"'s if the int doesn't have 6 digits. For
example:
5 should become "000005"
8940 should become "008940"
I hope this explains what I'm going to do. Problem is, the algorithm will be
executed very heavily, so I need the fastest solution available.
Thanks for your help
Matthias
|
|
|
|
|
Why not use the sprintf() CRT function with some formatting flags?
|
|
|
|
|
And can't figure out how it should be working. There are flags for append 0's but I can't see flags for prefixing 0's.
Can you provide some code?
Matthias
|
|
|
|
|
Excuse the intrusion...
sprintf("0x%08X", value);
This will print a hex number with exactly 8 char, prefixed with zeroes. For a decimal number "%08d" should be fine.
Cheers,
Paolo.
|
|
|
|
|
If you want to try to get better performance than what you get using sprintf, it might be faster to:
(1) use _itoa to convert the number into a temporary result, then
(2) use strncpy to copy a string of six zeros to the result, using 6 minus the length of the string in the temporary result for the count
(3) concatenate the temporary result after that
I am not sure if there will be situations where strncpy will not add a terminating null; if there will, then you will need to modify this algorithm accordingly. For example, you could just initialize the result to six zeros always, then copy (strcpy) the temporary result to the appropriate position in the result, depending on the size of the temporary result.
|
|
|
|
|
I did some brief testing using a debug build.
I discovered that the Sprintf() took about 4100 ticks (difference between GetTickCount() calls before and after for loop) to do 1 million iterations.
Using a technique similar to what was described in other replies took about 1500 ticks.
Here is code snippet of faster technique.
// preset to required zero characters
memset(szBuffer, 48, 6);
// convert your number to ascii string
_itoa(iValue, szValue, 10);
// get length of string
iLength = lstrlen(szValue);
// copy value into zero buffered string
// starting at correct offset to leave leading zeroes
lstrcpy(&szBuffer[6 - iLength], szValue);
If you inlined the source for each of the functions, it would be even faster.
|
|
|
|
|
as in unix, we have to in the promiscuous mode first in order to view the packet but there is no way to go to promiscuous mode in window. so, how packet capturing to be done in windows??
|
|
|
|
|
Hi,
I want to pass a struct from class A to class B. In class B, the members of the struct will be modified. Those modified values will be returned to class A.
How can I do that ? Do I have to utilize accessor function ?
Why ?
Thanks,
Claude
|
|
|
|
|
I don't know if I understand the question properly, but here goes anyway :
struct MYSTRUCT
{
int x,y,z;
int avg;
};
class B
{
// pass MYSTRUCT by reference so that
// values will be modified.
void ComputeSomething( MYSTRUCT& s )
{
s.avg = (s.x+s.y+s.z)/3;
}
};
class A
{
MYSTRUCT m_sample;
void DoSomething()
{
B classB;
B.ComputeSomething( m_sample );
};
};
? Is this what you wanted ?
|
|
|
|
|
Can't you just pass a reference from one class/function to the other?
e.g.
struct S {
int i1;
int i2;
};
class A {
public:
func( S& s )
{
s.i1 = somevalue;
s.i2 = someothervalue;
}
};
class B {
public:
func()
{
S s;
A a;
a.func(s);
}
}
|
|
|
|
|
In my ATL DLL projects, I used one of the containers in STL. I also tured on the "Exception Handling" compiler option (-Gx) to suppress the warnings. It's just fine with my DEBUG built. But there is a link error "error LNK2001: unresolved external symbol _main" from my RELEASE build.
Could anyone tell me what I should do to solve the problem?
Thanks,
Tony
|
|
|
|
|
Remove the preprocessor option ATL_MIN_CRT from the release build settings.
|
|
|
|
|
It does work with my "Release MinDependency" build! But it couldn't solve the problem within my "Release MinSize" build. What should I do?
Thanks,
Tony
|
|
|
|
|
Hi,
You MUST remove the preprocessor option ATL_MIN_CRT from ALL release builds, not only from "Release MinDependency".
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
I am using CDaoDatabase and related classes to work with an MS-Access database. I need to do
replication and synchronization with this database. I need to synchronize between this database on a
local machine, and with it on a network drive. For some reason it does not want to work. It tells me
that "the database is not found." It does not tell me which one. I know for a fact that both of them
do exist.
The first thing that needs to be done is make sure that both databases have the "Replicable"
property. If this property does not exist, I need to create it. It is at this point that I already
have problems. Here I get a "Data type conversion error." This what my code looks like:
bool CMyDatabase::CreateDBProperty(CString sProperty)
{
DAOProperty *pdp;
DAOProperties *pdps;
bool bRet = false;
COleVariant vntName( sProperty );
COleVariant vntType(( short )VT_BSTR );
COleVariant vntValue( "T" );
COleVariant vntbDDL(( long )FALSE );
// m_daoDB is a DAODatabase (from CDaoDatabase::m_pDAODatabase)
HRESULT hr = m_daoDB->CreateProperty(
vntName,
vntType,
vntValue,
vntbDDL,
&pdp );
// hr result is 0x800A0D5D (3421)
// "Data type conversion error."
}
Does anyone have any ideas or help?
I would appreciate it!
|
|
|
|