OK... I had a program (originally written using VC 6.0) that, as part of its function, retrieves values from an open Internet Explorer window. However, when I compile the SAME EXACT code that works in VC6 in VS.NET, the retrieve function fails. In the code, once I get the IE window, I check for frames: IDispatchPtr dis; IHTMLDocument2Ptr doc; spBrowser->get_Document(&dis); //spBrowser is earlier declared and initialized dis->QueryInterface(&doc); IHTMLFramesCollection2* frames; long num; doc->get_frames(&frames); /* THIS IS THE PROBLEM if (frames == NULL) ///failed else { .... } In VC6, the get_frames function returns a valid address everytime, whether it is a framesize of 1, or 2 or whatever... However, when compiled in VS.NET, 'frames' ALWAYS ends up NULL. What would cause this? I am using the VS.net Beta 2. Is this a known problem that is fixed in the final release? Is there a solution?? Or is the problem something else entirely? This was tested and confirmed using both IE5.5 and IE6. Thanks! Adam cabadam@houston.rr.com
Cabadam
Posts
-
Help with VC & IE -
Getting/Sending information to/from IEThis won't work for me- I need to manipulate a page that the user will already have open. I will not actually be submitting the information, and I can't retrieve the HTML from the server again. I need to see what IE itself has retrieved. The code will have come from a CGI script that output would differ if I simply gave it the URL. Adam cabadam@houston.rr.com
-
Getting/Sending information to/from IEOK, lets say there is an IE (or maybe Netscape too, although, that will be later) window open. The page it has loaded contains a form with several edit boxes. 1) Is there a way for me to get the source of that page straight from IE (NOT by downloading it again)? 2) Is there a way for me to either: a) Retrieve what information might be in those edit boxes? and b) Write info to those edit boxes? Adam cabadam@houston.rr.com
-
Easy (?) Dialog questionThanks! Adam cabadam@houston.rr.com
-
Easy (?) Dialog questionI have a dialog based app. In the dialog editor I added the maximize/minimize box. I want the dialog box to START maximized. How can I do this? Thx Adam cabadam@houston.rr.com
-
HTTP Connection question...Oh duh!! On the catch, I had the pEx as CInternetException, not CInternetException* That did it... thx Adam cabadam@houston.rr.com
-
HTTP Connection question...I am using CInternetSession, CHttpConnection, and CHttpFile to get a file from an HTTP server. I am having a problem though determining if the initial connection succeeded or not. If the server is 'off' then the code seems to execute despite my 'ifs' and produces an exception. If I put the statement throwing the exception into a try-catch, it isn't caught, and crashes the program anyway. CInternetSession net; CHttpConnection* http = NULL; CHttpFile* file = NULL; http = net.GetHttpConnection("cabadam.homeip.net"); if (http == NULL) { status += "Failed to connect to server!\r\n"; dlg->edit_status.SetWindowText(status); dlg->GetDlgItem(IDC_BUTTON_CONTINUE)->EnableWindow(1); return 1; } file = http->OpenRequest(CHttpConnection::HTTP_VERB_GET,"version.txt"); try { file->SendRequest(); //THIS STATEMENT crashes the program even though it is inside a try catch } catch (CInternetException pEx) { status += "Failed to connect to server!\r\n"; dlg->edit_status.SetWindowText(status); dlg->GetDlgItem(IDC_BUTTON_CONTINUE)->EnableWindow(1); return 1; } I have tried several different things, but I haven't been able to figure out how to determine if it was unable to connect with the server. Am I doing something wrong? Or is there an easier way to do this? Thanks! Adam cabadam@houston.rr.com
-
Access Database Help[snip] There is another way to do this and use the generic recordset that is posted in the Database section. [/snip] What do you mean? This is my first venture into doing anythign with databases (at least programatically, I HAVE used Access before :)) I tried to look into the Enroll MFC sample, but it requires some database that you can't download from online (and I can't find my VStudio stuff right now...) Adam cabadam@houston.rr.com
-
Access Database HelpOK, but it gives me 'unrecognized database format' when creating the class and selecting which database I want to use... I am using Access 2000. Will that not work? Adam cabadam@houston.rr.com
-
Access Database HelpOK, I have made an app that parses a bunch of files and I have all the data stored into various arrays. I would like to be able to store this information into an Access database. I have no clue where to start on accessing Access and writing information to a database though. If anyone could help me out and point me in the right direction I'd be greatful! Adam cabadam@houston.rr.com
-
Getting HTML of a document loaded in CHTMLViewCComPtr m_pBody; But... isn't CComPtr a templated class? What would I use as the template type? Adam cabadam@houston.rr.com
-
Getting HTML of a document loaded in CHTMLViewAlright, I have created an SDI app and, using Navigate2() have loaded a page. I have used the OnDocumentComplete() to allow me to know when it is done loading. How can I get the source code for that page? Thanks! Adam cabadam@houston.rr.com
-
HTTP Post QuestionOK... I basically understand how the 'get' portion of a HTTP connection works... but now I have another question. I am writing a program that will automaticalliy go through various CGI pages, entering the necessary input and parsing the output. I should be able to handle the parsing, but my question lies in how exactly to 'post' the variables from a form to the CGI page. EX: The first page has a form that posts a text field named 'Account' and a password field named 'Password' to "main.cgi". I assume you would get a CHttpFile* that is to the main.cgi and do: http_file->SendRequest But it is here that I am not sure what to fill in... What headers would I need to send? And MSDN says that the lpOptional would usually be the information for a POST operation... but what exactly would I put there? Thanks for any help you can give! Adam cabadam@houston.rr.com
-
Yet another release/debug problem...Yeah, I know you guys get this one a lot, I've seen them... But I have another instance of a program running fine in debug and crashing in release. I have set up a configuration that basically mimics as many settings of "release" as possible, but allows me to go through in debug mode and trace code. Ok, here we go: I have a dialog app. The main dialog (we'll call it Dialog A) that opens has a button on it that results in opening Dialog B. Upon clicking this button I get an error of: "The instruction at '0x004229dd' referenced memory at '0x00000401'. The memory could not be 'read'." So I traced it. It occurs AFTER the DialogB::OnInitDialog() call. This is a screenshot of the debug window showing where it 'died' ftp://cabadam.homeip.net/sshot.jpg I am unable to determine why it crashed, maybe one of you guys could help me out. Thanks! Adam cabadam@houston.rr.com
-
PatchingThat download goes incredibly slow and disconnects constantly. Anybody else have a suggestion? Adam cabadam@houston.rr.com
-
PatchingWhat is a good, relatively simple (and *free* preferably) program to create patches with? I had experimented with BinPatch for a little bit, but the one thing I don't like about that is that it always creates backups on the users computer of the file(s) it patches. In the docs for it, it said that in the next version, there would be a way to set backup to none, but apparently there never was a "next version". Also I would love to have a GUI interface for the patch creator, but the one for download (www.binpatch.com) is corrupted... Does anybody else know of a good program I could use? Thanks! Adam cabadam@houston.rr.com
-
FTP QuestionLOL OK.. Thats what I deserve for trying to think while tired. Turns out my socket was going out of scope and being destroyed... *face turns red* OK-- now I got my welcome message and I have read the RFC on FTP protocol so I understand pretty much how FTP is supposed to work. Now I need to actually send commands. :) Ok, lets say I have: CString command = "USER someone"; What do I need to tack on to the end of command to correctly send it? I know the RFC said to have a carriage return and line feed. Isn't that \r\n? I tried that and nothing happened after I sent it. Tried adding basically every combination ("\r", "\n", "\r\n", "\n\r", "") Still nothing worked. Also, to send it, I should just do this correct: char* buf = command.GetBuffer(command.GetLength()); Send(buf, sizeof(buf)); Thanks! Adam cabadam@houston.rr.com
-
How to program a ftp-serverOk... it wasn't quite that drastic :) Adam cabadam@houston.rr.com
-
FTP QuestionOk, still problem though: I am using a derived CAsyncSocket (CFtpSocket) for initial connection. (Tried this with both CSocket and CAsyncSocket) When I call the Connect(host,port), it returns true, giving me the initial socket connection. However, at that point, shouldn't I get a welcome message? I have been comparing what my program gives to what CuteFTP gives, and it says: STATUS:> Connect: Monday 17:10:21 05-07-2001 STATUS:> Connecting to ftp.angelfire.com STATUS:> Connecting to ftp.angelfire.com (ip = 216.33.20.80) STATUS:> Socket connected. Waiting for welcome message... 220 Hi! Welcome to Angelfire's NEW FTP. But in my program I never get that welcome message. It just stops after the socket connects. I have the OnReceive() overwritten and it SHOULD call that when I get the welcome message right? Or am I missing something? OnReceive is never getting called in my program. Adam cabadam@houston.rr.com
-
FTP QuestionHow would I open a connection to an FTP server such that I could send actual commands to the server (ex: LIST, etc) and view the actual responses the server gives (Welcome messages, etc). I know how to use the CFtpConnection to do basic FTP stuff, but I don't think it does this. Anyone have any ideas? Adam cabadam@houston.rr.com