|
see the Chapters section on the left bar ?
then choose the category that fits you best, and then submit[^] your article to the editors. I advise you to submit by mail because the sumbission wizard is currently deactivated, due to the site's migration...
|
|
|
|
|
Right, because I was having a problem with another site "cppgames.com" and their "submit game" option wasn't working properly. Anyway, the project I'm working on is at the beta stage so I just need feedback and suggestions from players. Well, thanks again. I'll try to do that.
Only fools rush in. Foo!
|
|
|
|
|
be aware that codeproject article is more a place for complete articles (more than articles still in draft), so be aware of it and don't forget to notify it to the readers...
|
|
|
|
|
You can also use the forum colaboration / testing[^] the description is "to search beta testers". And once you have reports, then post the game in an article If you are just searching for freedback for corrections, then use the forum i told you.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
modified on Thursday, December 06, 2007 6:26:18 AM
|
|
|
|
|
you could also try sourceforge.org for this type of stuff
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
From what I understood, he just want to submit a game, and not write an article about it. He just wants some feedback for his game.
|
|
|
|
|
Yup. You're all right. There is this site www.cppgames.com where one can submit a game (whether full version / beta test). Once submitted, it will be saved within the sites database and members may download the game and do as they please. You may either submit the source code or the executable file. In my case, I just need to submit the executable file since my program is a beta version. So, right now I'm just looking for another SUITABLE for the said purpose. Thanks for all your feedback. I'll try out the websites that you recommended and see what's going on there.
|
|
|
|
|
than codeproject is not right place for you as article must accompany with the source code otherwise article will get deleted!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
You can not update the game here in the website, but you can use megaupload or something like and post the link in the collaboration and testing forum[^]. Users will download and test it, and you can get the feedbacks there too.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi all,
I have a byte stream, consisting of two parts. First 4 bytes gives an int value. Rest of the part give just a name. I want to read them separately.
I've tried something like this.
<br />
UINT vBuffer[4];<br />
::memcpy(vBuffer,InMsg.GetDataBuffer(),sizeof(vBuffer));<br />
used memcpy to copy the first 4 bytes to my buffer. Now I have two question. How read the vBuffer and find the value? How to read the rest?
I appreciate your help all the time...
Eranga
|
|
|
|
|
you say the first 4 bytes give an int value, but you don't read 4 bytes, you read 4 UINTs (that means, 16 bytes on a 32 bits system, and 32 bytes on a 64 bits system).
moreover, you're writing into an undefined buffer.
why don't you just do this:
<font color="green">
<font color="blue">unsigned long</font> nSize = 0;
<font color="green">
::memcpy(&nSize, InMsg.GetDataBuffer(), <font color="blue">sizeof</font>(nSize));
then you don't have much complicated task to read the size...
modified on Thursday, December 06, 2007 5:24:09 AM
|
|
|
|
|
Ok, I got the point where I'm going wrong.
I have a question on your code. in memcpy first argument should be the new buffer to copy from the existing buffer. But here nSize is not a buffer at all. Can you clear me on it.
I appreciate your help all the time...
Eranga
|
|
|
|
|
oh god, you're right. i updated my previous answer so that the 4 bytes are written at the memory used by the nSize variable
|
|
|
|
|
How about my second question. I know that after reading the initial 4 bytes of the stream, stream points to the next byte start position. Since the length of the rest vary how can I read as u said. It's string, just a name like "ball, house, etc...."
I appreciate your help all the time...
Eranga
|
|
|
|
|
what about using strncpy() and pass it the integer formerly extracted ?
<font color="green">
nSize = 0;
<font color="green">
::memcpy(&nSize, InMsg.GetDataBuffer(), <font color="blue">sizeof</font>(nSize));
char* pszBuffer = new char[nSize + 1]; <font color="green">
::strncpy(pszBuffer, <font color="green"></font>, nSize);
pszBuffer[nSize] = <font color="gray">'\0'</font>;
std::string strData = pszBuffer;
delete[] pszBuffer;
modified on Thursday, December 06, 2007 5:15:54 AM
|
|
|
|
|
Yep, initially I thought about this. But failed to do it. Because my destination is a string, that is my requirement. But my destination is in a buffer, a byte stream. I want to read it after finding the int value.
toxcct wrote: pass it the integer formerly extracted ?
I'm not clear this.
I appreciate your help all the time...
Eranga
|
|
|
|
|
i don't understand your problem... why can't you use strncpy() ?
you say you want to read it after getting the int value, but isn't it what i'm doing there ?
|
|
|
|
|
No, No.
You take me wrong way. There is no connection between int value and the string. Let me explain it again.
Stream has two parts. First part give an int value. It gives the first 4 bytes of the stream. That is ok.
Second part has a string, few characters. I want to read it as well and find the word there has.
No connection with int value(nSize according to your code) and the string.
Is it clear...
I appreciate your help all the time...
Eranga
|
|
|
|
|
ok, so, the int is not the size of the remaining string. then just extract the string without taking care of nSize. can't you ?
|
|
|
|
|
toxcct wrote: ok, so, the int is not the size of the remaining string.
Yes, that is correct.
toxcct wrote: then just extract the string without taking care of nSize. can't you ?
That's where I'm stuck with. Can give me a help.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: Can give me a help
yes, i can; that's what i'm trying to do. but i need more infos.
1) so, to begin, what have you tried so far to extract the string ?
2) is the string of a constant length ?
3) can you know its length by any method ?
|
|
|
|
|
toxcct wrote: 1) so, to begin, what have you tried so far to extract the string ?
Lots of things I've tried,
<br />
char* varBuffer = new char[(InMsg.GetDataLength() - 4)];<br />
string var_name(&InMsg[3], (InMsg.GetDataLength()-4));<br />
It is better to provide more details. InMsg is in BYTE* to a byte steam. GetDataLength() and GetDataBuffer() are two member functions to get the message and the length. Here in this case my message is included both int value and the string.
toxcct wrote: 2) is the string of a constant length ?
No, string is not in fixed length. Actually contain some small words.
toxcct wrote:
3) can you know its length by any method ?
Yes, string length is less than 4 bytes. (InMsg.GetDataLength()-4)
I appreciate your help all the time...
Eranga
|
|
|
|
|
is the string is nul-terminated ?
also, what is the type of InMsg ???
modified on Thursday, December 06, 2007 8:08:09 AM
|
|
|
|
|
toxcct wrote: is the string is nul-terminated ?
Yes.
toxcct wrote: what is the type of InMsg ???
The type is BYTE*
I appreciate your help all the time...
Eranga
|
|
|
|
|
std::string second_part( (char*)(InMsg+sizof( first_part), InMsg.GetDataLength() - 4))
This calls the constructor of std::string with the address of the first char of the string (InMsg is of type BYTE* ? So you need to cast it to char* ) and the length of the remaining buffer.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|