Trouble with wrapper method

STDMETHODIMP CBlackjack::ReadCards(VARIANT* pHand)
{
*pHand = m_pHand->ReadCards();

return S_OK;
}

m_pHand->ReadCards() has the exact same definition as CBlackjack::ReadCards()....when I call this method from a VB Client I get memory errors....can someone please tell me why? I did the exact same thing as this, wrapping a GetValue(SHORT* pVal) method and it worked fine....CHand::ReadCards() creates a SAFEARRAY and stores it into the VARIANT, then returns the VARIANT*.....does it have something to do with the array? Any help appreciated. Thanks

P.S. - I rarely get answers when I post messages here...is it because I'm asking the wrong questions or on the wrong messageboard or something? I'd like to know so that I can do things properly next time.

Comments

  • I would ask why, if you had a method that worked, you are trying to do it a different way. As you your not getting responses... well.. I just joined this forum so I have no clue.'
    Regards
    -Mel

    : STDMETHODIMP CBlackjack::ReadCards(VARIANT* pHand)
    : {
    : *pHand = m_pHand->ReadCards();
    :
    : return S_OK;
    : }
    :
    : m_pHand->ReadCards() has the exact same definition as CBlackjack::ReadCards()....when I call this method from a VB Client I get memory errors....can someone please tell me why? I did the exact same thing as this, wrapping a GetValue(SHORT* pVal) method and it worked fine....CHand::ReadCards() creates a SAFEARRAY and stores it into the VARIANT, then returns the VARIANT*.....does it have something to do with the array? Any help appreciated. Thanks
    :
    : P.S. - I rarely get answers when I post messages here...is it because I'm asking the wrong questions or on the wrong messageboard or something? I'd like to know so that I can do things properly next time.
    :



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion