Hi all
Собственно сабж.
каким таким непонятным вариантом засылается пост-дата
в мсдн написано что The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.
Здравствуйте, OverCrash, Вы писали:
OC>Hi all OC>Собственно сабж. OC>каким таким непонятным вариантом засылается пост-дата
OC>в мсдн написано что The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.
OC>мож кусочком кода кто поделится ?
Здравствуйте, OverCrash, Вы писали:
OC>спасибо большое
Да не за что Оно в на сайте Борланда валялось в коммьюнити. Долго так валялось, а тут вдруг вы спрашиваете
З.Ы. Гугль — рулит!
Re: IWebBrowser2::Navigate2 post variant
От:
Аноним
Дата:
09.11.07 18:27
Оценка:
Здравствуйте, OverCrash, Вы писали:
OC>Hi all OC>Собственно сабж. OC>каким таким непонятным вариантом засылается пост-дата
OC>в мсдн написано что The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.
OC>мож кусочком кода кто поделится ?
Ну вот как делается пост при перегрузке метода BeforeNavigate2 в CHTMLView
Здравствуйте, OverCrash, Вы писали:
OC>Hi all OC>Собственно сабж. OC>каким таким непонятным вариантом засылается пост-дата
OC>в мсдн написано что The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.
OC>мож кусочком кода кто поделится ?
... << RSDN@Home 1.2.0 alpha rev. 685>>
Re: IWebBrowser2::Navigate2 post variant
От:
Аноним
Дата:
29.10.08 10:16
Оценка:
Здравствуйте, OverCrash, Вы писали:
OC>Hi all OC>Собственно сабж. OC>каким таким непонятным вариантом засылается пост-дата
OC>в мсдн написано что The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.
OC>мож кусочком кода кто поделится ?
VARIANT vFlags = {0};
VARIANT vPostData = {0};
// Test data length.
int len = 6;
// Create test data.
char* data = new char[len];
// Copy a string, including its NULL character.
memcpy(data, "hello", len);
data[2] = '\0';
// The data now contains {he\0lo\0}. There is an embedded NULL character.
// Put data into safe array.
LPSAFEARRAY psa = SafeArrayCreateVector(VT_UI1, 0, len);
if (!psa)
return;
LPSTR pPostData;
HRESULT hr=SafeArrayAccessData(psa, (LPVOID*)&pPostData);
memcpy(pPostData,data,len);
hr = SafeArrayUnaccessData(psa);
// Package the SafeArray into a VARIANT.
V_VT(&vPostData) = VT_ARRAY | VT_UI1;
V_ARRAY(&vPostData) = psa;
// Get Headers.
VARIANT vHeaders = {0};
V_VT(&vHeaders) = VT_BSTR;
// Navigate, and POST the data. http://myserver/myasp.asp
// is an Active Server Pages page that expects POST data.
// m_pBrowserApp is declared as IWebBrowser2*
hr = m_pBrowserApp->Navigate(L"http://myserver/myasp.asp", &vFlags,
NULL, &vPostData, &vHeaders);