Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zcwbnu opened this issue Dec 25, 2020 · 0 comments
Open

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

zcwbnu opened this issue Dec 25, 2020 · 0 comments
Assignees

Comments

@zcwbnu
Copy link

zcwbnu commented Dec 25, 2020

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants