Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Webbrowser control - save postdata in beforenavigate2
Message
From
04/10/2005 09:51:15
 
 
To
04/10/2005 09:37:49
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01055594
Message ID:
01055833
Views:
13
>>Hi Greg,
>>
>>I'm not really into COM, but I've read some articles. So, I might be missing something here <g>
>>
>>>I need help accessing the postdata parameter in the beforenavigate2 event in the web browser control. Apparantly it is a "safearray" datatype that is not native to FoxPro. In all my experiments the data just appears as .NULL. inside FoxPro. Or perhaps breaking into debug mode inside the event is messing it up.
>>>
>>
>>I have no idea what was happened. But anyway, I think you already look into MSKB#Q25619. According to that article, the PostData will contain a data if there is a POST method in the html form. So, empty means there is no POST method.
>>
>>
>>>My goal is simple. Record/save the data a user fills out in a web form so that the data can be used later to automate the process.
>>>
>>
>>I think it's easier to go with VB way first. The PostData is in a SafeArray vbByte format. If the format in VFP is the same with VB (I hope), then you can use BstrFromVector() API. You will get the return pointer to BSTR. Then simply get the characters from that pointer (use sys(2600) or RtlMoveMemory).
>>
>>Hope it helps a little
>Actually that may help me a lot. Do you have any suggestions on the VFP declaration for bstrFromVector? I'm weak with API and I'm getting a syntax error with the following...
>
>
>DECLARE INTEGER BstrFromVector IN oleaut32 ;
>      INTEGER @ Postdata ;
>      STRING @ cByteStr
>
>
>I've tried a lot of different ways to declare this with different data types and libraries but without any real success.
>
>Thanks for your help!
>
>Greg


Here is the sample:
#Define S_OK  0

Declare Long BstrFromVector in OLEAut32 ;
   Long psa, Long @pBString
Declare Long SysStringLen in OleAut32 Long BString
Declare SysFreeString in OleAut32 Long BString

pBString = 0
If (type( 'PostData' ) != 'L')
   If (BstrFromVector( PostData, @pBString ) == S_OK)
      nLen = SysStringLen( pBString ) * 2
      ? sys( 2600, pBString, nLen )
      SysFreeString( pBString )
   endif
endif
HTH
Herman
Previous
Reply
Map
View

Click here to load this message in the networking platform