Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using VFPCOM to bind to Outlook events (ItemSend for exa
Message
 
À
26/04/2000 05:02:54
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00363457
Message ID:
00363489
Vues:
20
Hi Walter,

I tried sys(2333,0) in the application object's SendEmail() method, and the method appeared not to explode with a GPF when the SET STEP ON code was enabled (although it didn't make the note it was supposed to make). When I turned off the break though, it GPFd again - Timing problem perhaps?

New method code:
* disable vtable binding to see if that avoids GPFs
local lcSYS2333
lcSYS2333 = sys(2333,2)
sys(2333, 0)

with this

  local loMessage
  
  loMessage = .oOutlook.createitem(olMailItem)
  
  loMessage.UserProperties.Add('ToContactID', olNumber)
  loMessage.UserProperties.Add('FromRep', olText)
  loMessage.UserProperties('ToContactID') = this.GetCurrentContact()
  loMessage.UserProperties('FromRep') = this.cInitials

  loMessage.Recipients.Add(contactview.email)
  loMessage.Recipients.ResolveAll()
  loMessage.Display(.f.)

endwith

sys(2333, int(val(lcSYS2333)))
Cheers,

Andrew


>Andrew,
>
>>No I haven't tried sys(2333) - I'll give it a shot, but I can't see why that would make a difference, there's not an ActiveX control being instantiated within VFP - it's a COM server.
>
>I know, thats why it is a shot in the dark.
>
>>I could be displaying my lack of complete understanding of things COM, but I thought these were two different things, or at least that one was a subset of the other.
>
>To be honest I don't know if they are related or not, I think it's worth a try.
>
>>I'm also not sure where I'd switch it on/off in the code. Because it's event driven and I don't even seem to get to the start of the event code, there doesn't seem to be an appropriate place to put the sys() call.
>
>How about before you instantiate the com-server ?
>
>Walter,


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform