Solved

where is wrong? help!

Posted on 2001-08-03
9
257 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
Comment Utility
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
Comment Utility
What error are you getting?
0
 

Author Comment

by:Johncili
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Johncili
Comment Utility
     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
Comment Utility
C++ Error: Cannot convert 'AnsiString' to'char*'??

How to modify?
0
 
LVL 6

Expert Comment

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

Accepted Solution

by:
mnashadka earned 100 total points
Comment Utility
Use Session->AddPassword(secret.c_str());
0
 
LVL 3

Expert Comment

by:null_pointer
Comment Utility
To convert the string to AnsiString you could use the
UnicodeToAnsi  and the
AnsiToUnicode

functions
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

744 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

16 Experts available now in Live!

Get 1:1 Help Now