Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mz
  Where is Mz?
 Metro Manila
 Philippines
 Mz
 To: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 Tags
Subject: in addition...
Thread ID: 50516 Message ID: 50657 # Views: 2 # Ratings: 0
Version: Visual FoxPro 8 Category: Active X Controls & OLE Automation
Date: Saturday, September 04, 2004 9:08:09 AM         
   


> > Hi,
> >
> > I need to pass a string value to a COM Object the method styax as follow
> >
> > Method AssignField( hTable as Long, hRec as Long, FieldData as Variant) as Void
> >
> > My program source code is
> >
> >
> > 	lc_Data = "Testing"
> > 	lo_test.AssignField( 1, 1, lc_Data)
> > 	

> >
> > But return error message "Type Mismatch"
> >
> > How can fix it?
> >
> > Thank you for help
>
> By default, a VB parameter is passed by reference, unless ByVal is specified. So see what happens if you pass lcData by reference:
> lo_test.AssignField( 1, 1, @lc_Data)
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts

in addition to what EDD said, is that you pass by REFERENCE would mean you are passing the MEMMORY ADDRESS
where the variable lc_Data is located. The receiving code would actually get a specific numerical value on what part
of memmory you want to write or read the value.

yet, any value you passed such as lc_data instead of the @lc_data would become a WILD POINTER.

-Mz



ENTIRE THREAD

How to pass a value to COM object? Posted by Ben Lai @ 9/2/2004 5:44:05 PM
RE: How to pass a value to COM object? Posted by Ken Blum @ 9/2/2004 6:11:12 PM
RE: How to pass a value to COM object? Posted by Ben Lai @ 9/2/2004 7:58:55 PM
RE: How to pass a value to COM object? Posted by Eric den Doop @ 9/2/2004 6:12:17 PM
in addition... Posted by Mz @ 9/4/2004 9:08:09 AM