Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here is my code

C
while(nPadval[nNewR][nNewC] != self || nTerminal!= myTerminal )
	{
		nNewR += paraR;
		nNewC += paraC;
		nTerminal += paraT;
	}


and i got error about something like undefined handle.... (tidtable.c)
i dont know that "while" command cannot hold multiple arguments or not

the code above is for my simple board game(othello)

for example:: i am black stone(b) and opponent is white stone(w)


|-----|-----|-----|-----|-----|-----|
|     |     |     |     |     |     |
|-----|-----|-----|-----|-----|-----|
|     |     |  b  | w   |  X  |     |
|-----|-----|-----|-----|-----|-----|
|     |     |  w  | b   |     |     |
|-----|-----|-----|-----|-----|-----|


and i want to put my stone on X
so my code gonna find that from the X's position
where is the nearest 'b' is exist.

sorry if my english confused you
that the backgroud of program

now, i am debuging
hope someone can help me


well....
i got this code after i try to open the program
but when the program complied , no any error was found

C
_ptiddata __cdecl _getptd_noexit (
        void
        )
{
    _ptiddata ptd;
    DWORD   TL_LastError;

    TL_LastError = GetLastError();

    /*
     * Initialize FlsGetValue function pointer in TLS
     */
    __set_flsgetvalue();

    if ( (ptd = FLS_GETVALUE(__flsindex)) == NULL ) {
        /*
         * no per-thread data structure for this thread. try to create
         * one.
         */
        if ((ptd = _calloc_crt(1, sizeof(struct _tiddata))) != NULL) {

            if (FLS_SETVALUE(__flsindex, (LPVOID)ptd) ) {

                /*
                 * Initialize of per-thread data
                 */

                _initptd(ptd,NULL);

                ptd->_tid = GetCurrentThreadId();
                ptd->_thandle = (uintptr_t)(-1);
            }
            else {

                /*
                 * Return NULL to indicate failure
                 */

                _free_crt(ptd);
                ptd = NULL;
            }
        }
    }

    SetLastError(TL_LastError);

    return(ptd);
}
Posted
Updated 31-Dec-09 2:30am
v3

1 solution

wrote:
and i got error about something like undefined handle.... (tidtable.c)


An error that's something LIKE ? If you want help, post the ACTUAL error, and the code it relates to.


wrote:
nNewR += paraR; nNewC += paraC; nTerminal += paraT;


Are these pointers, or variables ? Where do you check to make sure that your code never goes past the bounds of the array you're checking ? That seems like the most likely error to me.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900