|
i dont really blame them for bad api functionality cos the only reliable way i found was to try a ping on the server before assuming a connection was actually there ... i found a timeout of 10 seconds gives a fair compromise between a user waiting too long and the net being a little slow
if there is a better way i would like to hear it
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
You're right. But testing for a ping needs to be done in a separate thread (i.e. in a non-blocking manner) for it to be useful. I can't think of a foolproof and efficient way to do this.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
thats why i use a timeout of 10 seconds ... a klunk of a compromise but at least sanity shows its face occasionally
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
HI , Ijust was wondering how
can I get the handle (hfile) of my application file from its code
(i.e to get the hfile of the exe and the code to do so is in the same exe too)
thanks in advance
|
|
|
|
|
What's about retrieving the module file name and path with GetModuleFileName() and then just open it with CreateFile()
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
GetCurrentProcess() does that.
|
|
|
|
|
the scrollbars don't work. actually, the page up/down parts do (click in the track, outside the 'thumb' part) and the arrows do, but i can't drag the thumb bar. it doesn't move. it happens on both the vertical and horizontal scrollbar...
why is CListCtrl such a P.I.T.A. ??
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hey, why don't you write your own list control and post it here? While you're at it, write a list box too, as that is pretty annoying (no clean way to change between single select and multiple select at run-time.)
Even if you win the rat race, you're still a rat.
|
|
|
|
|
you first
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
ah... found it... this one was my own stupid fault.
for future reference, if you're doing drag/drop and you're handing WM_CAPTURECHANGED, be aware that calling ReleaseCapture will cause you to be unable to grab the scrollbar thumb. so make sure you really want to release the mouse before you do it (like, only release if you're dragging something).
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
So what is it with XP and Microsoft??? All my programs have this stupid white background for the text of the menu bar, while most of Microsoft's apps don't (but a few do). How do I get the background to be transparent? I'm not doing anything wierd other than dynamically creating the menu bar with CMenu.
Thanks,
Marc
|
|
|
|
|
I wnat use NetRemoteTOD to get server time
but compile failed in Visual studio 6.0
(1)lmremutl.h(53) : error C2146: syntax error : missing ';' before identifier 'NET_API_FUNCTION'
(2)lmremutl.h(53) : error C2501: 'NET_API_STATUS' : missing storage-class or type specifiers
(3)fatal error C1004: unexpected end of file found
Generating Code...
|
|
|
|
|
|
Sorry, html formatting of CodeProject removed the interesting part of my former posting (the file name)
Do you include the <lm.h> file?
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
I have a map in which I want to remove certain elements. So I iterate through the map, starting with
KeyOptMap::iterator keyIt0 = keyOptMap.begin();
If the maps value satisfies a certain criterion, I want to erase that element from the map for which I'm using
for (; keyIt0 != keyOptMap.end() ; ++keyIt0)
{
if (nPopOffKeyFlag) keyOptMap.erase((*keyIt0).first);
}
Getting a crash. is it legal to erase like this? I might be erasing the very first key where the iterator started.....
Any sugggestions?
Thanks,
ns
|
|
|
|
|
You're invalidating the iterator when erasing the element it points to. This can be worked around like this:
for (;keyIt0 != keyOptMap.end();)
{
if (nPopOffKeyFlag) keyIt0=keyOptMap.erase(keyIt0);
else ++keyIt0;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Precisely what I realised when I stepped along! Thanks so much for pointing it out too. I feel pretty goofy for that slipup!!!
ns
|
|
|
|
|
I'm implementing a group object selection tool much like the Power Point and Word's drawing tools where you can draw a box around items you want to select and it will select them all. Anyway, I'm using the DrawDragRect function and when I draw a selection box that I drag towards the bottom right of the screen from my starting point, it works fine. When I drag towards the top left of the screen from my start point though, the inside of the rectangle is drawn in a grey kind of shadowy color. I want it to be transparent like when drawing from top-left to bottom-right. Anybody have any experience with this?
|
|
|
|
|
help! I have been trying to populate a cRIchEdit control with a smal paragraph in vain for the last two days. I used an article from CP.
http://www.codeproject.com/richedit/richeg.asp but have had no luck! Any input would be greatly appreciated> I've already wasted a day and a half on this....and am no nearer to seeing my editbox being filled....
thanks,
ns
|
|
|
|
|
Would a simple static text control work for you? That's the easiest way to just display a bunch of text. You can select the "Sunken" look if you want the text to appear as if it's in an edit control. And you can just use "\n" to delimit paragraphs.
If you want the user to be able to channge the text, you'd of course need to use an edit control. A straight CEdit should do the job.
It seems you're having problems - post the offending code snippet (not an entire method, please) and we'll see what's wrong with it. Remember to surround your code with <pre> and </pre> .
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
DArn! The label idea wont work. Too bad. The code I used for the richedit doesnt crash but doesnt populate the box and I dont know why. Its got callbacks and stuff. I'll post it if you'd like to take a look at it.
|
|
|
|
|
A static text control works fine for me. I'm emailing you a sample project @ work/home.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
WoW! I'm going to try it right now. A million thanks!
|
|
|
|
|
I feel sheepish. I got so carried away with callback functions and streamIn etc, and all I needed was SetWindowText() ...
|
|
|
|
|
i'm using GetWindowDC(NULL) to retrieve the device context for the entire screen,
is there any way to retrieve the device context for the entire screen without my dialog in it ?
thanx
|
|
|
|