SAFEARRAY [modified]
-
Hi All, How can i pass , BYTE array parameter from VC++ 6.0 to OLE Server to SAFEARRAY Argument. Regards Vj
modified on Thursday, November 27, 2008 5:43 AM
How is the function you're calling declared? [modified] I mean the function in the server. What kind of argument are you supposed to pass, a VARIANT that contains a SafeArray? [/modified]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
How is the function you're calling declared? [modified] I mean the function in the server. What kind of argument are you supposed to pass, a VARIANT that contains a SafeArray? [/modified]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknownHi Roger, Thanks for you reply , i have written a dll in C#.net and using RegAsm i created a .tlb file and i am using those functions in VC++6.0 C# function void fun(byte[] input) which is conveted to void fun(SAFEARRAY *input) in .tlb file . now i dont know how to pass BYTE array to this fun function from VC++ 6.0
-
Hi Roger, Thanks for you reply , i have written a dll in C#.net and using RegAsm i created a .tlb file and i am using those functions in VC++6.0 C# function void fun(byte[] input) which is conveted to void fun(SAFEARRAY *input) in .tlb file . now i dont know how to pass BYTE array to this fun function from VC++ 6.0
Ok, try the following:
- Create a SafeArray with a call to
::SafeArrayCreate()
and set theVARTYPE
parameter toVT_UI1
. - Get the data buffer of the SafeArray with a call to
::SafeArrayAccessData()
and copy whatever data you'd like into the buffer. - Release the bufer when you're done with it with a call to
::SafeArrayUnaccessData()
. - Call the
fun()
function.
Look the SafeArray functions up for information on how to call and use them. Begin at SafeArrayCreate[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown - Create a SafeArray with a call to
-
Ok, try the following:
- Create a SafeArray with a call to
::SafeArrayCreate()
and set theVARTYPE
parameter toVT_UI1
. - Get the data buffer of the SafeArray with a call to
::SafeArrayAccessData()
and copy whatever data you'd like into the buffer. - Release the bufer when you're done with it with a call to
::SafeArrayUnaccessData()
. - Call the
fun()
function.
Look the SafeArray functions up for information on how to call and use them. Begin at SafeArrayCreate[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown - Create a SafeArray with a call to