/*
Purpose: Test auto login to website
*/
#include "fivewin.ch"
function Main()
local oWnd, oActiveX
msgInfo() // this shows
DEFINE WINDOW oWnd
@ 0, 0 ACTIVEX oActiveX PROGID "Shell.Explorer" OF oWnd
msgInfo( valtype( oActiveX ) ) // This never shows
oWnd:oClient = oActiveX
msginfo()
ACTIVATE WINDOW oWnd //;
ON INIT oActiveX:Do( "Navigate2",;
"https://www.dixiesales.com/login-us.aspx",,,;
GetPostData( "Dealer Number=1000" ),;
"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
//end
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 49 guests