Override ByRef with ByVal 
Author Message
 Override ByRef with ByVal

Hi!
I tried to override the default ByRef with a ByVal argument.
call xxx(ByVal var).................xxx is declared like this: xxx (var as
any)
This works just fine in VB5, but when I moved the module to access97 I
always get an error-message.
The problem is that these function-declarations come from a type-library
(.tlb file) and are not changeable.
Why is overriding allowed in VB5 and not in Access97?
I always thought they use the same VB-engine.
Any comment appreciated, Franz.

----------
Franz Strele
Synergis CAD-Info-Systeme GmbH
http://www.*-*-*.com/



Tue, 21 Nov 2000 03:00:00 GMT  
 Override ByRef with ByVal

This works fine for me. What error are you getting?

Michael


Quote:
>Hi!
>I tried to override the default ByRef with a ByVal argument.
>call xxx(ByVal var).................xxx is declared like this: xxx (var as
>any)
>This works just fine in VB5, but when I moved the module to access97 I
>always get an error-message.
>The problem is that these function-declarations come from a type-library
>(.tlb file) and are not changeable.
>Why is overriding allowed in VB5 and not in Access97?
>I always thought they use the same VB-engine.
>Any comment appreciated, Franz.

>----------
>Franz Strele
>Synergis CAD-Info-Systeme GmbH
>http://www.synergis.at




Wed, 22 Nov 2000 03:00:00 GMT  
 Override ByRef with ByVal

I just noticed that this overriding just works for DLLs only. Is this
correct?
I am not directly calling a dll, I am using functions from a referenced
type-library (shell's IMalloc Interface).
Any comment to get this done is very appreciated.
Thanks, Franz.

Michael Kaplan schrieb in Nachricht ...

Quote:
>This works fine for me. What error are you getting?

>Michael



>>Hi!
>>I tried to override the default ByRef with a ByVal argument.
>>call xxx(ByVal var).................xxx is declared like this: xxx (var as
>>any)
>>This works just fine in VB5, but when I moved the module to access97 I
>>always get an error-message.
>>The problem is that these function-declarations come from a type-library
>>(.tlb file) and are not changeable.
>>Why is overriding allowed in VB5 and not in Access97?
>>I always thought they use the same VB-engine.
>>Any comment appreciated, Franz.

>>----------
>>Franz Strele
>>Synergis CAD-Info-Systeme GmbH
>>http://www.synergis.at




Fri, 24 Nov 2000 03:00:00 GMT  
 Override ByRef with ByVal

You can only override for DLL calls.  This is correct.

If you need to override for other calls, you have to make the interface
changes in your typelib, or alternately you have to use hacky memory tricks
to dereference pointers.

Michael


Quote:
>I just noticed that this overriding just works for DLLs only. Is this
>correct?
>I am not directly calling a dll, I am using functions from a referenced
>type-library (shell's IMalloc Interface).
>Any comment to get this done is very appreciated.
>Thanks, Franz.

>Michael Kaplan schrieb in Nachricht ...
>>This works fine for me. What error are you getting?

>>Michael



>>>Hi!
>>>I tried to override the default ByRef with a ByVal argument.
>>>call xxx(ByVal var).................xxx is declared like this: xxx (var
as
>>>any)
>>>This works just fine in VB5, but when I moved the module to access97 I
>>>always get an error-message.
>>>The problem is that these function-declarations come from a type-library
>>>(.tlb file) and are not changeable.
>>>Why is overriding allowed in VB5 and not in Access97?
>>>I always thought they use the same VB-engine.
>>>Any comment appreciated, Franz.

>>>----------
>>>Franz Strele
>>>Synergis CAD-Info-Systeme GmbH
>>>http://www.synergis.at




Sat, 25 Nov 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ByVal / ByRef

2. byVal vs ByRef

3. Questions regarding objects, assignments, byval, byref, etc...

4. Change Standard from ByVal to ByRef

5. Event Arguments : ByRef or ByVal (Which Best)?

6. Peformance in VB.NET - ByRef and ByVal

7. objects byval and byref

8. ByRef And ByVal for Object

9. byval / byref

10. ByRef and ByVal

11. Pass arguments ByVal or ByRef

12. ByVal vs ByRef

 

 
Powered by phpBB® Forum Software