Jump to content
Xtreme .Net Talk

joe_pool_is

Avatar/Signature
  • Posts

    512
  • Joined

  • Last visited

Everything posted by joe_pool_is

  1. I have a MS Access database with the entries formatted differently: Text, Memo, Hyperlink, Date/Time, Yes/No. How would I create OleDbType parameters to match these?
  2. "self.document.forms[0].elements[0]": Self is the current window, document is what "self" is displaying (an webpage), forms[0] is the first form you have listed on your page, and elements[0] is the first element. You might want to check out this MSDN article: http://msdn.microsoft.com/msdnmag/issues/04/08/CuttingEdge/ This discusses methods both in ASP.NET 1.x and the "soon to be released" v2.0
  3. Okay, I'm giving advice on JavaScript, and I really don't know much about it... I found something on a JavaScript site with a Google search. Would something like this work? <html> <head> <script> function BtnWrite() { self.document.forms[0].elements[0].value=event.clientX; } </script> </head> <body> <form name="msgform" action=""> <input type="button" value="Click Here To See" onClick="BtnWrite()"> </form> </body>It uses a button to write text to, and that might be something you could modify to write to something else (I'm not sure what types are allowed for INPUT tags). Just keep in mind that whatever you write to in JavaScript has to be accessible in ASP.NET as well.
  4. Wile, This certainly has me re-thinking my whole strategy. Give me some time to look into this, and I might post again later if I can narrow down what the problems are stemming from after a little reworking. FYI: C++ is correct! What's *really* going to make you wonder what I am doing here is the fact that I am writing this in Borland Builder 6. Well, this board has more activity (i.e. faster responses) than anything the Borland people have. But wait! There's more: Ya know those DownloadTextFile() and DownloadSetupFile() functions? Those were written to help simplify code for display purposes. The actual functions are in fact only one function: bool Download(char* downloadFile, char* saveAs); Still more details: The Download() function is part of an old component called FastNet by the company NetMasters. Our company wants to use this because they already own it and they say it works with Borland, Linux, and maybe others. If I had posted all of that information before, no one would have responded! Funny how people work, huh? :)
  5. I have developed a class that updates our customer's software when a newer version is detected on our FTP site. My objective is to make the interface as simple as possible so that other developers do not need to know anything about how threads work in order to use it. I have, therefore, designed a simple public method as follows: int cFTP::FtpStart(bool bThread); where bThread equal to false disables threading and true enables threading. My class begins by FTPing into our company's server and downloading a small (~200 byte) text file containing the software upgrade version. If the upgrade is newer than what they are running, a MessageBox is displayed, asking permission to download it. (Updates could range from 3 - 20 MB, and our customers could have slow connections. So this update could potentially take a long time!) As long as bThread is set to false, the class works. It is when I set this value to true that I experience problems, and it is certainly in the unique way that I have implemented _beginthread. I am hoping that someone will be able to see why my technique can not be used, and suggest ideas to fix it. Here is the (greatly simplified) code: void kickOff(void* pObj) { ((cFTP*)pObj)->FtpStart(false); } int cFTP::FtpStart(bool bThread) { if (bThread == true) { void* pObject; pObject = (void*)this; _beginthread(kickOff, 4096, pObject); return 1; } // This section is always called DownloadTextFile(); if (UpdateAvailable() == true) { if (MessageBox(NULL, "An update is available. Download it?", "AutoUpdate", MB_YESNO) == IDNO) { return 0; } DownloadSetupFile(); } return 0; } I was unable to pass my class method FtpStart to _beginthread, so I devised a "work around" by calling kickOff to do it for me. Apparently, I have created something that I was not supposed to, but I can not think of a better way of doing it. The compiler does not see any errors, but the program becomes non-responsive when the MessageBox returns IDYES (even an IDNO response causes no issues). I would certainly appreciate any help. Regards, Joe
  6. I replaced Response.Cookies.Add(bigCookie);with Response.AppendCookie(bigCookie);but my page still loads up with Label2.Text = "bigCookie = null". Any other ideas?
  7. You might be able to place a couple of Labels in your form, set the .Visibility = false, then set Label1.Text = z.style.pixelLeft, and Label2.Text = z.style.pixelTop. That might work in JavaScript, but I don't know a lot about JS, so I could be lying. If you can't get this technique to work, start a new thread and ask how to set a value in ASP that can be read by JS, and vice versa. Not sure how all this will look in your code, either. Once you get it working, post a link so I can see what you made. It sounds interesting!
  8. Can anyone see why my bigCookie, "cookieMonster", is not being set?public void Page_Load (object sender, System.EventArgs e) { string strUserId = "jdoe"; string strName = "John Doe"; string strDate = DateTime.Now.ToString(); HttpCookie bigCookie = Request.Cookies["cookieMonster"]; if (IsPostBack) { // Page Loads for first time Label1.Text = "Is Postback"; } else { // User Clicked a button Label1.Text = "Is Not Postback"; } if (bigCookie == null) { Label2.Text = "bigCookie = null"; bigCookie = new HttpCookie("cookieMonster"); bigCookie.Values.Add("userId", strUserId); bigCookie.Values.Add("name", strName); bigCookie.Values.Add("lastVisit", strDate); bigCookie.Expires = DateTime.Now.AddDays(365); bigCookie.Path = Server.MapPath("/"); Response.Cookies.Add(bigCookie); } else if (bigCookie["userId"].ToString() == "") { Label2.Text = "bigCookie = (blank)"; bigCookie = new HttpCookie("cookieMonster"); bigCookie.Values.Add("userId", strUserId); bigCookie.Values.Add("name", strName); bigCookie.Values.Add("lastVisit", strDate); bigCookie.Expires = DateTime.Now.AddDays(365); bigCookie.Path = Server.MapPath("/"); Response.Cookies.Add(bigCookie); } else { Label2.Text = "bigCookie value set"; strUserId = bigCookie["userId"].ToString(); strName = bigCookie["name"].ToString(); strDate = bigCookie["lastVisit"].ToString(); } } Label2.Text is always "bigCookie = null" whether IsPostBack is true or not, but I don't know how I should rewrite the code to make the changes. Am I writing this cookie the wrong way? Am I reading it in the wrong way? Any suggestions???
  9. When a button is clicked, your page calls the Page_Load() function again, which resets your image to your startup coordinates. You need to check the "IsPostback" value. If "IsPostback == true", the page is loading for the first time and you would want to set your coordinates for your image; if it is false, it is reloading after an event that was triggered, and you can either hope the coordinates are unchanged or reload them from variables you have set. Now to the second question about the image going behind another element on your form: Set a z-index for the image and the other element. You will need to set the z-index order of the element to be lower than the z-index of your image, so that when the image nears the proximity of the other element, the browser sees that the element is "below" the image. Hope all turns out well!
  10. You're doing some interesting stuff that I've never seen, but here's an idea: Take the part of your code that says: y=event.clientY And delete it! That way, the "y" value can not be changed. (How did my font turn blue???)
  11. I think ASP.NET 2.0 will support something like this with the datasets (at least I've seen a video that mentioned it), but it hasn't been released yet.
  12. kahlua001 and PlausiblyDamp: I have one form with two panels. How would I get the "meta tag" or "JS" to be idle when one panel is active, then perform its job when the other panel becomes active? Yes, I could use two separate webpages, but this admits defeat!
  13. Looks like this makes everything sort of freeze up for a bit, which is not what we are trying to do. A little background: This is for a form mailer with two panel controls: Panel1 is visible and has the standard "email form" features; Panel2 is hidden and displays a confirmation to the visitor after the message has been sent. We want the website to show Panel2 after the message has been submitted, then return to our homepage after x milliseconds ...unless the visitor decides to browse elsewhere, of course. Sleep() just seems to halt everything; Panel2 never shows. Am I using it incorrectly, or is there another function that I want for this? I would use the JavaScript setTimeout() function, but my code does NOT like this.
  14. Doesn't work. I got: Compiler Error Message: CS0246: The type or namespace name 'system' could not be found (are you missing a using directive or an assembly reference?) Source Error: [/b]Line 132: Line 133: public void GoHome(object sender, System.EventArgs e) { [color=red]Line 134: system.thread.sleep(20000);[/color] Line 135: Response.Redirect([url="http://www.google.com/"]http://www.google.com/[/url]); Line 136: }
  15. Does anyone know how to make the form sleep in ASP.NET? I want the page to sleep for a bit before redirecting to another page. Regards, Joe
  16. Wow! That worked great! I had never encountered this Literal control before. Thanks, PD!
  17. How can I write information to a new Panel control? The information will have HTML tags, so I can not drop a Label or TextBox onto the panel and write to it. I've been looking for something similar to a Document.Write method: Panel2.Write = "<body><table>...</table></body>"; Obviously, this does not work. Currently, I have 2 panels on my form, one visible and the other hidden. On Submit, the panels reverse rolls and I need to write information to this second panel. Won't someone please show me the way? I seem to have lost it.
  18. Google has a map of the moon at http://moon.google.com/. When you click on one of the Apollo mission links, a balloon pops up on its coordinates on the map. Does anyone know how to pop up and place a balloon like that? It's a really snazzy effect.
  19. I am using MFC and C++ in my ftp program (the targets that run it will not have the .NET framework installed). I followed a nice little example on downloading files via ftp, and it's first line was to include the WinInet.h file: #include <wininet.h>When I try to compile my small program, I get errors that point back to code that is declared in the WinInet.h file. I have started to include other header files that include definitions to things that WinInet.h needs (i.e. DWORD in windef.h), but now I am getting errors in the declarations found in those new files! Does someone know if there is a basic header file that I missed somewhere? (code is in this ftp zip file http://www.xtremedotnettalk.com/attachment.php?attachmentid=&stc=1) FTP.zip
  20. Interesting Jam Man. Your "updater" seems to be just what I am looking for using XML. I will look into it. Thanks.
  21. I'm looking for a way to connect to one of our remote sites via FTP. I've been searching MSDN, but so far I am unable to find a topic detailing how to do this. The closest I found was an article on IIS, which may now encapsulate FTP features. I was not readily able to see how to get my application to do basic FTP commands, however. My application need to connect to ftp into the server and download a small text file after booting up (this text file will function as a security key). Occasionally, as updates come out, this small text file will also notify the program that it needs to download the latest patches. What keywords should I be looking under? I have been using "ftp sdk" and "ftp skd msdn", but these pulled up lists that were not what I wanted.
  22. VC++ book recommendations? This brings up another question: Could anyone recommend a good book for learning modern techniques in Visual C++ .NET? The Teach Yourself in 21-Days book that I am using lists "First Printing: December 2001" below the 2nd Edition title that simply says "Copyright @ 2002 by Sams Publishing."
  23. Am I missing something? I started programming in VB.NET a few years back. Drop a TextBox onto a form, changed its name from Textbox1 to "txtName", then collect this textbox's value during runtime by reading "txtName.Text". Last year, I started working with Borland Builder 6.0. A few things changed when converting to Builder/C++: Now I dropped a TEdit module onto a form, changed its name to "Name", and collected the runtime information using "Name->Text". Their are other features that get a lot more involved with programming than VB.NET does, but that is to be expected. Borland's VCL is impressive! Now I am starting to work my way into VC++, and I was expecting Microsoft to take a good idea (Borland Builder) and expand on it. What I am finding is terrible: I drop an Edit Control onto a form, rename its ID to "IDC_NAME", then attach a CString "m_strMessage" variable to the form by right-clicking it and using a visual attachment tool (?). To get or set information from this Edit Control, I have to first call an UpdateData() function, then read or write to my "m_strMessage" before calling the UpdateData() function again. Is Microsoft's VC++ Team on crack? I am using the "SAMS Teach Yourself Visual C++ .NET in 21 Days", and I am on Day 6. So far, each of the examples in the chapters have started with a new MFC Application Wizard, but making the example work includes an unbelievable number of detailed steps. Why has Microsoft put together a programming language that is so difficult and counter-intuitive as compared to their other products? Granted, I can still create a blank C++ program that works great, but once I open up a new MFC Application Wizard and start programming, simplicity is lost! I can not even tell you where my "m_strMessage" variable exists in the project! Modifying its data type from CString to BOOL or adding another variable programatically seems impossible.
×
×
  • Create New...