Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing output from ActiveX control event programatically
Message
From
08/05/1998 15:29:33
Donny Sims
Independent Computer Consultants Inc
Scottsboro, Alabama, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Accessing output from ActiveX control event programatically
Miscellaneous
Thread ID:
00098174
Message ID:
00098174
Views:
63
I am using VFP 3.0 on Win95/NT and have the prg below that sends mail to my internal network SMTP email server using an ActiveX control, as far as it goes it works fine.

The documentation for the control lists these two events: Status (short progress) and Response( LPCTSTR str ),(I put the entire documentation below the code).

My question is how do I trap the output of the events for use in my program ? In paticular I need to test the last string output by the Response event to ensure that the mail was sent sucessfully. (If someone could tell me what that "LPCTSTR str" means I would also appreciate it.)

My code so far:
Smtpform = CREATEOBJECT("form")
Smtpform.addobject("Session1","olecontrol","SMTP.SmtpCtrl.1")

WITH Smtpform.Session1
.DestinationAddress = "everyone@acme.com"
.Domain = "acme.com"
.MailData = "This is a mail message"
.SmtpServerIP = "192.168.0.1"
.SourceAddress = "everyone@ntes.com"
.SourceMailer = "Smtp1 test-mailer"
.SourceName = "Donny Sims"
.Subject = "Test of SMTP from foxpro"
ENDWITH
* this actually sends the mail
Smtpform.Session1.Sendmail
The documentation for the two events:

Status (short progress)

Status gives progress information when certain operations is in progress. This can be useful when you need to inform a user about the progress and what is happening during lengthy operations. The progress is directly expressed is percentage of the task completed. A task is always started with an event where progress=0 and ended with an event where progress = 100.
Sendmail and AddAttachment are methods which trigger this event.


Response( LPCTSTR str )

This event gives response text from the server.
Donny Sims

Life is what happens to us while were busy making other plans.
- John Lennon
Next
Reply
Map
View

Click here to load this message in the networking platform