Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

where is wrong? help!

Posted on 2001-08-03
9
267 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

860 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