Hey folks! I'm installing an Internet application which requires a cookie to authenticate. Because it's a low-risk application, I'm using persistent sesssions. I'd like users to have to enter a login/password to access the service. There are a bunch of issues with this (checking for valid input, not letting users advance in the installation if they can't enter their login/pass correctly, grabbing the cookie back from the response) and I'd like to know if there are any *free* (not GPL or LPGL) classes or projects, which would allow me to plugin this feature into my application. i.e. i'm looking for login functionality like you might see such as with MSN Messenger. C++ / MFC is available, but no .NET. waiting hopefully :P, chasetoys -- modified at 2:29 Sunday 11th June, 2006
chasetoys
Posts
-
http post & cookie response... for 'logins' -
Stepping thru binary of debug version produces different result than running the debug binary (MSVS)Hey folks I'm writing .html files to disk, and when I run my application normally, I get several garbage characters. When I step thru the debugger and look at the functions CreateFile and WriteFile and what I'm passing them, the program not passes appropriate values, but actuall produces files free of any garbage. I'm really concerned that if stepping thru the debugger doesn't find these errors, I'll never be able to find them by hand. Any ideas on making the debugger comply with the real world (turning off stuf.. etc)? Thanks!
-
XML/Soap/HTTP Questions (help your n00b)Hey folks: I have some questions about XML/Soap/HTTP... but first, requirements! 0) Open a socket to a server 1) Receive XML data from a server 1.5) Close that socket 2) Parse through the XML file 3) Download all associated web content for each given URI in the XML file 4) Open a socket to the server 5) Send an XML file back to the server 6) Server will process this, and should send back a response, whether the update was successful - or not. 7) I need to prevent malicious users from trying to update *other people's accounts*... i.e. the user should *only* be able to update dta bsed on their own userId, but not an arbitrary user id. 8) MFC can be used, if it makes it any easier... no .NET however. Questions: 1) As far as sending/receiving XML files from from a server, have I missed any steps? 2) Do I need to do anything with SOAP here? What would the advantage of using SOAP be? 3) How do I prevent malicious users from updating other people's acccounts? 4) How should I approach the socket issue? 5) How can I make the socket opening work *no matter* which firewall you have, or *no matter which router* you use? 6) The data I'm sending is all web content, so can I use a special port on the Windows side that says that all Internet traffic is OK? 7) I only want the user to have to approve my applicaation's ability to access the Internet, once. How can I ensure they don't have to continue to grant exceptions via their firewall? 8) Is there a way of grabbing a free port from Windows? 9) Is there a way of *reserving* a specific port on Windows so that no other appliction will be able to use it? (I'm afraid another app might steal my port, or that it would be occupying the port when my app needs to use it). Help your local n00bie! :P Responses/how-tos/articles/guides/links/explanations would all be useful. Please phrase your response something a n00bie can understand. Thanks very much for your help in advance? -chasetoys
-
XML Parsing & Downloading a URIHey folks: How can I: 1) Easily parse thru XML (I can use MFC classes if this makes it any easier, but no .NET) 2) Once I have a URI, how can I download *all associated content* i.e. images/text/whatever is on the webpage... and how can I specify where all of that goes? 3) How can I send XML over HTTP? Classes/methods/articles/etc.... would be very helpful. Help your local noob. :P
-
MFC: Easy way to download XML & HTML files to disk?Are there any C++ libraries available for parsing XML? I'd eventually like to deploy on other platforms, and I'd like to minimize Windows dependencies if possible. Although if its easier with Windows libraries, I'll gladly use them. -chasetoys
-
MFC: Easy way to download XML & HTML files to disk?Hey folks, I'm using C++ & MFC (no .NET). I need to accomplish the following, and I really don't know how to go about any of it. If you know of links/ways to do it 1) Go grab an XML file on the server, and download it, saving it to disk (if necessary) or justu loading it into memory. 2) Parse the xml files and figure out the URIs that exist 3) Go to each URI and then download *all* content viewable on the webpage (images, etc...) so offline viewing is enabled. 4) Be able to send XML log files back to the server 5) I can catch all this stuff on the web site, these are more about C++ & Windows development. Thanks very much in advance!
-
Questions about the HTTP protocolI'm trying to think of the overall picture of how this would work. And I'd like to run some more questions by you: More Thoughts: * I guess I'd want to run Apache on a Linux box to be the web server * I'd like to use RubyOnRails to be the dynamic language that determines whether there is new web content to download * I'd like to use BITS (Background Intelligent Transfer Service) on the Windows side, to transfer data over HTTP? More questions: * Can .txt files be transferred over the HTTP protocol without firelarms raising an alarm? * Is there a reason I should *NOT* use BITS on the Windows side to facilitate the transfer? It has a bunch of useful features it seems. If not, what method would you reccomend? * Does Apache with RubyOnRails meet the following qualifications of BITS?: Background Intelligent Transfer Service BITS supports HTTP and HTTPS downloads and uploads and requires that the server supports the HTTP/1.1 protocol. For downloads, the HTTP server's Head method must return the file size and its Get method must support the Content-Range and Content-Length headers. As a result, BITS only transfers static file content and generates an error if you try to transfer dynamic content, unless the ASP, ISAPI, or CGI script supports the Content-Range and Content-Length headers. BITS can use an HTTP/1.0 server as long as it meets the Head and Get method requirements. To support downloading ranges of a file, the server must support the following requirements: * Allow MIME headers to include the standard Content-Range and Content-Type headers, plus a maximum of 180 bytes of other headers. * Allow a maximum of two CR/LFs between the HTTP headers and the first boundary string. Thanks so much!!! Edit/Delete Message
-
Questions about the HTTP protocolMike: Thanks for your response, couple questions, 1) What prevents applictaions from transferring everything over port 80.... I thought firewalls protect agianst non HTTP looking things getting downloaded over port 80. 2) If you are using port 80, what if there are other applictions trying to use that port? You can't transfer bits simultaneously over one connection right? 3) Web Service? How does this work, and would I want to use this over BITS? Lookin forward to hearing from you, chasetoys -- modified at 4:45 Saturday 13th May, 2006
-
Questions about the HTTP protocolHey folks... I'd love your help on the HTTP protocol, as I'm trying to integrate it with a client application I'm developing: Quick description of what I propose to do with the protocol: * Have a unique URI (mydomain.com/uniqueID) and then go via my C++ MFC client and hit that URI. * Perform server side code to determine whether there are new files to download * Files are all web content files with the exception of .txt files (so JPEGs, HTML, CSS, etc....) * If there are new files to download, I want the client to download *all of it at once*..., effectively downloading all the files from server using the HTTP protocol. * If there are not new files to download, I'd like for the client to download nothing. * I would also like to upload .txt files to the server ever hour, read their contents, and insert/update them into my database schema. * I'd like to use Ruby On Rails if this makes a difference. Here are my questions: 1) Can the HTTP protocol download multiple files (say 10 HTML files, 20 JPEGs, 10 CSS files) from one URI at once? 1.5) Can HTTP protocol be used to download .txt files? 1.6) Is there anything that the HTTP protocol cannot be used to download? 2) Will my proposed solution of domain.com/uniqueID work? 3) Can HTTP actually be used to upload the text file to the server? 4) Is there a nice way of re-assembling the packets on the Windows side into HTML, JPEG files, etc...? Such as an existing module or source/tutorials you might know of. 5) May I use port 80 on the Windows client side, since the type of traffic I'm transferring is web content. 6) Is there some way Windows checks to make sure only web content files are being transferred over port 80? 7) Is there a good intro/primer for sockets programming on the Windows side? Thank you so much in advance! -chasetoys -- modified at 1:13 Saturday 13th May, 2006
-
Footer Problems! (5 Side by Side DIV elements, at bottom of the page)So what I want is a footer that is *always* at the bottom of my browser window (I'm only optimizing for Internet Explorer if that makes a difference)..... But I want it to be comprised of 5 side by side DIV elements. I've also got a container DIV elements where everything is inside of it. I've tried two methods with varying results: 1) Make the footers have absolute positioning with bottom =0. This makes it so one DIV element is at the very bottom but the other 4 don't show up 2) Make the footers relative positioning, this makes it so that they are side by side, but occur after the last element (in other words, not at the very bottom). 3) I tried putting the footers inside/outside the wrapper DIV with no effect. Here is the code: #footer1, footer2, footer3, footer4, footer5{ color: #dbdfee; height: 65px; width: 20%; text-align: left; background-color: transparent; background-image: url(img/bg_top.png); background-repeat: repeat-x; background-position: bottom; margin-top: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0%; position:relative; clear: none; float: left; } #footer5{ width: 19.95%; float: left; } #wrapper-page{ width: 100%; background: #b4c2d4 url(img/bg_grad.png) repeat-x center top; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; position: relative; min-height: 100%; } Ideas? Thanks very much in advance! This is also a question of style... if you're going to have different things going on in each DIV I thought you should divide it into different DIVs... I want to make sure my 5 DIV approach is actually correct.
-
Hiding a data file from usersGreat advice Phil thanks! A couple of clairifications: 1) Would you advocate combining methods both A & B? 2) Would you just replace the tampered file with the one you have in the Windows directory? 3) Does Windows allow you to use the WriteFile API to write in the Windows directory? I tried to do that once but couldn't... i.e. where would you put the bacakup file, and are you sure Windows lets you do that? 4) Is there a simple API to encrypt/decrypt an ASCII text file? Or is KISS more important here? Thanks!
-
I can run my app, but no one else can ;(... why?My apologies... Its a MFC (no .NET project)... target install base are WinXP computers, but I'd like it to run on 98SE and up. I tried to link everything statically. The user who tried installing it had WinXP Pro SE installed. Could the error be that I didn't specify which version of Windows I wanted it to work on in the header files? I.e. I didn't have: #define WINVER 0x0410 or #define _WIN32_Windows 0x0410 Would this have fixed it?
-
I can run my app, but no one else can ;(... why?Users get the message: "This application has failed to start because the application configuration is incorrect. Reinstalling your application may fix the problem." Does anyone know how to solve this problem? I'd like to make sure my application runs on 98SE, WinXP Pro etc... any help? Thanks very much in advance! using visual studio 2005... (MFC app, NO .NET) (using the NSIS installer) build log follows: Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001D49765820.rsp" with contents [ /O2 /Ob1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_BUILDING_ON_WIN2K" /D "_AFXDLL" /GF /FD /EHsc /MD /Gy /Yu"stdafx.h" /Fp".\ReleaseW2k/File1.pch" /Fo".\ReleaseW2k/" /Fd".\ReleaseW2k/" /W4 /c /TP ".\File4.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001D49765820.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001E49765820.rsp" with contents [ /O2 /Ob1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_BUILDING_ON_WIN2K" /D "_AFXDLL" /GF /FD /EHsc /MD /Gy /Yu"stdafx.h" /Fp".\ReleaseW2k/File1.pch" /Fo".\ReleaseW2k/" /Fd".\ReleaseW2k/" /W4 /c /TP ".\File1.cpp" ".\File2.cpp" ".\File6.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001E49765820.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001F49765820.rsp" with contents [ /OUT:".\ReleaseW2k/MyAppName.exe" /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:".\ReleaseW2k\MyAppName.exe.intermediate.manifest" /PDB:".\ReleaseW2k/File1.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 shell32.lib kernel32.lib user32.lib ".\ReleaseW2k\File3.obj" ".\ReleaseW2k\File4.obj" ".\ReleaseW2k\File5.obj" ".\ReleaseW2k\File6.obj" ".\ReleaseW2k\File2.obj" ".\ReleaseW2k\File7.obj" ".\ReleaseW2k\StdAfx.obj" ".\ReleaseW2k\File1.obj" ".\ReleaseW2k\File1.res" ] Creating command line "link.exe @"c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001F49765820.rsp" /NOLOGO /ERRORREPORT:PROMPT" Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00002049765820.rsp" with contents [ /outputresource:".\ReleaseW2k\MyApp
-
Hiding a data file from usersHey folks: Right now we have an ASCII tab-delimited data file that is used in our applications. We really don't want the user accessing this file as they could really mess up the application by screwing up the data file. Simply by making the file hidden is security by obfuscation, and we want someway of hiding the data. Ideally, we wouldn't have to encrypt file, perhaps there's a way of preventing the USER from modifying this file, and only allowing our application to access it... someway of locking the file from the user? I'm a C++/Win32 API newbie, so please make the answers appropriate for someone of my skill. Hopefully there is some easy way of doing this, David
-
Choices for easy-to-use installers for newbies (registry access a must)Hey folks I need to create an installer for my application. I have some requirements: * It must be super simple for a C++/newbie to use. * It must be able to install a few registry keys in the HKEY_LOCAL_MACHINE hive. * It must be able to easily install files to the Program Files/AppName directory as well as the Windows directory * It must be able to have the option of running the newly installed applicastion upon installation. * It must be able to allow uninstallations from the control panel->Add/Remove programs dialog * Upon uninstallation it must check that the application is not currently running, or if it is, shut it down to continue the uninstallation process. * Upon uninstallation it must be able to uninstall all registry keys it created. * Hopefully it's free or very low cost. Anybody have some good options for this? Thanks!
-
Is there a potential problem with this line of code?int begin, end; // search through using STL stringObject.find("searchForString") if( (begin != string::npos) && (end != string::npos)) // Warning: warning C4389: '!=' : signed/unsigned mismatch Thanks in advance!
-
Mute my application only.... not others running (windowxs xp...)So I know you can do this with Windows... cuz I turn winamp all the way down and I can still hear other applications... I want to be able to mute only my application... how can I do this? Thanks!
-
Is there a way to include parts of a html file in another html file?So something where you're like: /* happy html */ PutHTMLFromFile("file address"); /* more html */ Thanks!
-
Evil Circular dependency problemCould you please elaborate? I'm kind of a newbie
-
Evil Circular dependency problemI basically have foo.h #include "bar.h" bar.h #include "foo.h" and it results in fatal error C1014: too many include files : depth = 1024. So I tried doing '#pragma once' in each file, no luck. I then tried doing #idndef UNIQUE_IDENTIFIER #define UNIQUE_IDENTIFIER // all header code #endif That didn't work so I tried using the pragma once statement & the above with no luck. When I say the previous solutions 'didn't work' I mean that objects from foo.h could not be recognized by methods that required them in bar.h, the compiler didn't know what they were. Ideas? Thanks!