C code to BCB

  • Thread starter Piotr Turkowski
  • Start date
P

Piotr Turkowski

Hi,
I have wrote some program in C, and now I want to include it in my BCB
project. Here's my problems:

1.) How can I remove some text from a TMemo component (just like key
Del) from a button. It's near to: Tmemo!->CutFromClipboard; and so but,
how to delete text?

2.) How to use scrollbars? How to integrate them with TMemo?, to scroll
the text in TMemo using those scrollbars?

3.) How can I put all my ImageList to a file and read those icons from
ImageLists in my program, so I would have 2 files: program.exe and
icons.dll(or other ext.)?

4.) How can I read Captions to Menu, Context Menu from a file, so I
would have two files: program.exe and language.ini(or other ext)? I want
to have multi-language program.

5.) The most difficult problem now (for me).
I have some text in TMemo, and now I want to encypt it. I have my
encryption function written in ANSI C. How to run my function, so after
it, encrypted text wil be show in Tmemo? How to get a pass as a String
or char* from a TEdit, or TmaskEdit? Where should I put my function
(into which file)?

If you want to, I can send the source code of my program in C and BCB
source.

I have BCB Personal 6.

Thanks in advance.
 
M

Malcolm

Piotr Turkowski said:
I have wrote some program in C, and now I want to include it in
my BCB project. Here's my problems:
Most of this stuff is very platform-specific. You need to ask in an ng that
deals with BCB (whatever that stands for).
5.) The most difficult problem now (for me).
I have some text in TMemo, and now I want to encypt it. I have my >
encryption function written in ANSI C. How to run my function, so > after
it, encrypted text wil be show in Tmemo? How to get a pass
as a String or char* from a TEdit, or TmaskEdit? Where should I
put my function (into which file)?
This is partly relevant to comp.lang.c.

Supose you have a function

void encrypt(char *str)

This can be written in pure ANSI C and thus should be placed in a file with
other portable ANSI C functions.

Now you need to look at your TMemo/Edit functions, and see whether they
store a copy of the string you pass them, or whether they operate on the
string itself.
If they operate on the string itself then at any time you can call encypt()
on the string, force a display update, and the data should appear encrypted.
If they take a local copy of the string, then either you must pass them an
encrypted string as you initilse the object, or you have to tell them in
some way that the text has changed, and make them take a copy of your
encypted string. The details of how you would do this are off-topic here,
however.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top