|
Read the VC forum FAQ which has an entry on converting numbers to their string representations.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Out of topic.
Interesting to see someone from C# coming to C++.
Job requirements make you do this, or our of shear interest?
|
|
|
|
|
Hi!
Does anybody know if there´s a specific message I can send (using SendMessage()) to an already open Windows file Open/Save dialog telling it to change path?
I know this can be done but I´m not sure that this metod it the right (best) one.
Thanks!
/Jonatan
|
|
|
|
|
I'm working on winsock application. The debug mode works fine but when I want to compile the release mode I got an error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup. I noticed the it can compile if I remove getaddrinfo, why?
Thanks!
|
|
|
|
|
Ehhh, I'm sorry but this "does not compute".
You say you get a linker error in Release mode, but then you say you can compile if removing the call(s) to getaddrinfo, implying you can't compile at all with that call in place. Odd.
I however suspect that you replaced "link" with "compile" in the last sentence.
From your error message it's clear that you are trying to create a console application. Is that correct? If so, somehow the (obviously) needed symbol main isn't defined for your Release mode build. Perhaps that can help you zoom in on the problem.
If not, a little more info might be helpful.
It could also be that you have mixed up your libraries or your libraries include paths, using older stuff for the Release build
|
|
|
|
|
Anyone know how to set a modeless dialog "active" on mouseover? (Kinda like x-windows)
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Handle WM_MOUSEMOVE and make the dialog the active window (if it isn't already). You have to do more work if you also want to relinquish the "active" state when the mouse leaves the dialog. You could do this by calling TrackMouseEvent() and handling WM_MOUSELEAVE , but this only works on > Win95.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
"Handle WM_MOUSEMOVE and make the dialog the active window (if it isn't already)." <-- this is what i don't know how to do. What fcn call makes the dialog "active" as if I clicked on it??
thnx in advance!
~nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Would you believe, SetActiveWindow() .
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Well, I guess it never hurts to first consider the obvious
thanx!
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Suppose a TCP/IP server application is running on a Wndows 2000 machine. It listens on a certain port and various clients can connect via this port.
Now what is the limit of connections, this server can accept from clients by default in Win2k. (Assume there is no other load on server it just accepts connections).
Is there any way we can increase the number of sockets to be accepted in Win2k ???
PaunTM
|
|
|
|
|
The EULA forbids you to accept more than 10 incoming connections for a Workstation, so that would be the limit (at least it used to forbid you, but since they apparently change EULA's with even security patches nowadays it might be even worse). AFAIK this is an accumulated maximum for _all_ IP-based services/server-style-connections, basically making what used-to-be-known-as "NT Workstation" unusable for anything server-ish net-related.
The only (legal) way to increase this would be to cash up a lot of (I believe the technical term is "shitload") of money to get the Server (or DataCenter or whatever they call it this week), even that it technically is AFAIK exactly zero difference wrt the IP stack between the different versions.
Perhaps you could just try to connect with a bunch of clients and see what limit you get?
|
|
|
|
|
I think that 2k pro will accept unlimited connections (or to the limit of the hardware/software). BUT, lets say 11 connection attempts come in at once to this same box. One of them will be denied or blocked until the others are processed. This is one of the limits removed by a 'Server' version.
This simply limits the rate at which remote clients can connect. Further attempts bounce or block, but probably bounce (bouncing makes it unreliable as a server platform blocking merely slows it down.)
MS doesnt want to limit the total number of raw connections because some applications use multiple sockets in order do their thing. For instance, a P2P app may have many connections open.
cant remember where I read this, or if this is what I read.
|
|
|
|
|
How to get the handle of interface of Iwebbrowser2 from CHtmlView:
ak
|
|
|
|
|
IWebBrowser2 is protected member variable(m_pBrowserApp) of CHtmlView class.
If you are using within CHtmlView derived class u can directly access 'm_pBrowserApp' or else you have to write a delegating function.
Hth,
Ramu
|
|
|
|
|
Hi all, I would like to be able to detect all the display modes capable by my graphics card. I am using DirectDraw/Direct3D and have all the necessary enumeration callback procedures in place. However I have a problem:
I want an array of custom mode structs that store the width, height and BitsPixel of a particular display mode (so I can reference it later), but don't know how many available display modes there are until they have all been cycled through in the enumeration function. This means I cannot initialise the array, and there for store the mode information as it goes along. Does this mean I have to use a vector of structs and make it grow as I find new modes? or is there a better way of getting this information before I convert into my custom struct? maybe using a different storage method?
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
There aren't a whole lot of modes, why not just use a static array of say 50 DEVMODE structs?
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
Jason Henderson wrote:
There aren't a whole lot of modes, why not just use a static array of say 50 DEVMODE structs?
Because it's wrong and will fail. Actually, a program (game demo) I tested just the other day had exactly this hardcoded limit and failed miserably. You weren't involved in that code by any chance? :->
At this machine (a plain NT5 machine with a reasonably good monitor) I currently have 144 different display modes. If I swicth to a "hotter" Gfx card I'll surely get over 200 different modes.
If you don't want your app to fail, don't use hard-coded limits for stuff like this.
|
|
|
|
|
Mike Nordell wrote:
You weren't involved in that code by any chance?
No.
I had no idea there would be that many modes. It was just a suggestion.
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
Why use a plain array when there are so many good collection classes already in C++. A plain std::vector seems to be the final storage type for this, but while enumerating you could use just about whatever collection type you like.
|
|
|
|
|
Thanks for the suggestions. After a little thought I decided to go with the std::vector method, because it is dynamic and will only take up the required amount of precious memory. I can always set a limit to the number of modes I want to read in, but at least the memory allocation will be efficient...
Thanks for the suggestion guys, very much appreciated.
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Hi all,
I have an MFC application that I is working in debug mode. However when I build it in Release mode, it appears to me that the global instance of my CWinApp derived class does not exist in the application. Therefore when the app goes to reference that object, it is referencing bad memory and the application crashes.
Does anybody know of a project setting, include file, or piece of code that would cause this problem, or does anyone at least know how to fix this?
Any insight would be greatly appreciated.
Thanks
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I think there is a bug in your application. It is declared like CMyApp the App; , so it exists regardless of the configuration. Could you please show some code when you reference that object?
Best regards,
Alexandru Savescu
|
|
|
|
|
You may be right about the problem being with my code. But I can get both debug and release builds to compile and start running.
The one main thing that confuses me is that the winApp object is present and gets initialized in debug mode, but it is like it never gets initialized or recognized in Release mode. So the first time that the winapp object is referenced it crashes.
If I trace to where MFC gets its pointer to the WinApp object (inside of the MFC source code), and I type the name of the Winapp variable in the watch window, it does not recognize the variable and thinks that it does not exist.
As far as posting some code what would you like to see? My instance of the CWinApp object is declared like this inside of my main cpp file:
CAMClientApp theApp;
It is declared like this in the matchin header file:
extern CAMClientApp theApp;
Thanks for your help, if you have any other ideas I would like to hear them.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Try to not declare it extern in the header file and use the AfxGetApp() function to refer it. If it still crashes, compile the realese with debug information and try some debugging.
Best regards,
Alexandru Savescu
|
|
|
|