by cdmmaui » Wed Nov 26, 2008 1:31 am
Hi Antonio,
I tried the following code with no success.
//----------------------------------------------------------------------------------
#include "FiveWin.ch"
function Main()
local oWnd, oActiveX, cGetPost := ''
cGetPost := '_nfpb=true&_nfls=false&_pageLabel=page_tracking3_trackSimple'
cGetPost += '&portlet_trackSimple_1wlw-select_key:{pageFlow.trackSimpleForm.type}OldValue=true'
cGetPost += '&portlet_trackSimple_1wlw-select_key:{pageFlow.trackSimpleForm.type}=CONTAINERNUMBER'
cGetPost += '&portlet_trackSimple_1{pageFlow.trackSimpleForm.numbers}=CLHU2068151'
DEFINE WINDOW oWnd
@ 0, 0 ACTIVEX oActiveX PROGID "Shell.Explorer" OF oWnd
oWnd:oClient = oActiveX
ACTIVATE WINDOW oWnd ;
ON INIT oActiveX:Do( "Navigate2",;
"http://www.maerskline.com:80/appmanager/maerskline/public?_nfpb=true&portlet_quickentries_2_actionOverride=%2Fportlets%2Fquickentries%2FtrackCargo&_windowLabel=portlet_quickentries_2&_pageLabel=home",,,;
GetPostData( cGetPost ),;
"Content-Type: application/x-www-form-urlencoded" + CRLF )
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
HRESULT hb_oleVariantToItem( PHB_ITEM pItem, VARIANT * pVariant );
HB_FUNC( GETPOSTDATA )
{
VARIANT vPostData = {0};
LPSAFEARRAY psa;
LPCTSTR cszPostData = hb_parc( 1 );
UINT cElems = lstrlen( cszPostData );
LPSTR pPostData;
VariantInit( &vPostData );
psa = SafeArrayCreateVector( VT_UI1, 0, cElems );
if( ! psa )
{
hb_retnl( E_OUTOFMEMORY );
return;
}
SafeArrayAccessData( psa, ( LPVOID * ) &pPostData );
memcpy( pPostData, cszPostData, cElems );
SafeArrayUnaccessData( psa );
V_VT( &vPostData ) = VT_ARRAY | VT_UI1;
V_ARRAY( &vPostData ) = psa;
hb_oleVariantToItem( hb_param( -1, HB_IT_ANY ), &vPostData );
}
#pragma ENDDUMP