activex control and passing values by reference 
Author Message
 activex control and passing values by reference

neophyte in VB.

  Created a simple vb activex control, vb6.  The control will be used in a
Powerbuilder App, ver 7.  

  activex control has a function that must receive two values by reference.

  getfieldx(byref astr_fieldname as string, byref ai_maxsize as long)

  powerbuilder mentions that IT must manage memory so I initialize the values
in the pb app before the activex call.  (Oh -- this simply means that memory
must be allocated in powerbuilder and then can be 'used' by the external
function.)

    PB code
       istr_name  = space(55)  //reserve 55 bytes for string
       il_maxsize = 1000         //reserve space for integer value

       activexcontrol.getfieldx(istr_name, il_maxsize)

      in the activex I print out a couple of msgboxs to view the values and DO
see my modifications.  Then, when control is returned to PB, I print out a
messagebox with the istr_name and il_maxsize values.  You guessed it .. they
are not modified!  It acts almost as if the values are being passed by value
regardless of my 'byref' declaration.

  Is there anything special I sould be aware of in the VB activex control that
I need to set to ensure that values are passed by reference?  Can activex
controls possibly not accept values by reference?  

ANY help will be greatly appreciated as I am currently hopelessly lost and
running out of straws to grasp.  

If you could drop me a quick note I would greatly appreciate it and  .... name
my first born male child after you.  Promise :)


Joe



Sat, 19 Jan 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Passing values by reference from java / vb script to ActiveX object

2. Passing values by reference from java / vb script to ActiveX object

3. Passing Property values to ActiveX control

4. Main report value<-pass/return->subReport values (ActiveX Designer Component 6.0)

5. Sub(V1): passed by value or by reference?

6. Passing params By Value and By Reference?

7. Passing a value by reference to a DLL

8. EVENT with paramters passed by reference: be able to change a value

9. Sub(V1): passed by value or by reference?

10. Passing references to ActiveX Exe object

11. Passing object Reference with ActiveX EXE

12. Passing object Reference with ActiveX EXE

 

 
Powered by phpBB® Forum Software