51

(10 replies, posted in General)

Hello MVD

Here I want to post this example of a minimalist UI interface that are in use these days.  Although we program desktop applications, is not bad to use this to mimic a web interface in our projects. I leave you this free template, use it, modify it, add new ideas, improve it, make the script better ( I did my best to have it simple but someone with more experience maybe can tighten the code a bit more and make it more efficient).  Hope you enjoy it and let me know what you think.

Thanks!!

DriveSoft wrote:

Hello.


procedure Form1_Memo1_OnDropFiles (Sender: TObject; ArrayOfFiles: array of string; X, Y: Integer);
var
    i, c: integer;
    Size: Int64;
begin
    Size := 0;
    c := Length(ArrayOfFiles)-1;
    for i := 0 to c do
    begin
        Size := Size + GetFileSize(ArrayOfFiles[i]);
        Form1.Memo1.Lines.Add(ArrayOfFiles[i]);
    end;
    Form1.Label1.Caption := IntToStr(Size);
end;

Excellent!  as always, thanks Dmitry!

Hi, I'd like to display on a label the sum of the archives sizes as they are being dropped on a memo field, using the
OnDropFiles procedure of the memo component.  Please provide script if possible.

Thanks!

54

(2 replies, posted in General)

gonpublic2k wrote:

Excellent. For this component Dmitry, could you provide a sample of the use of it? I'd like to see how this
can be implemented in a program.

procedure Form1_Memo1_OnDropFiles (Sender: TObject; ArrayOfFiles: array of string; X, Y: Integer);
var
    i, c: integer;
begin
    c := Length(ArrayOfFiles)-1;
    for i := 0 to c do
    begin
        Form1.Memo1.Lines.Add(ArrayOfFiles[i]);
    end;
end;

If it's not too much to ask, thanks!!


Never mind... I figured it out.  Works great Dmitry!  Good additon.

55

(2 replies, posted in General)

Excellent. For this component Dmitry, could you provide a sample of the use of it? I'd like to see how this
can be implemented in a program.

procedure Form1_Memo1_OnDropFiles (Sender: TObject; ArrayOfFiles: array of string; X, Y: Integer);
var
    i, c: integer;
begin
    c := Length(ArrayOfFiles)-1;
    for i := 0 to c do
    begin
        Form1.Memo1.Lines.Add(ArrayOfFiles[i]);
    end;
end;

If it's not too much to ask, thanks!!

DriveSoft wrote:

Hello.


OnSQLException works only with database errors.



Please download latest beta version
https://www.dropbox.com/s/53bhjcbbu6jr3 … a.zip?dl=0


How to replace error message


    try
    if SendMail(Form1.edServer.Text, Form1.edUsername.Text, Form1.edPassword.Text, Trunc(Form1.edPort.Value), Form1.edFrom.Text, Form1.edTo.Text, Form1.edSubject.Text, Form1.mmMessage.Text, Form1.edFileName.Text) then
        ShowMessage('Message sent');
    except
        if Pos('read timed out error', ExceptionMessage)>0 then ShowMessage('Your own message') else ShowMessage(ExceptionMessage);
    end;

Thank you Dmitry!!

Hello MVD,

I'd like to replace the following error with my own Message, it happens when you use the SendMail function
and it takes too long to resolve.  The e-mails actuallly are sent after a little delay but this read timed out error
shows up.  I'd like to replace that message with my own to le the user know that the e-mail will still be sent
out.  Thanks! 

P.S. I tried using the function below to adapt it but could not work it out:

// global event for all exceptions related database
function OnSQLException(Sender: TObject; Msg: string; SQL: string): boolean;
begin
    // exception from button Form1.Button6
    if Sender = Form1.Button6 then
    begin
        if Pos('FOREIGN KEY constraint failed', Msg)=1 then
        begin
            result := True; // to prevent system message
            MessageBox('Selected record contains...', 'Error', MB_OK+MB_ICONWARNING);
        end;
    end;
end;[img]

[/img]

58

(6 replies, posted in Script)

ehwagner wrote:

Ok I understand now. See attached and see if that can work for you.

Excellent @ehwaganer!  you  are the man!  That works out pretty well. kudos!

59

(6 replies, posted in Script)

ehwagner wrote:

I'm not sure I understand. I tested my changes in the procedure you provided and it displays the file size in MB whether it is below or above 15. Are you changing something when you retrofit this code into your actual project?


You mention real time size. I don't understand what you mean. If you are looking to display the actual size of a file then all you need to do is create another label and then populate it with the integer i (see below).

Form1.ActualSize.Caption := IntToStr(i);

Basically I need the label "MBSize" to update when you add another file.  As you attach files, the label updates with the size of the archives
already added (Total sum of files in MB), to show you that you're still under 15MB.  If you go over 15MB then it displays the size in MB in
red color. 

Your script works great , it's just the part to update the lable as you add more files that needs to be working.

60

(6 replies, posted in Script)

ehwagner wrote:

gonpublic2k,

Change the following line:

Form1.MBSize.Caption := FormatFloat('0.00', i/(1024*1024)); //MB

