Solved

where is wrong? help!

Posted on 2001-08-03
9
265 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now