Quote:
> I wrote an OLE DB provider and it seems that the DataConvert method does
not
> work properly. This method takes a source pointer of type void and a
> destination pointer of type void too. The purpose of this method is thus
> obviously to copy data from the source pointer to the destination pointer.
> However, when I debug, I notice that at the address of the source pointer
is
> the address of another pointer which contains, if I move in the memory,
the
> value I wish to copy to the destination pointer.
> At the end of the process, the destination pointer contains strange
> characters since it had copied obviously the value of the address and not
> the value AT the address.
> I would be glad if someone could tell me what I should do in order to get
> the right value. Thus the one at the address given by the source pointer.
> Thanks in advance
> Francois
Francois,
I'm not an expert on OLE DB, but I looked up the documentation on
DataConvert in MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oled...
oledbidataconvert__dataconvert.asp), which has this to say about the pSrc
and pDst parameters:
pSrc
[in]
A pointer to the source data. This is a pointer to the underlying data
type, based on the value of wSrcType. For example, this would be the
address of the BSTR pointer if wSrcType is DBTYPE_BSTR, not the BSTR
pointer itself.
pDst
[out]
A pointer to memory in which to return the destination data. As in the
case of pSrc, this is a pointer to the underlying data type, based on the
value of wDstType.
Perhaps the wDstType you are using actually indicates that pSrc is a
pointer to a pointer to the value you want and does not point directly to
the value you want?
--
Mark Levine
Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no
rights.