|
Two ways I know of, using Visual Studio and Windbg locally.
1) VS can be done remote, run msvcmon.exe on the target, do an atach to process in VS specifying the target DNS name. (Putthe symbols in the same dir as the exes for the service you are debugging). If you have the process project open you can set breakpoints and so on.
2) Another is to run Windbg on the client, and do an Attach to Process. SPecify the symbol path, image path, and so on.
This is all very well, but what if you want to debug the service early on in its start up, ie before you get the debugger on it?
I have heard of using Image File Executiuon Options http://support.microsoft.com/kb/824344[^] but I never got it working for me.
Instead what I do is hard code a DebugBreak() early in in the services code. With the target booted in debug mode (modify boot.ini or System Configuration, and enable debug on say CPM1 at 15200 baud). When you get a breakpoint hit the machine will wait till a debugger gets attached and then notify it that the break occured.
You can also debug through the kernel with a remote machine but this is a bit complex and doesnt add any benefits over doing it thorough user mode and it is complex.
#1 is OK, #2 I prefer, purely because I use Windbg so much, since I do mostly kernel debugging.
==============================
Nothing to say.
|
|
|
|
|
I've got problem with SetLayeredWindowAttribute, ever since I had set it, it wouldn't receive WM_PAINT anymore. But I have critical code in WM_PAINT.
How to get WM_PAINT again while having SetLayeredWindowAttributes called?
|
|
|
|
|
I've just done a quick search, and found the following msdn article:
http://msdn.microsoft.com/en-us/library/ms997507.aspx[^]
Have look at the "Layered Windows" paragraph, specifically the line:
"This is because SetLayeredWindowAttributes turns on the redirection of the window's drawing..."
I realised it would be hard to experiment with a "real" application - but if I am having trouble, I always make a simple small application to work with, and make changes on. Once you understand how to make your small application that does nothing more that show a small red rectangle on the screen with varying transparency (for example), then you can make educated changes to your real application.
Good luck!
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Thanks Iain.Your reply is of real help. I agree that we should always test a unknown technique within a small application that has all focus on it.
|
|
|
|
|
Currently i am working in windows application (VC++ 6) and I have decided to do certification : MCPD: window Developer 4. I need your suggestion, whether it is right choice to do? (or) any other certification are there to do? Your opinion help me to take right path.
modified on Tuesday, September 6, 2011 1:10 AM
|
|
|
|
|
Don't get certifications, make real coding experiences instead.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think it is a good idea!And I am doing it !Come on!
|
|
|
|
|
Hi, thanks for your valuable suggestion. Can you help me which material you are using for this certificate exame or any other links are there? or you are using any dumps links with you? kindly help me..
|
|
|
|
|
shanmugarajaa wrote: I need your suggestion, whether it is right choice to do?
Based on what? It requires knowledge of .NET Framework 4, which has nothing to do with VS6. The last certification that VS6 was good for was MCSD.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I decided to do Certification in MCTS: .NET Framewprk 4, window application. whether it is right choice to do this certification to do?.I am currently working in VC6, is there any certification for VC6?.
|
|
|
|
|
Hi,
How to go to the previous control when I press the up arrow key?
Thanks,
Claude
|
|
|
|
|
Could GetNextDlgTabItem[^] help along with SetFocus[^]? (Don't be fooled by the name, it can be used to get the previous item also.)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
How can I make my application exe which should not get debug through any debugger?
|
|
|
|
|
You can use the IsDebuggerPresent API to check the process is being debugged by a user-mode debugger.
However this will not prevent the process from being debugged.
The API is there to alter the behavior of the program when being debugged.
You could not provide the PDB file so that the symbols are not available and debugging becomes difficult.
|
|
|
|
|
|
This sounds suspicious: If I have a license for your app, and I have a license for a debugger, I have (as per the EEC law on software copyrights) the full right to run a debugger on it.
If you prevent it and I need it, I can even take you to a court to impose you to remove that protection.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Laws in other places are different however.
|
|
|
|
|
Not that much.
The principle "It sis yopur software, but that's not your computer" was applied by the US court that made Sony BMG retire their own "copyright protection systems" and pay some billions in a class action.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
How could I find spefications of C++ operators overload, such as how many arguments should operator+() take, what should be the first operator of operator new(), operator int() qualifies only if it's a member function.
I have <<c++ primer="">>, it lists a few of them.But it doesn't satisfy my needs.could someone help me?
|
|
|
|
|
Does this[^] help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Without googling for possibly more concise information, I do recall one thing about operator overloads: They must fit the signature of the standard operation; not with respect to type, which may be different, but with respect to number of arguments. Some operators have more strict requirements, e. g. assignmen operators should always return a value of type 'reference to the type that is being assigned to', but AFAIK these are not enorced by the compiler. It is still strongly recommended because otherwise youmight get unexpected behaviour when using these types with template libraries such as the STL.
You could take a look at the interface of std::complex for a comprehensive list of overloaded operators and their signatures: complex operators
P.S.: operator int() and the like, i. e. the casting operators, have their own special syntax:
a) they may not have a return type (which would be redundant anyway), and
b) they don't take an argument, because - as you noted - they only work as member functions.
You should however consider to specify them as explicit , to prevent an accidental inappropriate use through automatic type conversion by the compiler.
|
|
|
|
|
Hi Developers,
I was facing "Memory Leak" problem, from this chunk of code.
I have allocate a memory for a structure( pRecStruct ) & after that it has stored in a map( CMapWordToPtr - pMapUserBoard ) for furher use.
I have tried to delete as well, but the next time if i am trying to use.
Plese tell me the issue.
if( bSymAlreadyPresent == false )
{
CString str(pDBStruct->Symp);
strTemp.Format( _T("%d"), userClipIndx + 1 );
str += " Symptom Dropped on Clipboard " + strTemp;
MessageBox( NULL, str, "", MB_OK );
NEWDB_STRUCT near *pRecStruct=NULL;
pRecStruct=new NEWDB_STRUCT;
int cLen=strlen(pDBStruct->Symp);
pRecStruct->Symp=new char[cLen+1];
memset(pRecStruct->Symp, NULL,cLen+1);
memcpy(pRecStruct->Symp,pDBStruct->Symp,cLen);
pRecStruct->Remedy=new char[strlen(pDBStruct->Remedy)+1];
memset(pRecStruct->Remedy, NULL,strlen(pDBStruct->Remedy)+1);
memcpy(pRecStruct->Remedy,pDBStruct->Remedy,strlen(pDBStruct->Remedy));
pRecStruct->RecSize=pDBStruct->RecSize;
pRecStruct->LevelNum=pDBStruct->LevelNum;
pRecStruct->RemedyCnt=pDBStruct->RemedyCnt;
iTemp = pMapUsrClipboard->GetCount();
pRecStruct->SymNo = iTemp;
pRecStruct->Author=pDBStruct->Author;
pRecStruct->RecNo=pDBStruct->RecNo;
pRecStruct->ParOffset=pDBStruct->ParOffset;
pRecStruct->NextOffset=pDBStruct->NextOffset;
pRecStruct->CurOffset=pDBStruct->CurOffset;
pRecStruct->SymType=0;
pMapUsrClipboard->SetAt( iTemp, pRecStruct ); /// for remedies
/* delete pRecStruct;
pRecStruct = NULL;*/
bResult = true;
//clip1++;
}
Thanks.
Amrit Agrawal
Software Developer.
|
|
|
|
|
Amrit Agr wrote: I have tried to delete as well, but the next time if i am trying to use.
That isn't clear. What do you mean?
However you should know you need to delete the allocated character arrays together with the struct itself. You may use the destructor for this task:
struct RectStruct
{
RectStruct()
{
Symp = NULL;
Remedy = NULL;
}
~RectStruct()
{
if (Symp) delete [] Symp;
if (Remedy) delelte [] Remedy;
}
};
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Friend,
ur question not clear.
Tho i assume u face memory leak problem. and i suggeset watever u doing is rite. that is u delete the pointer and assign it to null.
Arun P.
|
|
|
|
|
Amrit Agr wrote: I have tried to delete as well...
You've not shown any code that deletes.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|