Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting from wchar_t* to char* Pin
Jörgen Sigvardsson28-Jan-06 6:34
Jörgen Sigvardsson28-Jan-06 6:34 
GeneralRe: Converting from wchar_t* to char* Pin
Allad28-Jan-06 11:41
Allad28-Jan-06 11:41 
AnswerRe: Converting from wchar_t* to char* Pin
Stephen Hewitt28-Jan-06 1:15
Stephen Hewitt28-Jan-06 1:15 
GeneralRe: Converting from wchar_t* to char* Pin
Allad28-Jan-06 11:33
Allad28-Jan-06 11:33 
GeneralRe: Converting from wchar_t* to char* Pin
Stephen Hewitt28-Jan-06 18:12
Stephen Hewitt28-Jan-06 18:12 
GeneralRe: Converting from wchar_t* to char* Pin
Allad28-Jan-06 18:23
Allad28-Jan-06 18:23 
GeneralRe: Converting from wchar_t* to char* Pin
Stephen Hewitt28-Jan-06 18:35
Stephen Hewitt28-Jan-06 18:35 
QuestionMoving the hole Pin
eivanlo27-Jan-06 7:20
eivanlo27-Jan-06 7:20 
Like a puzzle game, how can I swap the 'hole' with the 'target element'? I use 'switch' and 'pointer' but failed!! Pls advise!!

//Moving the hole.

void Move(int& holeidx,int move)
{
int tar_row; //The row of the target element
int tar_col; //The column of the target element
int hrow; //The row of the hole
int hcol; //The column of the hole
int temp=0; //A temporary variable for swapping
int number; //The index number of the target element

hrow = holeidx / size; //Calculate the row number of the hole
hcol = holeidx % size; //Calculate the column number of the hole

int* phole = 0; //The pointer of the hole

switch(move)
{

case 49: //(Press 1)
phole = &holeidx;
tar_row = ++hrow;
tar_col = --hcol;
break;

case 50: //(Press 2)
phole = &holeidx;
tar_row = ++hrow;
tar_col = hcol;
break;

case 51: //(Press 3)
phole = &holeidx;
tar_row = ++hrow;
tar_col = ++hcol;
break;

case 52: //(Press 4)
phole = &holeidx;
tar_row = hrow;
tar_col = --hcol;

break;

case 53: //(Press 5)
phole = &holeidx;
tar_row = hrow;
tar_col = hcol;
break;

case 54: //(Press 6)
phole = &holeidx;
tar_row = hrow;
tar_col = ++hcol;
break;

case 55: //(Press 7)
phole = &holeidx;
tar_row = --hrow;
tar_col = --hcol;
break;

case 56: //(Press 8)
phole = &holeidx;
tar_row = --hrow;
tar_col = hcol;
break;

case 57: //(Press 9)
phole = &holeidx;
tar_row = --hrow;
tar_col = ++hcol;
break;

case 113: //(Press q)
case 81: //(Press Q)
exit(1); //If Press Q to quit, exit the game directly.
break;
default:
break;
}
AnswerRe: Moving the hole Pin
Bob Ciora27-Jan-06 12:03
Bob Ciora27-Jan-06 12:03 
QuestionHow do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster27-Jan-06 7:12
Swinefeaster27-Jan-06 7:12 
AnswerRe: How do you get Vc6 apps to look themed in Vc8? Pin
Jack Puppy27-Jan-06 8:37
Jack Puppy27-Jan-06 8:37 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster27-Jan-06 10:44
Swinefeaster27-Jan-06 10:44 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Jack Puppy27-Jan-06 13:25
Jack Puppy27-Jan-06 13:25 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Prakash Nadar27-Jan-06 22:37
Prakash Nadar27-Jan-06 22:37 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster3-Feb-06 8:10
Swinefeaster3-Feb-06 8:10 
QuestionHow to find total memory a process is using? Pin
sysop@HAL9K.com27-Jan-06 5:27
sysop@HAL9K.com27-Jan-06 5:27 
AnswerRe: How to find total memory a process is using? Pin
Toby Opferman27-Jan-06 7:20
Toby Opferman27-Jan-06 7:20 
GeneralRe: How to find total memory a process is using? Pin
Toby Opferman27-Jan-06 7:39
Toby Opferman27-Jan-06 7:39 
AnswerRe: How to find total memory a process is using? Pin
sysop@HAL9K.com27-Jan-06 9:24
sysop@HAL9K.com27-Jan-06 9:24 
AnswerRe: How to find total memory a process is using? Pin
David Crow27-Jan-06 9:39
David Crow27-Jan-06 9:39 
Question"choose color" combobox Pin
xyhan27-Jan-06 5:24
xyhan27-Jan-06 5:24 
AnswerRe: "choose color" combobox Pin
Graham Bradshaw27-Jan-06 5:36
Graham Bradshaw27-Jan-06 5:36 
AnswerRe: "choose color" combobox Pin
David Crow27-Jan-06 9:41
David Crow27-Jan-06 9:41 
Questionhttp://www.codeproject.com/listctrl/liwne.asp Pin
hanno2527-Jan-06 4:48
hanno2527-Jan-06 4:48 
AnswerRe: http://www.codeproject.com/listctrl/liwne.asp Pin
benjymous27-Jan-06 5:41
benjymous27-Jan-06 5:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.