FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

How do I call a Grid function with the LPDISPATCH · Issue #207 · MapWindow/MapWinGIS · GitHub

How do I call a Grid function with the LPDISPATCH #207

Description

How to obtain the elevation data value according to the row and column number,After obtaining the IDISPATCH type?
I don’t know why the elevation value I get is always wrong

LPDISPATCH lpDispatch = m_map.get_GetObject(layerHandle);
//hr = lpDispatch->QueryInterface(IID_IDispatch, (void **)&typeinfo);
UINT count;
lpDispatch->GetTypeInfoCount(&count);
DISPID dispid;
DISPID PropertyID[5] = { 0 };
BSTR PropName[5];
PropName[0] = SysAllocString(L"Value");
PropName[1] = SysAllocString(L"row");
PropName[2] = SysAllocString(L"col");

lpDispatch->GetIDsOfNames(IID_NULL, PropName, 3, LOCALE_SYSTEM_DEFAULT, PropertyID);

VARIANTARG v[3];

v[0].lVal = 1000;
v[1].lVal = 710;
v[2].pintVal= &h ;
DISPPARAMS params = {v,NULL,2,0};

VARIANT vResult;

HRESULT ok = lpDispatch->Invoke(PropertyID[0], IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, &params, &vResult, NULL, NULL);
if (SUCCEEDED(ok))
{
TRACE("%d",vResult.iVal);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL