|
includeh10 wrote:
1. my develop OS is win2k, but MSDN says server functions (i.e. listen and accept) need OS-server to support, must I change my OS by OS-server for using server-functions?
I can't believe that. Where did you find it? I cannot find myself inside the page you linked.
includeh10 wrote: 2. Is it no good if I keep CSocket for server side and use raw socket for client side? - because server side has no problem.
No problems (of course) other than poor developer having to deal with two different API s.
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]
|
|
|
|
|
includeh10 wrote: 1. my develop OS is win2k, but MSDN says server functions (i.e. listen and accept) need OS-server to support, must I change my OS by OS-server for using server-functions?
I think you misread something, this has never been a requirement. If it was then most Windows PCs would not work.
includeh10 wrote: 2. Is it no good if I keep CSocket for server side and use raw socket for client side? - because server side has no problem.
CSocket is just an MFC wrapper around raw sockets, It is much more likely that there is a bug in your code rather than something wrong with CSocket.
|
|
|
|
|
So MFC's CSocket caused problems in your code and you want to go to raw sockets. Why? Wouldn't it be quicker to fix your code or use one of the many existing wrapper classes. There are blocking and event based socket classes out there, in alphabetical order:
* Alhem
* Boost
* SharkEngine
* QT
* and many others...
It seems to be a C++ world stigma... instead of putting development effort into low-level coding, how about using a stable, documented library and improve the application with the extra time? I think it is not trivial to write a stable, flexible, efficient networking core. Perhaps you require at a later point HTTP proxy support, session handling, encryption or something else that a library would already provide. To be honest, other languages like Java or Python offer a better collection of reusable functionality, but at least for networking there are some good choices for C++ too.
Hope it helps!
|
|
|
|
|
Hi all,
I now using Visual C++ (Visual Studio 2005) for my project. i face some problem in set the maximum length for my edit control(text box).
i have 3 edit control in the same dialog. i want set the maximum length for each edit control = 5.
following are the 3 ID of edit control in same dialog:
IDC_EDIT_MCNO
IDC_EDIT_MCSERIALNO
IDC_EDIT_LOCATION
The dialog ID is: IDD_MACHINE
Please guide me for set max length.
Thanks very for your help. i will very appreciate.
Regards:
Alice 
|
|
|
|
|
What do you mean by maximum length of edit control?
Is it the number of characters or the width of the edit control?
|
|
|
|
|
hi, thanks for reply o^^
ya, i need to set the number of characters of the edit control o..
the maximum characters can enter for the edit control only 5.
Can you show me some guide?
thanks alot ^^
regards:
alice 
|
|
|
|
|
Have you tried sending the control a EM_LIMITTEXT message.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
If you're using MFC, look at the DDV_MaxChars[^] macro.
Actually, the Add Variable wizard in MFC can do this for you.
Right click on the edit control and select Add Variable.
The wizard will tell you what to do.
modified on Thursday, November 5, 2009 12:33 AM
|
|
|
|
|
«_Superman_» wrote: If you're using MFC, look at the DDV_MaxChars[^] macro.
Which comes into play only after the OK button is clicked.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Oh No.
It will not allow you to enter anything more than you have set.
You will get an error beep.
|
|
|
|
|
My bad. I guess I was thinking of the DDV_MinMax -type functions.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
LimitText of CEdit will do that 4 u [^].
Величие не Бога может быть недооценена.
|
|
|
|
|
hi ,
thanks a lot for your all helped .
My edit control can limit the input characters. ^^
Thanks agian
i very appreciate it..
regards :
alice 
|
|
|
|
|
I'm currently using the VMR-9 renderer to play a video in my game. Running when the game's in a window works perfectly fine. I create the filter graph and do all the set up right when I play the video and release the graph at the end of it. If I flip the game into fullscreen (true fullscreen, not a stretched window) before running the video, about 50% of the time the video will not render. When I press alt+enter (which the engine flips from fullscreen to windowed mode), I see the video image in fullscreen then when the game flips back to windowed, it's paused and it never hits any of my paused statements.
I've thrown in several logging statements in the WM_PAINT message handling and find that the HRESULT from the render returns S_OK every time. WM_PAINT is being called often enough that it should be painting just fine, as it does when not in fullscreen. Each update cycle of the game, I invalidate the entire window rect when the video's playing as well. The background color draws but not the video image. The renderer returns an S_OK from the repaint call, too.
I've tried with both compressed and uncompressed AVI files as well as WMV files, all with the same issue. They all run fine in a window, but fail 50% of the time in fullscreen and freeze when flipping between fullscreen and window.
Filter graph : I'm using the generic filter graph set up the default for AVI files. CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **)(&m_pGraphBuilder)); I'm primarily using WMV but I've also used the Cinepak Codec with AVIs. I haven't gotten any other decompression filters to work properly either.
I pulled all the code from MSDN to set this up. I create the graph and grab references to several interfaces to track the progress of the video (IMediaControl, IMediaSeeking, and IMediaEventEx). Then I initialize the windowless VMR-9 and inject it into the graph. Then I play the video. Works fine when the game's in a window, but not fullscreen. The sound plays all the time, just the video only shows up 50% of the time. Any suggestions?
Here's the system I'm using: Windows XP, sp2. Visual Studio 2005 professional. Windows SDK 6.0. VMR9 in windowless mode. I'm using VMR9 because I need this to run on both XP and Vista without requiring redist and the game runs using D3D9
modified on Thursday, November 5, 2009 3:03 PM
|
|
|
|
|
hello, is there any way to declare an indexed array in base one on VC++?
thanks.
|
|
|
|
|
AFAIK no.
Either make the array one element bigger and ignore element zero; or subtract one from every index.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
timbk wrote: hello, is there any way to declare an indexed array in base one on VC++?
thanks.
You can even use ten-based array: just remember to subract 10 to the index before using it inside the [] operator...
[added]
Hi, Mr.Univoter. Don't you like 10 -based arrays, do you?
[/added]
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]
modified on Wednesday, November 11, 2009 3:04 AM
|
|
|
|
|
thanks, how can i do to declare a ten based array?
|
|
|
|
|
timbk wrote: thanks, how can i do to declare a ten based array?
Do you understand irony music, Yoko?
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]
|
|
|
|
|
ohh, sorry i'm learning english and VC++, and i don't study " how to understand jokes".
|
|
|
|
|
I'm sorry for you.
C/C++ arrays are zero based.
While there's nothing wrong in liking better one-based arrays, it is wiser remaining stuck with zero-based ones, because:
- You need extra work to make your arrays alive (extra work is generally bad)
- Most people use the opposite convention: that means you have to adapt your data to any time you've to deal with other people code, like libraries, etc..
Neverthless, there are few examples of consistently used one-based arrays, for instance, all "Numerical Recipes" book source code uses it (the authors simply ignore array item 0 ).
Like all 'alien' conventions it's a bit difficult to grasp immediately, but after some experience with, becomes 'natural'.
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]
|
|
|
|
|
As they said, no, but you could write your own 1 based array class in C++ and overload the [] operator and whatever else is necessary to do the index adjustment for you.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
thanks, well i was trying to make the app more easy to follow, because 0 based arrays are not so intuitive, we starts count in one, i think that the easy way is make the array one element bigger but when you have many arrays is a waste of memo, so i would try with your seggest.
|
|
|
|
|
If you search around, you probably can find example code. I think I once saw it as an example in a C++ book.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
timbk wrote: i was trying to make the app more easy to follow, because 0 based arrays are not so intuitive
you will confuse any C/C++ programmer who has to maintain the code, if you start doing things like that.
|
|
|
|