Click here to Skip to main content
15,923,789 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionImage enhancment Pin
Deepu Antony11-Oct-07 9:05
Deepu Antony11-Oct-07 9:05 
AnswerRe: Image enhancment Pin
led mike11-Oct-07 9:42
led mike11-Oct-07 9:42 
QuestionTemplate related error for non-template code? Pin
Franz Klein11-Oct-07 8:36
Franz Klein11-Oct-07 8:36 
AnswerRe: Template related error for non-template code? Pin
led mike11-Oct-07 8:58
led mike11-Oct-07 8:58 
AnswerRe: Template related error for non-template code? Pin
Nemanja Trifunovic11-Oct-07 8:59
Nemanja Trifunovic11-Oct-07 8:59 
AnswerRe: Template related error for non-template code? Pin
Stephen Hewitt11-Oct-07 17:52
Stephen Hewitt11-Oct-07 17:52 
QuestionIntegrate Borland Visibroker into VS 2005 Pin
Andy20211-Oct-07 6:38
Andy20211-Oct-07 6:38 
Questioncannot convert parameter 1 from 'char' to 'const char *' Pin
sntnknd11-Oct-07 6:26
sntnknd11-Oct-07 6:26 
Dear Experts,

I am stuck up with a piece of code, which I am not able to break. Could you kindly help me out.

Situation:
I am trying to perform a string comparison between 2 variables, one defined as const TCHAR * and other defined as CS_CHAR, inside an Embedded SQL program in C++. My relevant code snippet is as below:

=====
short CSQLBox::fnTest(const TCHAR *varInput)<br />
{<br />
  CS_CHAR szExtract;<br />
  <br />
  //szExtract variable is populated by Embedded SQL query<br />
  ....<br />
<br />
  //Do string comparison<br />
  if(strcmp(szExtract, varInput)==0)<br />
  {<br />
    ...<br />
  }<br />
}

=====

When I try to compile this code, the strcmp step is throwing an error "cannot convert parameter 1 from 'char' to 'const char *'".

I have tried typecasting parameter 1 as:
if(strcmp((const char*)szExtract, varInput)==0)

This way, the code compiles, but fails in runtime with unhandled exception error. I am unable to understand how to solve this issue.

Could anyone kindly offer me some suggestions.

cheers,
sanK
AnswerRe: cannot convert parameter 1 from 'char' to 'const char *' Pin
led mike11-Oct-07 6:36
led mike11-Oct-07 6:36 
AnswerRe: cannot convert parameter 1 from 'char' to 'const char *' Pin
David Crow11-Oct-07 7:24
David Crow11-Oct-07 7:24 
GeneralRe: cannot convert parameter 1 from 'char' to 'const char *' Pin
sntnknd11-Oct-07 22:36
sntnknd11-Oct-07 22:36 
GeneralRe: cannot convert parameter 1 from 'char' to 'const char *' Pin
David Crow12-Oct-07 2:44
David Crow12-Oct-07 2:44 
QuestionMerging (Linking) two static library Pin
Hirakawa11-Oct-07 4:54
Hirakawa11-Oct-07 4:54 
AnswerRe: Merging (Linking) two static library Pin
jhwurmbach11-Oct-07 5:50
jhwurmbach11-Oct-07 5:50 
GeneralRe: Merging (Linking) two static library [modified] Pin
Hirakawa11-Oct-07 8:06
Hirakawa11-Oct-07 8:06 
AnswerRe: Merging (Linking) two static library Pin
Cedric Moonen11-Oct-07 7:27
Cedric Moonen11-Oct-07 7:27 
GeneralRe: Merging (Linking) two static library Pin
Hirakawa11-Oct-07 8:08
Hirakawa11-Oct-07 8:08 
GeneralRe: Merging (Linking) two static library Pin
Cedric Moonen11-Oct-07 9:43
Cedric Moonen11-Oct-07 9:43 
GeneralRe: Merging (Linking) two static library Pin
Hirakawa11-Oct-07 20:54
Hirakawa11-Oct-07 20:54 
QuestionPrint a bitmap at a specified X-Y position Pin
ShilpaPotnis11-Oct-07 4:05
ShilpaPotnis11-Oct-07 4:05 
QuestionRe: Print a bitmap at a specified X-Y position Pin
David Crow11-Oct-07 4:19
David Crow11-Oct-07 4:19 
AnswerRe: Print a bitmap at a specified X-Y position Pin
ShilpaPotnis11-Oct-07 4:30
ShilpaPotnis11-Oct-07 4:30 
AnswerRe: Print a bitmap at a specified X-Y position Pin
chandu00411-Oct-07 5:04
chandu00411-Oct-07 5:04 
GeneralRe: Print a bitmap at a specified X-Y position Pin
ShilpaPotnis11-Oct-07 5:49
ShilpaPotnis11-Oct-07 5:49 
GeneralRe: Print a bitmap at a specified X-Y position Pin
chandu00411-Oct-07 7:21
chandu00411-Oct-07 7:21 

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.