|
Looks interesting. I see from their reviews page you've used it Any more comments? What was the problem GlowCode found that other tools couldn't?
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
G'Day Taka,
I've been using it for quite some time. It is very good at pinpointing where bottlenecks occur. It can also find leaks.
I've not used other any profilers with VC++ code.
The nice thing about Glowcode is you don't need to do anything to your code in order to use it.
Neville Franks, Author of Surfulater www.surfulater.com "Save what you Surf" and ED for Windows www.getsoft.com
|
|
|
|
|
Mr. Franks,
Thanks for the link, I've downloaded GlowCode but it doesn't seem straight forward.
I've launched my app ( client.exe ), attached to it with GlowCode, and it has identified 0 functions and set 0 hooks.
Does the exe need to be in debug mode? Should I expect this app to work with programs that I personally didn't write or have source for?
Thanks,
- Mithra
|
|
|
|
|
From memory you'll need Symbols. You don't need source, but I can't see much point profiling if you don't. I can't recall whether it works for a Release Build. There are options to load symbols from DLL's. It should all be explained in the help.
I haven't needed to use it for some time, so my memory is a bit vague.
Neville Franks, Author of Surfulater www.surfulater.com "Save what you Surf" and ED for Windows www.getsoft.com
|
|
|
|
|
My intention was to use the profiler as a reversing tool, but based on what you've said that might not be appropriate.
I'm probably going to have to write a program that performs the functionality I need.
What I want to do is, identify the offset of each individual function within an executable ( or DLL ).
I can manually make this list from disassembler output if I need to.
Once I have this list of function offsets, I'd like to place a hook on every one of them so that execution will detour into some custom code of my own, where the frequency of that specific function call will be tabulated, before resuming normally. With that data in hand, I hope to be able to map out graphically which functions are being hit and at what frequency. This tool would also be useful in displaying frequency relationships between other functions. Case in point, if I was interested in all functions related to outgoing packets ( which I am ), I could identify the function that contained the winsock Send call, track how frequently it gets called over time, and display a list of probable functions based on similar call frequency.
When you've got a threaded program with 26,000 individual functions, backtracing from Send becomes meticulous and unreliable, especially if the code you're trying to find is not explicitly linked. If I can track call frequencies throughout an application, I believe I can narrow down the list of candidates and more quickly find what I'm looking for.
My first thought was to actually write thousands of detours into the running process so that execution would jump out ( into a DLL I injected ), tabulate the call, and resume, but I don't think I will be able to do this practically.
There must be a better method, perhaps setting a hook on each function?
|
|
|
|
|
Thanks. I've only ever used Microsoft's profiler (appalling) and BoundsChecker. BC was OK but having to instrument was a PITA. The IDE integration was nice. It could also run on stuff you didn't have symbols for which is handy if you suspect leaks/errors in a third-party component.
I guess the key question is: is Glowcode worth buying? It seems a shame to spend several hundred dollars on a product that works with VC6 which is now basically obsolete
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Dunno why i am drawing a blank here but here goes...
I have a pointer called buff
Tuff* buf;
Would like to send this data to function, but that function accepts a
NotTuff*
Please help refresh my memory.
|
|
|
|
|
LCI wrote: Dunno why i am drawing a blank here but here goes...
I have a pointer called buff
Tuff* buf;
Would like to send this data to function, but that function accepts a
NotTuff*
How are Tuff and NotTuff polymorphically related?
Regards,
Nish
|
|
|
|
|
I am using the Gdiplus library to display pics on a screen.
One of the calls that i have to make needs an IStream*.
However, i get the sream data from the camera as a cdvoid*. I need to pass the data from the camera to the Gdiplus but passing a cdvoid* to a function that takes an IStream* will not work so i somehow have to cast.
Any thoughts.
|
|
|
|
|
If you are sure that the csvoid* is a pointer to an IStream, go ahead and cast it - you could use dynamic_cast here - though depending on what a csvoid* is, you may have to resort to reinterpret_cast.
Regards,
Nish
|
|
|
|
|
Casting is not going to magically change this object. It's more likely that you need to access the bits of the bitmap and fill them out by traversing the structure you're getting back.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Assuming that the function can handle the conversion:
function( NotTuff *nt )
{
}
...
Tuff *buf;
function((NotTuff *) buf); There's also dynamic_cast if you need it.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
I have a CListBox, not ownerdrawn, and I want its size to be 3 items high, programatically if possible.
Is it possible to the the size of the control to a number of visible elements ?
well, an easier way than calculating that myself, by computing the item height + some padding for the borders.
for example :
int iHeight = m_Listbox.GetItemHeight(0);
int iBoxHeight;
CRect rect;
m_Listbox.GetWindowRect(rect );
iBoxHeight = rect.Height();
CRect rect2;
m_Listbox.GetClientRect( rect2 );
int iClientRectHeight = rect2.Height();
int iTotalBorderHeight = iBoxHeight - iClientRectHeight;
int iSize = 3 * iHeight + iTotalBorderHeight ;
rect.bottom = rect.top + iSize;
m_Listbox.MoveWindow( rect );
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
There isn't some magical SetVisibleItemCount() method or something like that, you'll have to calculate the size as you suggested.
You're on the right track with that algorithm, although that MoveWindow won't work as you expect. It expects coordinates relative to the parent window, and you're giving it coordinates relative to the screen. I'd recommend using SetWindowPos() with the SWP_NOMOVE flags so you only change the size of the window. Other than that it looks good.
And yes, GetItemHeight() will work for an empty list as long as it's not set to LBS_OWNERDRAWVARIABLE style.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Have a look at AdjustWindowRect .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Quick question. I have a C++ application that copies a file off of a CD-ROM to the disk. When it gets to the disk, the file is read only. I haven't programmed in Win32 in a while and I've forgotten which function allows me to change a file from read to read/write. The file system is NTFS.
Thanks in advance.
|
|
|
|
|
SetFileAttributes[^]?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Holy cow, I didn't know you still hung around here, Martin
Regards,
Nish
|
|
|
|
|
Hi Nish,
Good to see you! I have been here a few times to look somethings up, but I haven't programmed in win32 for a few years. I've mostly been doing UNIX programming the last couple of years. I hope you are doing really well, Nish, you have a great attitude and are extremely talented.
Sincerely,
Martin.
|
|
|
|
|
I got a project made to address Microsoft CryptoAPI but can't compile it. Seems, it can't recognize any declaration in wincrypt.h (I've verified that the wincrypt.h and Crypt32 library is in the right place).
I'll try to find on the code project, that suggest to define this:
#define _WIN32_WINNT 0x0400
or this:
#define _WIN32_WINNT 0x0500
#define _CRYPT32_
but neither is working
Google search said that we might have to install newer platform SDK. Does anyone has a clue of using it ? If it's really because of SDK, where to get it (I never used SDK before) ?
|
|
|
|
|
Not sure about the problem with the Crypto API not compiling, what errors are you getting back from the compiler?
You can download[^] the lastest Platform SDK straight from the MSDN site, just hope you're not on dialup as it's just under 400mb's
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Here are a parts my error (the first line, I'm using something from wincrypt - see at the end):
:\test crypto\certmanager\certificate manager v3.2.2\lcertcontext.h(24) : error C2146: syntax error : missing ';' before identifier 'CreateCardList'
d:\test crypto\certmanager\certificate manager v3.2.2\lcertcontext.h(24) : error C2501: 'PCCERT_CONTEXT' : missing storage-class or type specifiers
d:\test crypto\certmanager\certificate manager v3.2.2\lcertcontext.h(24) : error C2061: syntax error : identifier 'HCRYPTPROV'
I've tried to find in MSDN.com, but can't find it. Could you please give me more clue about how to find it (link, keywords, or whatever) ? I don't mind about the size
And here is a part of my code, including my define:
#define _WIN32_WINNT 0x0400
#include <stdio.h>
#include <windows.h>
#include <wincrypt.h>
#include "Resource.h"
#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
class lCertContext
{
public:
BOOL FillListCtrl(CListCtrl *List,int *ListIndex);
PCCERT_CONTEXT CreateCardList(HCRYPTPROV hCSPCard,DWORD dwFlag, LPTSTR szCSPname);
}
|
|
|
|
|
The missing 3 includes from my previous reply are (because of 'tag' like) - in the order:
stdio.h, windows.h, wincrypt.h
|
|
|
|
|
Weird, just tried building it from here and it works fine. Just check your defines are being made before you link to the include files, ie...
#define WINVER 0x0400
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <wincrypt.h>
Looking at the wincrypt header if dont use them anyways though.
You can download the Platform SDK from here[^], theres a section at the bottom that says 'Files in this download', just select the exe for your processor type, probobly x86.
Once you've downloaded the SDK (check you download all the samples as well as they can be quite helpful at times) try building one of the WinCrypt samples and see if that works.
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
The link you provided doesn't support VC++ 6 (seems Ms never care that millions people are still using the old good VS6). But anyway, I got it from a friend (after asking to many people ... and it's compiling perfectly. Thanks for your help anyway.
|
|
|
|