Click to See Complete Forum and Search --> : VARIANTARG with DWORD


jtoddm
April 22nd, 1999, 02:59 AM
Hi, I am trying to use Exec with an IOleCommandTarget for an ie comm band.
The documentation says I need to pass in the band ID (a DWORD) as a VARIANTARG.
What part of the VARIANTARG corresponds to a DWORD? I was thinking long, but it doesn't work.

Here is my code, please help me change it:


IOleCommandTarget *target;

if (m_bParent->QueryInterface(IID_IOleWindow, (LPVOID*) &target) == E_NOINTERFACE)
return;

VARIANTARG vBandID;

V_VT(&vBandID) = VT_I4;
V_I4(&vBandID) = m_bParent->GetBandID();

target->Exec(&CGID_DeskBand, DBID_BANDINFOCHANGED, OLECMDEXECOPT_DONTPROMPTUSER, &vBandID, NULL);