Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing POSTDATA Safearray in VFP
Message
From
28/09/2005 16:21:12
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
28/09/2005 15:04:42
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01053597
Message ID:
01054214
Views:
17
>>How do you "read the PostData parameter"? Do you have a VFP object that is getting passed the PostData? What object has the beforenavigate2 event? If you have a VFP object whose BeforeNavigate2 method is being called with the safearray PostData, it's a trivial exercise to turn that into a string.
>>
>>The VB code is just walking an array of bytes and building a string.
>>*-- Assuming PostData is an array of bytes
>>cStr = ''
>>FOR nInc = 1 to ALEN(PostData)
>> cStr = cStr + CHR(PostData[nInc])
>>ENDFOR
>>MESSAGEBOX(cStr)
>>
>>Since it sounds like you have a web brower control, I'd try creating a class with a method that can be bound to the web browser's ctrlWB_BeforeNavigate2 event with EventBinding to catch the PostData parameter.
>>
>>Gary
>
>
>Thanks for all your help!
>
>I am using the webbrowser control. Things have gotten far more confusing in the past few hours. The beforenavigate2 event is supposed to fire automatically. What I should say is it fire sporadically. It seems now that it may not be the event I can rely on for this project. When I post form data 50% of the time the event simply doesn't fire. It never seems to fires if the form post is back to the same page which is a frequent setup on many web sites. Yet the event fires every single time if you use links for navigation and 90% of the time for "GET" forms.
>
>Right now I'm as confused how to proceed from here as I have been on any project in the past 5 years. I guess the only upside is that at least it's not a DOT NET app. Apparantly the webbrowser control events are even more screwed up if your hosting the control in a DOT NET app.
>
>Hopefully I'll stumble across a way to make this work soon. I'm starting to seriously consider using an ASP page as a proxy. In other words, I will parse out the action and replace the real website with an ASP page that grabs up the form post data, save it to a table using ODBC and then redirect to the real page. God I hope I don't have to go there!
>
>Thanks again for your help. Hopefully I'll have some intelligent questions to ask in my next post! OR even better some intelligent answers!

Oh man, that sounds like a bear to deal with. It's a shame when controls, events, etc. are erratic and what should be simple and just work, doesn't. For me, it's worse when something *almost* works. I'll spend a ton of time trying to figure out what I'm doing wrong before deciding the thing is broken and can't be fixed!

Hope it all works out for you.

Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform