Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

where is wrong? help!

Posted on 2001-08-03
9
Medium Priority
?
273 Views
Last Modified: 2008-03-06

AnsiString secret=InputBox("Veri.","password","Default");

if (Session->AddPassword(secret)==false)
  {ShowMessage("Can not open the file");
   Application->Terminate();}
  else{
  return;//continue
);
0
Comment
Question by:Johncili
9 Comments
 
LVL 3

Expert Comment

by:kulina
ID: 6349165
AnsiString secret=InputBox("Veri.","password","Default");

if (Session->AddPassword(secret)==false)
 {ShowMessage("Can not open the file");
  Application->Terminate();}
 else{
 return;//continue
);  <- change ');' to '}' (without quotes of course)

Rgds.

0
 
LVL 2

Expert Comment

by:smitty1276
ID: 6349439
What error are you getting?
0
 

Author Comment

by:Johncili
ID: 6349583
AnsiString secret=InputBox("Veri.","password","Default");

if (Session->AddPassword(secret)==false)  <<======= ???
{ShowMessage("Can not open the file");
 Application->Terminate();}
else{
return;//continue
}

Can not run. See where ??? shows.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:Triskelion
ID: 6349616
Please compile this in DEBUG mode and trace through the steps.

When the program fails, copy the error message and paste it here.

If the program will not compile, please copy the error message you get from the compiler and paste it here so we can see it.
0
 

Author Comment

by:Johncili
ID: 6349788
     Char *buf1 = "aaa", *buf2;int ptr;
      buf2=InputBox("Veri.","password","Default");
      ptr = strcmp(buf2, buf1);
         if (ptr >0 || ptr <0)
           {ShowMessage("Wrong! ");
            Application->Terminate();}
         else {};

  buf2=InputBox("Veri.","password","Default"); ????
0
 

Author Comment

by:Johncili
ID: 6349793
C++ Error: Cannot convert 'AnsiString' to'char*'??

How to modify?
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 6349851
I'm not familiar with AnsiString.
Try
Session->AddPassword((char *)secret)
0
 
LVL 8

Accepted Solution

by:
mnashadka earned 200 total points
ID: 6350458
Use Session->AddPassword(secret.c_str());
0
 
LVL 3

Expert Comment

by:null_pointer
ID: 6354125
To convert the string to AnsiString you could use the
UnicodeToAnsi  and the
AnsiToUnicode

functions
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question