Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing output from ActiveX control event programatica
Message
From
12/05/1998 12:35:31
Donny Sims
Independent Computer Consultants Inc
Scottsboro, Alabama, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00098174
Message ID:
00098795
Views:
32
David

First, let me apologise for not acknowledging you reply more quickly, things got crazy here last Friday eveing. I finally got a chance to try your code last night (while waiting for the second new hard disk in our server to load). I've included my code below, the lcString variable contains only spaces at every checkpoint. Am I doing something wrong? In searching the v3 docs I could find no references to using the @ token for passing variables by reference to OLE or ActiveX controls ( only for UDF's and DLL's ), do you think I may need to upgrade to v5 to get this to work ?

Thanks for your help

>Donny,
>
>LPCTSTR - Long Pointer to a Constant TStr, basically a pointer to a string. So in VFP you'd use @lcString to send the function the address of your string, which should have enough space already allocated to hold the return value:
>
>local lcString
>lcString = space( 1024 )
>SMTPForm.Session1.Response( @lcString )
>? lcString
>
My revised code:
SMTPForm = CREATEOBJECT("form")
SMTPForm.addobject("Session1","olecontrol","SMTP.SmtpCtrl.1")

WITH SMTPForm.Session1
.DestinationAddress = "everyone@acme.com"
.Domain = "acme.com"
.MailData = "This is a mailmessage"
.SmtpServerIP = "192.168.0.1"
.SourceAddress = "admin@acme.com"
.SourceMailer = "ESEsSmtp1 test-mailer"
.SourceName = "Donny Sims"
.Subject = "Test of SMTP mail from foxpro"
ENDWITH

private lcString
lcString = space( 1024 )
SMTPForm.Session1.Response( @lcString )
? lcString
SMTPForm.Session1.Sendmail
? lcString
SMTPForm.Session1.Response( @lcString )
? lcString
Donny Sims

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

Click here to load this message in the networking platform