|
Hi,
In my application, I need to check whether my system is remotely connected and if connected
I need to get the ipaddress of the remote system.
Any suggestions or links would be helpful.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
Have you tried NetWkstaUserEnum() ?
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello All,
consider following code
try
{
function();
}
catch(//what typr should expect)
{
}
fuction is develope from other one and he not mention the type of exception he returning..
/////////////////////////////////////////////////////
if i use this code
catch(std::exception & s)
{
cout<<s.what();
}
i get error in vs2008
Error is :--
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Please help ,
thanks.
|
|
|
|
|
Use:
try
{
}
catch(...)
{
}
To catch all exception types. Good luck!
|
|
|
|
|
Thanks for Reaply,
But how can I get type of thown exception.
whether he is throwing int,char*,of any user define data type.
So that I can Identify what type of execption is occur.
|
|
|
|
|
You can't...I would suggest you don't use a function if you don't know what its public interface is...and it's exception throwing habits are part of that public interface, so don't use this one...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
You left out the throw() operand.
Throw tells the compiler that a function could throw an exception and the catch() operand and catches (handles) the exception thrown by the throw() operand.
char *buf;<br />
try {<br />
buf = new char[512];<br />
if( buf == 0 )<br />
throw "Memory allocation failure!";<br />
}<br />
catch( char * str ) {<br />
cout << "Exception raised: " << str << '\n';<br />
}
|
|
|
|
|
1.Are all the conditional paths reachable?
2.Are all the individual conditions in a complex conditions separately evaluated?
3.If there is a nested IF statement, are the THEN and ELSE parts appropriately delimited?
4. In the case of a multi-way branch like SWITCH/CASE statement, is a default clause provided? Are the breaks after each CASE appropriates?
5.Is there any part of code that is unreachable?
6.Are there any loops that will never execute?
7.Are there any loops where the final condition will never be met and hence cause the program to go into an infinite loop?
8.What is the level of nesting of the conditional statements? Can the code be simplified to reduce complexity?
http://www.mindfiresolutions.com/Code-Review-Checklist-238.php[^]
Cheers,
Eliza
|
|
|
|
|
Quote from your profile .... Biography: I am in the marketing team at Mindfire Solution.
Is that whay you have not asked a proper question and have a link to your website ....... ?
Ali
|
|
|
|
|
I have a grid in which data in cells is updating in milisecond. Now I want to reflect these change in excel file . so I tried rtd server for this purpose . what documentation is available in c#.net , I want to implement in MFC because whole of application in MFC. how Can I achieve the task of rtd server in MFC
Trioum
|
|
|
|
|
Hi there,
I have a library that I want to publicy. It gives different facilities to C++ developers wanting to develop server application.
Are there general guidelines that can be useful ?
Easy Profiler : Now open source !
http://www.codeproject.com/KB/cpp/easyprofiler.aspx
|
|
|
|
|
About making the library yes, but ... it is a question you'd had to investigate BEFORE deploying the library ...
The only thing they can tell you right now is that you have to rewrite it based on a different coding standard on environmental assumption !
About public it, well... You have to document its functionality and its usage, either in informal way (describe the design and the way it should be used to accomplish certain tasks - this part should be readable like a book) and in formal way (alphabetical order of classes, functions, parameters, input output, processing, side effects, little testing samples etc.
You can try to have a clue about this can be done by looking existing library's documentation, like boost[^] (the link points just to an example), or MSDN[^] (just another sample) etc.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
|
How can i set the row text color of a listview using custum Draw....
ie the row text color should be different..
thanks in advance
|
|
|
|
|
You don't know how to make your list view owner drawn OR you don't know how to set text color OR both?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
i dont know how to set text color using list view owner drawn
i know only
ListView_setTextColor that sets for whole List view..
what i m trying is to set different color on different rows text
|
|
|
|
|
I have done exactly this...
In your (MFC) NM_CUSTOMDRAW handler, you need code like this:
void whtever the clas name is::OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLVCUSTOMDRAW pNMLVCD = reinterpret_cast<LPNMLVCUSTOMDRAW>(pNMHDR);
*pResult = CDRF_DODEFAULT;
switch(pNMLVCD->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
*pResult = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT:
{
const COLORREF mainColor = whatever the background text colour is;
const COLORREF altColor = whatever the alternate background colour is;
const COLORREF mainTextColor = whatever the main text colour is;
const COLORREF altTextColor = whatever the alternate text colour is;
const size_t row = pNMLVCD->nmcd.dwItemSpec;
pNMLVCD->clrTextBk = (1==row%2)?altColor:mainColor;
pNMLVCD->clrText = (1==row%2)?altTextColor:mainTextColor;
*pResult = CDRF_NEWFONT;
}
break;
};
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Error 46 error C3861: 'HANDLE_NM_CUSTOMDRAW': identifier not found
i am getting an error like this
|
|
|
|
|
Show your code. I have no idea where HANDLE_NM_CUSTOMDRAW comes from...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
do i need to add any header
for NM_CUSTOMDRAW
|
|
|
|
|
Look at the Custom Draw section in MSDN - here's a link[^]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
yeah
i was lokking to Handle NM_CUSTOMDRAW directly
its coming in WM_NOTIFY
Thanks i m working on that 
|
|
|
|
|
it never reaches in the below case statement
case CDDS_ITEMPREPAINT:
|
|
|
|
|
Do you have any items? If not, it's not going to.
The code in the CDDS_PREPAINT case block is what causes the custom draw state machine to call your handler for CDDS_ITEMPREPAINT.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
i have got around 1400 items in my ListView
its reaching inside CDDS_PREPAINT case
|
|
|
|