Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Wilson Guerra
  Where is Wilson Guerra?
 San Pedro Sula
 Honduras
 Wilson Guerra
 To: Jerry Ott
  Where is Jerry Ott?
 Danville
 California - United States
 Jerry Ott
 Tags
Subject: RE: VB DLL Integration into VFP
Thread ID: 14645 Message ID: 16565 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Tuesday, October 22, 2002 10:28:15 PM         
   


> Could some of the VB experts look at this code and tell me why my VFP implementation is not working correctly. I am woking with a 3rd party set of DLLs and they don't know anything about VFP. The op events fire and work as I would expect. When the Done code fires it's supposed to return some data in the pTemplate object. It returns as all blank.
>
> *** Code extracfted from a Sample VB Form's Code
>
> *** The Main Object from a DLL - all of its events work through IMPLEMENTS
> Dim WithEvents op As FPRegisterTemplate
>
> *** I don't know what this is about. FPTemplate is in the DLL we previously discussed
> Dim regtemplate As FPTemplate
>
> *** I get to here
> * pTemplate returns as a blank object
> Private Sub op_Done(ByVal pTemplate As Object)
> lblEvents.Caption = "Done"
> lblTemplateID.Caption = pTemplate.InstanceID
> Set regtemplate = pTemplate
> End Sub
>
> *** Click the Save Button
> Private Sub cmdSave_Click()
> On Error Resume Next
> Dim blob() As Byte
> Dim bvariant As Variant
>
> If regtemplate Is Nothing Then
> Exit Sub
> End If
>
> regtemplate.Export bvariant
> blob = bvariant
> Kill "c:\regtemplate.fpt"
> Open "c:\regtemplate.fpt" For Binary As #1
> Put #1, , blob
> Close #1
> End Sub
>
> Any help would be greatly apprecited.
>
> Jerry Ott

There is no way to declare this in VFP

Dim WithEvents op As FPRegisterTemplate

this a variable object that raise events, the only way you could use this COM is Compiling it as an invisible at runtime ActiveX Control. Maybe the people who made it can do that for you, that's not such a difficult task.

Wilson Guerra
Honduras

ENTIRE THREAD

VB DLL Integration into VFP Posted by Jerry Ott @ 8/28/2002 1:11:25 AM
RE: VB DLL Integration into VFP Posted by Wilson Guerra @ 10/22/2002 10:28:15 PM