|
why small ball jump, background bmp jump too?
I write the code.
I want to ball jump, backgroud bmp do not jump?
Has the solution?
thanks.
source code:
http://ComAndATL.googlepages.com/Game.part1.rar
http://ComAndATL.googlepages.com/Game.part2.rar
If you solution, may the code which solution send my email zhmster@gmail.com.
very very thanks you !
alantop
-- modified at 15:34 Sunday 7th May, 2006
|
|
|
|
|
update!
alantop
-- modified at 4:58 Monday 8th May, 2006
|
|
|
|
|
I need to convert an unsigned int to a char*.How can I do it??
Thanks in advance!!
|
|
|
|
|
#include <stdlib.h>
#include <stdio.h>
void main()
{
unsigned int i = 123;
char p[100];
itoa(i, p, 10);
printf("%s\n", p);
}
alantop
|
|
|
|
|
alan top :
<br />
void main()<br />
{<br />
unsigned int i = 123;<br />
char p[100];<br />
<br />
itoa(i, p, 10);<br />
printf("%s\n", p);<br />
}<br />
-----------and-----------------
unsigned int a=100;
char *buffer;
buffer=(char*)LocalAlloc(LPTR,20);
itoa(a,buffer,10);
unsigned int c;
c=atoi(buffer);
LocalFree(buffer);
|
|
|
|
|
Here is another way to do this
unsigned int i=100;
char p[10];
sprintf(p,"%u",i);
cout<<p;
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
You can Also use Reinterpret_cast
Thanks & Regards
Banks
|
|
|
|
|
I create a client socket class that derived from CAsyncSocket, it connects to server ok. When server disconnects then nothing wrong, but when client side closed the connection then it's got a problem: sockcore line 482 (and 442), those lines are:
ASSERT(CAsyncSocket::LookupHandle(hSocket, bDead) != NULL);(line 482)
ASSERT(CAsyncSocket::LookupHandle(hSocket, bDead) != NULL);(line 442)
Can any one tell me why it happen and how to handle it?
Just a newbie
-- modified at 14:11 Sunday 7th May, 2006
|
|
|
|
|
XStress wrote: Can any one tell me why it happen
When one side of a socket connection is closed the remote stack is notified and the state of the socket handle is updated. So "if" the other side calls close the handle is not in a valid state to be closed.
XStress wrote: how to handle it?
That is up to you to determine based on the applications use model. One option is to use AsyncSelect[^] to be notified when the other socket closes the connection.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
It's not really close to my problem. In my situation, after client successfully connect to server, call Close() function will make the program crash. It's strange because it doesn't happen in server side and in other example i saw.
If problem is remote stack then when client close, the side that encounter problem is server side right??
Just a newbie
|
|
|
|
|
XStress wrote: It's not really close to my problem.
Sorry. I misunderstood the first post.
It does seem however that your client side socket is not in a connected state when you are trying to close it. Or the MFC Thread Local Storage does not contain information for that Socket. That is why the assert is firing. Based on what you posted there is no way to determine why. That assert is letting you know that the MFC collection of opened or in their language, "Not Dead", sockets does not contain the socket handle you are attempting to close.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
I wrote some code using Visual Studio.net with MFC and it is easy to add stuff to the dialog box. But, I can't remove anything like an edit box etc. when there was an associated var name in the code. I get run time errors or if bad enough, I get severe compile errors. I tried doing it with just one litle window and I get runtime errors. How in the world do you remove something you do not want anymore. I removed everything that was associated with it I thought. When I removed from the resource.h file, thank god I had backed it up. I had to abort and reload the original code, it was so screwed up.
Help would be greatly appreciated.
Dan Martin
|
|
|
|
|
dzldan wrote: I can't remove anything like an edit box etc.
By selecting the text in the code, and [DELETE].
dzldan wrote: I get run time errors
This is because you only deleted the control(s) on the dialog editor, but not the C++ code in the source.
Checklist:
1) To delete the data members in the class definition.
2) To delete some related DDX_ ... in the implementation of DoDataExchange(). <-- Runtime error usually happens in this function.
3) To delete some related message handlers which you created by double-clicking on the controls on the dialog editor.
4) ...
dzldan wrote: I get severe compile errors.
Each compilation error message stands for its meaning. Check those listed above.
Maxwell Chen
|
|
|
|
|
Thanks for responding so quickly. I guess the problem really is that running in release dir is ok, but running in debug if I take things out causes debug assertion errors. Any idea how to get rid of that. I did a clean and rebuild but I get this winocc.cpp line 247 error.
|
|
|
|
|
dzldan wrote: how to get rid of that.
Not "get rid of that" but check your code by debugging to find out what happened before "WinOcc.cpp" line 247 had been executed.
Maxwell Chen
|
|
|
|
|
No idea which guy voted my reply down , but:
1) The information from the original post wan't too much. He did not quote the last line in his code (not "winocc.cpp") before the fired assertion.
Let's assume he hasn't know what the action 'debugging' is.
2) Once an assertion is fired, VC++ prompts for [Debug], [Continue], or [Abort]. Then the original poster should click that [Debug] button to back-trace the cause when he has read that bold words "debugging" and "before" in my previous reply.
Maxwell Chen
|
|
|
|
|
How can I get the ip that visiting my sharefolder
which api will be helpful?
thanks.
|
|
|
|
|
|
|
Hello
Did you know any graphic library (with C++ support) including some functions/methods which allow you to grab a single/multiple frame/frames from vide movie (avi or mpeg for ex.) and then save it as a bitpam or jpeg image??
Did you know any graphic library (with C++ support) including some functions/methods which allow you doing some operations & transofmations on images (bitmaps for ex.) like filtering of motion detection???
I'have heard that such funcions do exist for ex. directly in MS DirectX librarys (components) but i i hardly know abot it.
|
|
|
|
|
see MS's DirectShow for frame capture.
there are dozens of graphics libraries out there that can do transformations and filtering (for example, see the one at the bottom of my post - or see the ones available on CodeProject)
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
code
//---------------------
class One
{
public:
int i0;
};
class Four
{
public:
One ones[4];
int iNum;
};
Four four;
One & o = four[0];
//---------------------
last line above is an error.
I think the error can be solved by define a suitable operator in class Four.
any idea?
.
-- modified at 4:13 Sunday 7th May, 2006
|
|
|
|
|
includeh10 wrote:
One & o = four[0];
what about
One & o = four.ones[0];
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
is syntax the same as solution?
|
|
|
|
|
class Four
{
public:
One ones[4];
int iNum;
One& operator[](int nIndex)
{
return ones[nIndex];
}
};
|
|
|
|