Thread: PSafeArray by reference vs by value.
|
Replies:
2
-
Last Post:
Jun 25, 2014 12:08 PM
Last Post By: Allen Noland
|
|
|
Posts:
45
Registered:
1/11/03
|
|
I have a COM SDK that with the last version changed a procedure from
procedure Initialize(controls: PSafeArray); safecall;
to
procedure Initialize(var controls: PSafeArray); safecall;
I currently call the procedure like this and it works fine.
m_Controller.Initialize(PSafeArray(TVarData(m_editControlArray).VArray))
Will the call be different now that the controls variable is passed by reference?
Thanks in advance!
Allen
Edited by: Allen Noland on Jun 24, 2014 4:02 PM
|
|
|
Posts:
1,227
Registered:
12/16/99
|
|
Allen Noland wrote:
I have a COM SDK that with the last version changed a procedure from
procedure Initialize(controls: PSafeArray); safecall;
to
procedure Initialize(var controls: PSafeArray); safecall;
I currently call the procedure like this and it works fine.
m_Controller.Initialize(PSafeArray(TVarData(m_editControlArray).VArray
))
Will the call be different now that the controls variable is passed
by reference?
The syntax you use should keep working, but what the compiler will pass
will change. In the old version it passed the content of the VArray
field, in the new one it will pass the address of the VArray field.
--
Peter Below (TeamB)
|
|
|
|
Posts:
45
Registered:
1/11/03
|
|
Thanks Peter Below
That is how I thought it worked, but just wanted to make sure.
|
|
|
|
Legend
|
|
Helpful Answer
(5 pts)
|
|
Correct Answer
(10 pts)
|
|
Connect with Us