To

  If i/(1024*1024) < 1 then Form1.MBSize.Caption := '<1MB'
               else Form1.MBSize.Caption := FormatFloat('0.00', i/(1024*1024)) + 'MB'; //MB
  If i/(1024*1024) > 15 then Form1.MBSize.Font.Color := clRed
               else Form1.MBSize.Font.Color := clGreen;

Thank you ehwagner, this works but it doesn't show the actual size of the files being attached until after you exceed the limit of 15MB.  I want to
show in a label, real time size of the files being attached.  I don't know if i'm explaining this well.

61

(6 replies, posted in Script)

Hello Dmitry,

Is there anyway to use the GetFileSize function to display the size in MB of the files you attach to an e-mail? I want to display on a label, the
size in MB of files being attached so that when it reaches the maximum of attachments size (in this case 15MB ) the label displays the size in
RED.  Otherwise, if it's less than 15MB displays it in GREEN.

Here's a sample code I copied for the attachments: (Note: This code is not working, I'm not sure how to use the GetFileSize function  for
my purposes here .. )

procedure Form1_attached_OnClick (Sender: TObject; var Cancel: boolean);
var
    OpenDialog: TOpenDialog;
    d: int64;
    i: integer;
begin

    OpenDialog := TOpenDialog.Create(Form1);

    try
        if OpenDialog.Execute then
        begin
            if FileExists(OpenDialog.FileName) then Form1.mmfiles.Lines.Add(OpenDialog.FileName);
            d := GetFileSize(OpenDialog.FileName);
            i := d;
            Form1.MBSize.Caption := FormatFloat('0.00', i/(1024*1024)); //MB
        end;
    finally
        OpenDialog.Free;
    end;
end;


Thanks , appreciate your help!

62

(4 replies, posted in Russian)

DriveSoft wrote:

Можно, сделал для вас проект с примером

@Dmitry, this same example but using CDO - SMTPSendMessage  instead of SendMail? 
Could you help with that please?

Couldn't be any better!  Thanks so much.  smile

vovka3003 wrote:

Посибле:
https://i.imgur.com/PA7KGAn.png
It's just that I'm already a little tired of helping everyone and could give you a solution for a small fee ...

Well, thanks for your reply but in this forum everyone helps including Dmitry and NOBODY has ever charged a cent for that, I find that insulting that you even posted something like that.

We are a community and are here to help each other not make a it a business.

Thanks but no thanks.

vovka3003 wrote:

Никто не знает, как по-анлийски будет: "за магарыч"..?

Can you help me with this Vovka?

Hi MVD,

I need to know how to script the sendmail function to send multiple attachments on the same e-mail.  Need a sample
or a small script in the right direction.  I can send e-mails to gmail now, via the SendMail function but need to know how
to attach multiple archives to send on the same e-mail.


Please!!!!!

67

(3 replies, posted in Script)

Excellent!  thanks Dmitry!

68

(2 replies, posted in Script)

Great!!  Finally a script that works!!

69

(2 replies, posted in Script)

Hi MVD,

Has anyone been successful sending e-mail with this function?  I'm trying to use it with the
Gmail SMTP settings that require SSL to no avail.   If anyone can provide a sample that WORKS,
please I'd appreciate it.

Thank you!

70

(187 replies, posted in General)

VascoMorais wrote:

Thanks! For now i am able to use sendemail function with another email (other than gmail).
In the meanwhile don't forget to check about OpelSSL libraries , they might need updating.

Many thanks again!

Hi @VascoMorais,

How did you get this to work? I've been trying to use it sending it using Gmail and I have not been
successful.  It gives me a 'Connection timeout error'


Please HELP!!!


Thanks!

71

(3 replies, posted in Script)

Nobody?   

I need some sample project, please!!!!

The application should have the following characteristics:

*  Send e-mail ( internally and externally)

* Receive e-mail

*  Be able to send attachments

* Take advantage of the Rich Text capabilities built-in MVD

* Be able to send and receive e-mail in plain text format and HTML.


I'm pretty sure that we can accomplish this using MVD I just need some samples and guidance.

Thanks, your help is greatly appreciated.   smile

72

(3 replies, posted in Script)

Hi all MVD,

Has anyone tried creating a simple e-mail client to send and receive mails from MVD?  Basically using POP or SMTP
have MVD send and receive mail without having to open a web browser.  Sort of what Outlook does.  If anyone has
done this please provide a sample to give me a kickoff.

Thanks!!

Hello all MVD,

Dmitry, I found this info I'm not sure if it'll help at all but talks about developing your own CTI interface with a programming language of your
choice.  Perhaps something to look at when planning on developing a client or a way to interface from within MVD:


https://www.cisco.com/c/en/us/td/docs/v … r_0100.pdf


Hope it helps!!

FEATURE REQUEST for future updates.

**(CTI) Computer Telephony Integration with My Visual Database.

Please!! smile

DriveSoft wrote:

IP Phone does not support, I should to buy components to add it to MVD.

Ahhh ok. I understand.  That would be awesome if it can be added in the future for updates of MVD.  Thanks Dimitry