debugger showing wrong data in argument list C++.NET and ADO

From: michael (michael_at_discussions.microsoft.com)
Date: 08/02/04


Date: Mon, 2 Aug 2004 05:13:02 -0700


            I am having a problem using the "mixed/managed debugger "
all my classes are unmanaged. I compiled with /clr /EHsc

first I import msado v1.5

DBUtiles.h
#include <afxtempl.h>
#import "c:\Program files\Common files\system\ado\msado15.dll"
no_namespace rename("EOF", "adoEOF")
#include "comdef.h"

class TRV_UTILITY_EXPORT CDatabaseHelper : CStoredProcRS
{
        _RecordsetPtr pRecordSet;

}

Issue:

I initialize the Rows = 3000, then I step into a msado15 wrapper
method GetRows(). I confirmed that one recored was return because
lpRecords = 1, this is what I expected.

DBUtiles.cpp
{

   ADO_LONGPTR lpRecords = pRecordSet->GetRecordCount();

   Rows = 3000;
   avarRecords = pRecordSet->GetRows(Rows); //, Start, Fields);
}

However, while in the inline Recordset15::GetRows( ) intellisense
shows the value parameter "Rows" = {_int3} and it fails when a call is
made to raw_GetRows( ) because the local variable Rows = {__int3} not
3000.

I get exception Error:
3421 adErrDataConversion Application uses a value of the wrong type for the current operation.

msado15.tli
inline _variant_t Recordset15::GetRows ( long Rows, const _variant_t &
Start, const _variant_t & Fields ) {
    VARIANT _result;
    VariantInit(&_result);

    /* Rows = {__int3 } it should be = 3000 */
    HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result);

    /* hr = -2146824867 it should be 0 */

    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _variant_t(_result, false);
}

does anyone think that the ms kb 840667 have any relevance to this issue?
could it be that MC++.NET unmanaged code has unknown errors when used with
ADO not ADO.NET?

msado15.tlh

struct __declspec(uuid("0000050e-0000-0010-8000-00aa006d2ea4"))

Recordset15 : _ADO

{
    virtual HRESULT __stdcall raw_GetRows (
        /*[in]*/ long Rows,
        /*[in]*/ VARIANT Start,
        /*[in]*/ VARIANT Fields,
        /*[out,retval]*/ VARIANT * pvar ) = 0;
}

Any help from anyone would be highly appreciated.



Relevant Pages

  • debugger showing wrong data in MC++ Urgent
    ... class TRV_UTILITY_EXPORT CDatabaseHelper: CStoredProcRS ... method GetRows(). ... made to raw_GetRowsbecause the local variable Rows = not ...
    (microsoft.public.vsnet.debugging)
  • debugger showing wrong data in MC++ Urgent
    ... class TRV_UTILITY_EXPORT CDatabaseHelper: CStoredProcRS ... method GetRows(). ... made to raw_GetRowsbecause the local variable Rows = not ...
    (microsoft.public.vsnet.general)