Solved

Lvalue Required borland C++ builder

Posted on 2006-07-02
1
1,622 Views
Last Modified: 2013-11-17
sorry if i am unclear... i don't have much experience in C++, maybe 8 months, really don't know much about classes.
what i am trying to do.. .is get the text from a EditBox when i push a button(lets call it button1) and store it in a variable.

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TEnterHandleForm *EnterHandleForm;
//---------------------------------------------------------------------------
__fastcall TEnterHandleForm::TEnterHandleForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TEnterHandleForm::Button1Click(TObject *Sender)
{
 // below is the code, the error is now telling me "Lvalue required"
/*   not sure if it matters, but when i click on the "EditBox" it takes me to the function for the edit box (so i can code it)
but if there's no code (hence i didn't code anything in the edit box) the function just dissapears.
*/
  char buffer[40];
  buffer[0] = '\0';
  buffer = EditBoxForPersonsHandle->Text.c_str();

}
0
Comment
Question by:crims
1 Comment
 
LVL 11

Accepted Solution

by:
Jase-Coder earned 125 total points
ID: 17029166
you must do one of the following

strcpy(buffer, EditBoxForPersonsHandle->Text.c_str());

of declare buffer as AnsiString and then do the following:

Buffer = EditBoxForPersonsHandle->Text;
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

713 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