comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Passing BYTE array to COM DLL written in VC++
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Passing BYTE array to COM DLL written in VC++ [message #34076] Wed, 19 February 2003 08:42
darrick.white is currently offline  darrick.white
Messages: 7
Registered: January 2003
Junior Member
I have an issue about passing a parameter from IDL to a DLL created
from VC++. I'm using IDL's IDLcomIDispatch object to make my call.
The DLL treats the parameter as an output parameter. However, when I
pass the parameter from IDL as a BYTE array, the DLL receives garbage.
The COM object was created using VC++ ATL COM Wizard, simple object.
Below is the IDL code and VC++ function I'm trying to use.

*** IDL 5.6 CODE ***************************************
Pro ImageInfo

ref = OBJ_NEW('IDLcomIDispatch$CLSID$AF3C3F6F_299C_11D7_ABB3_00B0D 0C74243')

image = BYTE('OKAY, WHY IS THIS NOT WORKING')
result = ref->initializeImageInfo(image)

print, result

OBJ_DESTROY, ref
End

*** VC++ 6.0 CODE Segment ***************************************
STDMETHODIMP CImageInformation::initializeImageInfo
(BYTE* imageHeaderAddress,
long *returnValuePtr)
{

try
{
ofstream examplefile ("example.txt");
if (examplefile.is_open())
{
/* imageHeaderAddress is garbage */
examplefile << imageHeaderAddress << "\n";
examplefile << "Done.\n";
examplefile.close();
}

/* imageHeaderAddress will get initialized here */
*returnValuePtr =
Assistant::sInitializeImageInfo((char*)imageHeaderAddress);

.
.
.
}
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: differences idl5.5 and idl5.6
Next Topic: Re: Check if coordinate is in array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:56:52 PDT 2025

Total time taken to generate the page: 0.00515 seconds