Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
A

awah

@awah
About
Posts
36
Topics
24
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Parasing website data : intermitten rubbish characters retrived
    A awah

    yes, how do i solve this problem? it doesnt put any null character

    C / C++ / MFC help c++ database com tutorial

  • Parasing website data : intermitten rubbish characters retrived
    A awah

    Parasing website data : intermitten rubbish characters retrived hi, i am making a program to parse data from website, to do that i need to download the file Step1: download file CString Data; //CString Buffer; DeleteUrlCacheEntry(url);// delete the old stupid cache HINTERNET IntOpen = ::InternetOpen("Sample", LOCAL_INTERNET_ACCESS, NULL, 0, 0); HINTERNET handle = ::InternetOpenUrl(IntOpen, url, NULL, NULL, NULL, NULL); HANDLE hFile = ::CreateFile("c:\\index.txt", GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); char Buffer[1024]; DWORD dwRead =0; while(::InternetReadFile(handle, Buffer, sizeof(Buffer), &dwRead) == TRUE) { if ( dwRead == 0) break; DWORD dwWrite = 0; ::WriteFile(hFile, Buffer, dwRead, &dwWrite, NULL); Data+=Buffer; } ::CloseHandle(hFile); ::InternetCloseHandle(handle); the Cstring "Data" contains the website in a plain text step2 : parse the data using brackets because a lot of data in within <> brackets, this can be used to reference the desired data // this function look for the text and removes "bracket_distance" number of <>, then return the result // eg. "dsfsd<><><><>6.35<>", item = dsfsd, bracket_distance = 4 CString Mydialog::Parse_Backets(CString file_string, CString item, int bracket_distance) { file_string.ReleaseBuffer(); int start_index; int end_index; start_index = file_string.Find(item); if(start_index == -1) { CString error_string = "Error"; error_flag = 1; return error_string; } for(int i =0; i ",start_index)+1; } end_index = file_string.Find("<",start_index) - 1; file_string=file_string.Mid(start_index, end_index-start_index+1 ); return file_string; } now the problem is once in a while i get rubbish characters. Like the actual value when i browse to the website, should be 0.55 , i get 0.aj5m5, or even 0.1595 the website is http://stquote.sgx.com/live/st/STStock.asp?stk=G does anyone knows how to solve this problem? using: - mfc - VC6.0

    C / C++ / MFC help c++ database com tutorial

  • erase cookies cookie from webbrowser control
    A awah

    only the ones that my current webbrowser control is using

    C / C++ / MFC question

  • erase cookies cookie from webbrowser control
    A awah

    erase cookies cookie from webbrowser control how do i erase all the cookies or cookie from my webbrowser control?

    C / C++ / MFC question

  • how to get the VARIANT type URL as a CString from OnDocumentComplete in webbrowser2
    A awah

    thanks!

    C / C++ / MFC c++ tutorial question

  • how to get the VARIANT type URL as a CString from OnDocumentComplete in webbrowser2
    A awah

    how to get the VARIANT type URL as a CString from OnDocumentComplete in webbrowser2 void MyDialog::OnDocumentCompleteExplorer1(LPDISPATCH pDisp, VARIANT FAR* URL) { } "URL" here contains the url that has been completed. but it is a variant type. i want to as a CString type so that i can check it. i tried casting but it doesnt work. does anyone knows how to do it? - MFC style - winxp - vc6.0 thanks in advance!

    C / C++ / MFC c++ tutorial question

  • how to make my rich edit ctrl scroll automatically when insert new text?
    A awah

    how to make my rich edit ctrl scroll automatically when insert new text? here's how i insert text msg.Insert( msg.GetLength() , "\n"); m_system_message.SetSel(-1,-1); m_system_message.ReplaceSel(msg); here's how the richedit is defined in the resource file CONTROL "",IDC_SYSTEM_MESSAGE,"RICHEDIT",ES_MULTILINE | ES_AUTOVSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP,11, 257,241,52 as you guys can see, ES_AUTOVSCROLL is definately there but whenever i insert new text using ReplaceSel, the text focus is always at the top. how do i make it such that it automatically scrolls down to read the latest text inserted? using - mfc - vc6.0 - winxp thanks in advance!

    C / C++ / MFC question c++ tutorial learning

  • URLDownloadToFile dont work in worker thread [modified]
    A awah

    URLDownloadToFile dont work in worker thread how do i make URLDownloadToFile work in a worker thread. because this is a blocking function, i got to use a worker thread when i call it. but unforturnately when i tried to use it in a thread it doesnt even work at all. its LRESULT return value becomes like -29581853 or something like that. also, the file never shows up in c:\abc.txt here is the code i used download_result=URLDownloadToFile(NULL, yahoo_url, "C:\\abc.txt", 0, NULL); how can i make it work in my worker thread? ref [url]http://msdn2.microsoft.com/en-us/library/ms918866.aspx\[/url\] using vc++6.0 winxp MFC STYLE

    C / C++ / MFC question c++ com

  • call webbrowser.Navigate within a thread via post message to UI thread
    A awah

    call webbrowser.Navigate within a thread via post message to UI thread i wan to navigate to a website using my webbrowser2 activeX i made. but i need to run threads to execute a webbrowser.Navigate. because webbrowser.Navigate can only be called by the main user interface thread, inorder to use it from within a browser, i would be using the postmessage command to the main thread with a custom message heres my custom message // my custom messages #define WM_GOWEBSITE (WM_APP + 1) here is the handler for WM_GOWEBSITE void Dlg::On_WebsiteVisit() { m_webbrowser.Navigate("yahoo.com", NULL, NULL, NULL, NULL); return; } from within my thread, this is how i posted WM_GOWEBSITE th_thread->PostMessage( WM_GOWEBSITE , 0,0); after running debug , i am very sure the message got posted. But the problem now in the release version is that the page simply does not load.hovering my mouse over the activeX control i get the "half cursor,half hour glass" mouse cursor. the debug version is fine. does anyone know what is going on? can anyone please help me? thanks in advance!

    C / C++ / MFC com design help question announcement

  • Cwebbrowser2 , cannot find the internet path
    A awah

    i have narrowed the problem down to the navigate member function being run in a worker thread. however i cannot find the root cause to the problem

    C / C++ / MFC com help c++ testing beta-testing

  • Cwebbrowser2 , cannot find the internet path
    A awah

    Cwebbrowser2 , cannot find the internet path when i use this m_webbrowser.Navigate("yahoo.com", NULL, NULL, NULL, NULL); the program gave me the following error as shown in the picture the upper message box is the first to come. followed by the lower messagebox link to picture : [url]http://i8.tinypic.com/6byefcy.jpg\[/url\] [IMG]http://i8.tinypic.com/6byefcy.jpg\[/IMG\] it was working perfectly fine on my computer with compiler. When i brought it to another computer, this happened! i tried redoing a new testing project and creating the webbrowser in the same manner and it was good some information: - using MFC - created webbrowser2 by going to dialog editor, right click and select "insert activeX" - disabled firewall on both computer - both computers definitely have internet connection with IE 7 - m_webbrowser.Navigate runs in a worker thread - the target website yahoo.com is definitely up. i checked with my firefox and IE browser - no delay, noticed. which means webbrowser2 did not neven attempt to contact the site can anyone please help?

    C / C++ / MFC com help c++ testing beta-testing

  • setting checks on checkbox , setcheck not working
    A awah

    setting checks on checkbox , setcheck not working how do i set a check on checkbox? m_checknow.SetCheck(BST_CHECKED); but the button refuses to get checked m_checknow is a CButton class with a checkbox as its dialog thanks in advance

    C / C++ / MFC question

  • getting sub CString from a bigger CString
    A awah

    getting sub CString from a bigger CString ok i got a big CString and i want to get a certain word in this big CString without deleting or trimming i have obtained the start and end zero based index of the text that i want. how do i proceed from here?

    C / C++ / MFC question database

  • Stripping from a text file
    A awah

    Stripping from a text file what i wan to do is get rid of items in for example, for the string "dsafgsgwrghgrsgwrhhwrfsdf" i want to get rid of "itema" and "itemb" here is my code - open file - copy file to a CString - look for < - look for > CString file_string; CString file_string_temp; int start_index; int end_index; f.Read(file_string.GetBuffer(f.GetLength()),f.GetLength()); start_index = file_string.Find("<"); end_index = file_string.Find(">"); file_string_temp = file_string.Left(start_index); int aaa = file_string.GetLength(); int b=5; but unfortunately it doesnt work is the file too big? the file is about 2,000,000,000 in f.GetLength [B]file_string.Left(start_index);[/B] copies the entire file_string instead of only copying left strings can somebody tell me what's wrong?

    C / C++ / MFC tutorial question

  • sending a string as keyboard keystrokes wrongly
    A awah

    sending a string as keyboard keystrokes wrongly as u can see from my following code, KeyBoadText() is a function that accepts a string and then type the string out as if it was typed using the keyboard. but now i am having problem when my typetext = "abc" instead of typing "abc", it types "123". how can i solve this? [CODE] void CStocksmsDlg::KeyBoardText(CString typetext) { int text_len = typetext.GetLength(); for(int i =0; i[/CODE]

    C / C++ / MFC question help

  • hide java errors/warnings in webbrowser control [modified]
    A awah

    hide scipt errors/warnings in webbrowser control how do i hide scipt errors/warnings in webbrowser control? link to image http://i14.tinypic.com/6hcn9zb.jpg [IMG]http://i14.tinypic.com/6hcn9zb.jpg\[/IMG\] please help - MFC style - Visual C++ 6.0 - CWebBrowser2 class

    C / C++ / MFC c++ question java com help

  • How to Convert LPTSTR to string class in VC++
    A awah

    i am very bad in strings and LPTSTR all that crap so i switched to using the class CString simply type CString MyString; if you want to put something into your Cstring, type MyString = "this is my string" if you want to pass your CString into a LPTSTR field, use MyString.GetBuffer() switch to CString today!

    C / C++ / MFC c++ help tutorial question

  • how to obtain messages that have been posted/sent into a control?
    A awah

    how to obtain messages that have been posted/sent into a control? SPY++ only shows messages that the control has sent out, not messages that it receives help file from spy++ [QUOTE] P The message was posted to the queue with the PostMessage function. No information is available concerning the ultimate disposition of the message. S The message was sent with the SendMessage function. This means that the sender doesn’t regain control until the receiver processes and returns the message. The receiver can, therefore, pass a return value back to the sender. s The message was sent, but security prevents access to the return value. R Each ‘S’ line has a corresponding ‘R’ (return) line that lists the message return value. Sometimes message calls are nested, which means that one message handler sends another message. [/QUOTE]

    C / C++ / MFC data-structures security help tutorial question

  • how do i implement IOleCommandTarget
    A awah

    using MFC can i use MFC for this?

    C / C++ / MFC c++ question com help tutorial

  • how do i implement IOleCommandTarget
    A awah

    how do i use it? can you provide code snippets for my case?

    C / C++ / MFC c++ question com help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups