Link to home
Start Free TrialLog in
Avatar of Johncili
Johncili

asked on

where is wrong? help!


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

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

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.

What error are you getting?
Avatar of Johncili

ASKER

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.
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.
     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"); ????
C++ Error: Cannot convert 'AnsiString' to'char*'??

How to modify?
I'm not familiar with AnsiString.
Try
Session->AddPassword((char *)secret)
ASKER CERTIFIED SOLUTION
Avatar of mnashadka
mnashadka

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To convert the string to AnsiString you could use the
UnicodeToAnsi  and the
AnsiToUnicode

functions