Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Restart system Pin
Rajesh R Subramanian25-Feb-08 21:24
professionalRajesh R Subramanian25-Feb-08 21:24 
GeneralRe: Restart system Pin
CPallini25-Feb-08 21:40
mveCPallini25-Feb-08 21:40 
GeneralRe: Restart system Pin
Rajkumar R25-Feb-08 21:46
Rajkumar R25-Feb-08 21:46 
Generalcreate a new process in c Pin
prasadbuddhika25-Feb-08 19:08
prasadbuddhika25-Feb-08 19:08 
GeneralRe: create a new process in c Pin
Maxwell Chen25-Feb-08 19:10
Maxwell Chen25-Feb-08 19:10 
GeneralRe: create a new process in c Pin
Hamid_RT25-Feb-08 19:24
Hamid_RT25-Feb-08 19:24 
GeneralRe: create a new process in c Pin
Xing Chen25-Feb-08 19:50
Xing Chen25-Feb-08 19:50 
GeneralUsing __toascii() got me a runtime access violation Pin
glyfyx25-Feb-08 18:52
glyfyx25-Feb-08 18:52 
I'm very rusty - haven't coded C/C++ since 1994 - and I'm sure there's a simple answer, but I can't find it.

I'm not using 'string' support. Just the old char* methods, and the code is behaving well except when I tried to convert a keyboard virtual key code to a it's ascii character I got a runtime access violation.

The 'break' option showed me the site of the infraction - inside some MS code located in the midst of some UNICODE related logic, judging by the Defines.

I included <ctype.h>, but it didn't help.

The related trimmed code follows:

char c;
c = (char)__toascii(keyCode);
keyCode = p->vkCode;

The offending later statement is:

nLen = fprintf(fOut,"kcK=%d ud=%s kc=%d sh=%d ti=%d %s\n",cb.kcK,updn,keyCode,Shift,tick, c);

The following statement works perfectly (as above, but no c at the end)

nLen = fprintf(fOut,"kcK=%d ud=%s kc=%d sh=%d ti=%d %s\n",cb.kcK,updn,keyCode,Shift,tick);

Searched the articles and FAQ but didn't find anything.
Hope you can give me a hand here.

BTW, I want to stay in the char* arena rather than strings, for now.

I'm using Visual C++ 2003 and running Win2K SP4

One more thing - I'm logged in under my old email glyfyx@storm.ca but I have a new address, glyfix@storm.ca. I guess I should change it at Code Project?

Thanks
glyfyx
GeneralRe: Using __toascii() got me a runtime access violation Pin
Maxwell Chen25-Feb-08 19:03
Maxwell Chen25-Feb-08 19:03 
GeneralRe: Using __toascii() got me a runtime access violation Pin
Mark Salsbery25-Feb-08 19:17
Mark Salsbery25-Feb-08 19:17 
GeneralRe: Using __toascii() got me a runtime access violation Pin
Maxwell Chen25-Feb-08 19:46
Maxwell Chen25-Feb-08 19:46 
GeneralRe: Using __toascii() got me a runtime access violation Pin
Mark Salsbery26-Feb-08 5:16
Mark Salsbery26-Feb-08 5:16 
GeneralRe: Using __toascii() got me a runtime access violation Pin
glyfyx27-Feb-08 3:03
glyfyx27-Feb-08 3:03 
GeneralRe: Using __toascii() got me a runtime access violation Pin
Rajkumar R25-Feb-08 19:10
Rajkumar R25-Feb-08 19:10 
GeneralRe: Using __toascii() got me a runtime access violation Pin
Mark Salsbery25-Feb-08 19:12
Mark Salsbery25-Feb-08 19:12 
GeneralWithout Installing How to MatLab run when VC++ Button Pressed... Pin
johnalek25-Feb-08 18:42
johnalek25-Feb-08 18:42 
QuestionHow to Configure the Matlab Add-in for Visual Studio vc++ 6.0 Pin
johnalek25-Feb-08 18:36
johnalek25-Feb-08 18:36 
GeneralUnlocking a file.. Pin
sharanu25-Feb-08 17:44
sharanu25-Feb-08 17:44 
AnswerRe: Unlocking a file.. Pin
Rajkumar R25-Feb-08 17:58
Rajkumar R25-Feb-08 17:58 
GeneralRe: Unlocking a file.. Pin
sharanu25-Feb-08 19:04
sharanu25-Feb-08 19:04 
AnswerRe: Unlocking a file.. Pin
Rajkumar R25-Feb-08 20:31
Rajkumar R25-Feb-08 20:31 
GeneralRe: Unlocking a file.. Pin
sharanu25-Feb-08 20:48
sharanu25-Feb-08 20:48 
AnswerRe: Unlocking a file.. Pin
Rajkumar R25-Feb-08 21:42
Rajkumar R25-Feb-08 21:42 
QuestionHow to change the background color of AfxControlBar*, CToolBar's parent window ? Pin
Paresh Chitte25-Feb-08 17:22
Paresh Chitte25-Feb-08 17:22 
GeneralRe: How to change the background color of AfxControlBar*, CToolBar's parent window ? Pin
SandipG 27-Feb-08 22:46
SandipG 27-Feb-08 22:46 

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.