|
Yes,I spinned in a loop on a thread to retrieve data packages from network.But I have no choice.(client).
In the timer,I capture a video frame and send it each second.
|
|
|
|
|
In that loop, are you using sockets? If so, are you using a blocking socket that blocks until
data is received? If not then that will use nearly all your CPU.
For the timer, that's one frame per second? Interval is 1000 milliseconds, right? If so, then
that takes about zero CPU
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In the loop, I think it uses none-blocking socket.In fact,I use a RTP socket to do such thing.(JRTPlib.lib,I think you do know it).
I am sorry,for timer,I capture a video fram and send it each 200 millisecond.
|
|
|
|
|
The thread with the communication loop would be much more efficient if it was event driven.
If it's just spinning, it's spending most of its CPU cycles doing nothing.
You may want to look into using WSAEventSelect() and waiting on an event indicating there's data
available to be read on the socket.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I think you do know jrtplib,it doesn't give a event handle,so I could not using such way.
|
|
|
|
|
kcynic wrote: I think you do know jrtplib
Actually I've never heard of it but I'll take a look at it.
Without seeing your code I can't imagine where to start, but I still suspect the problem would be
in the communication loop. Your 200ms timer shouldn't be the problem unless you're doing an
extraordinary amount of stuff each interval.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi
with the following declarations:
void* __cdecl operator new(size_t nSize, LPCSTR lpszFileName, int nLine);
void __cdecl operator delete(void* pData, LPCSTR lpszFileName, int nLine);
void __cdecl operator delete(void* pData);
in the following code:
char *p=new char[10], *q=new char;
delete[] p;
delete p;
the second version of operator delete (with only one argument) is called while the new operator declared with three arguments had been called.
why?
|
|
|
|
|
Dear all
how to build a cylinder using vc++ 6.0 or with OpenGL together? any one has such snippet, thanks a lot. too urgent!!!!!!! my email is lizhiyuan16@hotmail.com. need your help..
Li Zhiyuan
21/07/2007
|
|
|
|
|
What exactly is C runtime library, and what role does it play in loading a windows exe into the OS's memory ?
Vipin.
|
|
|
|
|
That's a biggy. The C runtime library is a bunch of code that extends C++ to allow you do do useful basic things like write to the console, allocate memory, format strings, get locale information, declare thread local variables, use excecptions, spawn other proceses, initialize static variables, access the command line passed to your program etc etc.
You either use it by linking dynamically to MSVCRT.dll in one of its incarnations or link in the code directly by linking to LIBC.lib or one of its variants. The reason for the various versions is different ones for Debug and Release and in the past different ones for single or multi threaded application.
Strictly speaking the C runtime is not involved in loading a windows exe but it does do a bunch of stuff, some mentioned above, in your exe before your code is actually called so it kind of looks like it's involved in loading. By the time your program hits WinMain or main it has probably run several hundred to several thousand lines of CRT code.
The thing that loads your exe is the PE (Portable Executable) Loader which lives somewhere in the Kernel (probably NTDll.dll these days). Once it has done its magic, setting up a process and related memory space for you and loading in your code it calls an entry point function which is a function with a well known siganture at a specific offset in the compiled code (The offset is stored in the PE header on the exe file ) If you use the CRT then that entry point will be something like mainCRTStartup depending in CONSOLE or GUI app type and UNICODE or ANSI build. The source of the CRT is on your system, if you chose to install it when you installed Visual Studio, and is worth a look. It's a big mess but a very educational big mess. Enjoy
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I want to set forecolor of each item in listview control(repoort view) hwow to do that?
|
|
|
|
|
|
thanks 4 ur rply,
bt i want to change the forecolor of one or two items(detail view) not the entire items.
item priority
-------------------
item1 low
item2 high
item3 normal
item4 high
item5 low
i want to set forecolor of item2 nd item4 to red which has high priority.
-- modified at 5:12 Saturday 21st July, 2007
|
|
|
|
|
|
If you derived CListView and use of cusom message you can do it.
|
|
|
|
|
Hi peeps, i'm hoping i'm in the right place to find the help i need.
In a nutshell, i'm trying to find & fix a bug in the PS2 game "Madden NFL 07". The problem has to do with merging the results of spawned games played online back to a franchise file. I'm always receiving a "merge error" message somewhere between weeks 2 and 4. When I contactd EA's Tech Support, they told me the following:
"Thanks for writing us at EA Technical Support. I understand that you are currently having issues with merging spawned game results in Madden NFL 2007. I apologize for your situation, and the inconvenience that this causes you. Unfortunately, there is a maximum amount of minutes that you can spawn in a season. If you play more than 720 minutes worth of spawn games in a single season you will get an error when you attempt to import the game. The only thing to do would be to set the quarter length of the franchise games shorter so that you can play more spawn games."
what i want to do is change that value to 7,200 minutes but i'm not a programmer or anything like that. I am able to get the file from my PlayStation to my PC with a flash drive so i have the file. I donwloaded a Hex Editor but it looks all greek to me. Any ideas what I can do/use to accomplish this?
|
|
|
|
|
I'm sorry, you're living in a dream world. You don't have the source code, which means you're looking at code that the majority of people who ARE programmers could not make sense of. The odds of you achieving this are zero.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Well, 720 is 2D0 hex, or in code the byte order will probably be reversed: 00 2D. If you have a dissassembler then you could just search for a JE 2D0, ( or whatever the instruction for 'jump if equal' or 'jump if greater' is - just look for 2D0 as an operand somewhere) and change 720 to whatever you want and try it and see what happens. You might get lucky.
Presumably someone could do better than this, but no one bothered.
Don't know what Christian Graus, the "Microsoft MVP" was talking about. A microsoft binary will be loaded with tons of symbolic info, basically all the SDK calls the program is making, which you can redirect wherever you want.
----------------
Basically, its a matter of downloading a dissasembler for the processor. Then, understanding the assembly instructions. It may be that a buffer has to be reallocated to a larger size as well. I'm sure you couldn't just change a value from 720 to 7200000 and expect memory to be there for it to write to. But 720 to 1000, maybe. This is all off the top of my head.
-- modified at 8:23 Saturday 21st July, 2007
|
|
|
|
|
Ah ok... i think i understand what you're saying. Yea no idea what Chris meant cuz there is a group that will do a "reset to zero" (as they call it) at simsportsnet.com but they charge like $20 a pop and the reset they do needs to be done 4 or 5 times throughout a season in the game.
Very cool though, I'll follow up on what you recommended and keep you up to date on how i do.
Thank you very much!
|
|
|
|
|
Hi,
I am wondering how one can combine two source codes together to make them work togehter.
Here is my scenario, I have written a program that takes in data from Serial port and stores it into a variable, a second program that compares the data with MySQL database and outputs matching fields.
Right now they run separately, how do I make them work together?
Thanks in Advance
|
|
|
|
|
Copy the code from the smaller project into the larger one, and work out how to get your entry point to execute both.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hire a programmer to do it for you.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
hi,
i have a MFC Explorer style application with doc/view architecture....
is it possible to delete (free or release) current left and right views
and recreate them at a particular instant (e.g. when a button is clicked.)?
|
|
|
|
|
Lets imagine that you can.... why would you want to?
|
|
|
|
|
To increase usability. I once had an MFC app that ran on an 80 MHz CE 2.11 device. It had about 30 CView -based classes and would take an unreasonable number of seconds to launch. So instead of creating all of the views at initialization, I created and destroyed views as the user navigated through the program.
|
|
|
|