KaptainKrayola

So the Kaptain is here writing a quick little C# app to automate some form field filling.  He was going to share it with a friend of his but has run into some issues.

For some reason on the Kaptain's desktop PC and laptop the program works just ding dong dandy but on his friend's computer it will navigate to the page correctly but never fill in the form fields.  So, we were thinking it was an issue with missing a dependent DLL or something else silly so the Kaptain made an install pack for it that would register the dependent DLLs - no luck.  He wrote a similar app a while back and had a similar problem and making the installer that registers the DLLs seemed to fix it (or it was voodoo we aren't sure) but that doesn't seem to be helping this time.

Has anyone done something similar and had similar issues or have some clue as to WTF the problem is?  The Kaptain is a C# newbie so he's not sure which direction to look.

The program uses the axWebBrowser which is different than the standard web browser control.  The DLLs it includes as dependencies are axInterop.SHDocVw.DLL and Interop.SHDocVw.DLL.  It also says ieframe.dll is a dependency but upon install for the Kaptain and everyone else it says it fails to register ieframe.dll so we dunno WTF that is about.

help?


thedarkness

hey skipper,

presumably you are setting mshtml.IHTMLElement.innerText on an element you are aquiring through mshtml.HTMLDocument.getElementById ? If that's the case perhaps you should throw some debugging code in there to make sure you have the object and it is the object you think it is. This could be a DOM issue, are we talking same version of IE on each

mac

 hine with same security settings?

them's my thoughts for now. pm me if you need to skipper, I'll give u a hand if I can.

Cheers,
td

KaptainKrayola

Since it worked on all of my computers and only my computers i decided to format and reinstall windows on my work PC because it seemed that my computers all had something that most didn't

so, with doing that and running the app it ap

pear

 s that for some reason the axWebBrowser1_DocumentComplete event isn't firing. 

I have sent it to multiple URLs and it never fires that event

any ideas?

KaptainKrayola

Ok!

so I have switched from using the axWebbrowser and mshtml to just using the built in

.net

  webbrowser control.  I can fill in text boxes, etc now no problem but im running into the issue of getting it to submit the form.

MS says you can do something like:

InvokeMember("Submit");

(they use Reset for an example) but that is doing exactly 0 for me.

ideas?

thedarkness


System::Windows::Forms::HtmlElement^ pSubmit = this->m_doc->GetElementById( "Submit" );
pSubmit->InvokeMember( "Click" );

thedarkness

quote author=KaptainKrayola link=topic=322.msg2238#msg2238 date=1182195779

Since it worked on all of my computers and only my computers i decided to format and reinstall windows on my work PC because it seemed that my computers all had something that most didn't

so, with doing that and running the app it ap

pear

 s that for some reason the axWebBrowser1_DocumentComplete event isn't firing. 

I have sent it to multiple URLs and it never fires that event

any ideas?



// Add an event handler for the "doc complete" event
SHDocVw:ApplauseWebBrowserEvents2_DocumentCompleteEventHandler^ DDocComplete =  ( gcnew SHDocVw:ApplauseWebBrowserEvents2_DocumentCompleteEventHandler(this, &myApp::Form1:ApplauseocumentComplete) );
m_ie->ApplauseocumentComplete += DDocComplete;


That's what I use. these examples I'm giving you are in managed C++ of course but they should be easy enough to port. This is a definition of a "delegate" function/method which are used quite extensively in do

tnet

 . Search for "documentcomplete event delegate" on G.

Here's what the DocumentComplete method looks like;


private: System::Void DocumentComplete( System::Object^ pDisp, ref class System::Object^% URL )
{
m_bIsDocComplete = true;

switch( m_pageReference )
{
case 10:
this->m_pageReference = 20;
this->CheckOut();
break;

case 20:
this->m_pageReference = 30;
this->ValidateCheckout();
break;

case 30:
this->m_pageReference = 40;
this->SelectAddress();
break;

case 40:
this->m_pageReference = 50;
this->SelectContinue();

case 50:
this->m_pageReference = 60;
this->PlaceOrder();

default:
break;

}

}


It performs a different task depending on the value of m_pageReference, this is because I load multiple pages in this particular app.

HTH,
td


Perkiset's Place Home   Politics @ Perkiset's