Howdy, Stranger!

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

Categories

Trouble with wrapper method

donkyhodonkyho Member Posts: 99
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

  • mfeikmfeik Member Posts: 24
    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.
    :



  • Shawn CarterShawn Carter Member Posts: 0

    ________ ( http://forcoder.org ) free video tutorials and ebooks about ( Objective-C, C, PL/SQL, Python, C#, Perl, Visual Basic, Scratch, R, Ruby, Java, Swift, MATLAB, Delphi, PHP, Assembly, JavaScript, C++, Go, Visual Basic .NET F#, Erlang, Alice, LabVIEW, Apex, SAS, Logo, Fortran, FoxPro, ABAP, Hack, Rust, Awk, Lisp, Dart, Transact-SQL, COBOL, Ada, Scheme, ML, D, Bash, Prolog, Clojure, Julia, Scala, Lua, Crystal, Kotlin, VBScript ) ____________

Sign In or Register to comment.