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
S

Suresh H

@Suresh H
About
Posts
131
Topics
26
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to Kill the Worker Thread ?
    S Suresh H

    Hello Cédric Moonen,, Sorry saw yr response now.Thanks a lot for the reply. I am very much new to the Thread Concept. thought of learning the basics of threads. can anyone suggest me some nice basic Article to start with. Thanking you, Suresh

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

  • How to Kill the Worker Thread ?
    S Suresh H

    Hello Everyone,, Sorry saw all yr response now.Thanks a lot for the reply. I am very much new to the Thread Concept. thought of learning the basics of threads. can anyone suggest me some nice Article to start with. Thanking you, Suresh

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

  • How to Kill the Worker Thread ?
    S Suresh H

    Hi Parag Patel, Thanks for the reply. I tried with this below code but still the thread is running its not terminated, can u please tell how to kill the thread.

    void CThreadDemoDlg::OnEnd()
    {
    // TODO: Add your control notification handler code here

    TerminateThread(hr1,1);
    TerminateThread(hr2,1);
    

    }

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

  • How to Kill the Worker Thread ?
    S Suresh H

    Hello Everyone, I have Demo MFC application, with 2 buttons Start and End Button. Start button will start 2 threads

    void CThreadDemoDlg::OnStart()
    {
    // TODO: Add your control notification handler code here

    HANDLE hr1,hr2;
    hr1 = CreateThread(NULL,0,(unsigned long (\_\_stdcall \*)(void \*))WorkerThreadOne,this,0,0);
    hr2 = CreateThread(NULL,0,(unsigned long (\_\_stdcall \*)(void \*))WorkerThreadTwo,this,0,0);
    

    }

    UINT WorkerThreadOne(LPVOID Param)
    {
    fstream OutFile;
    OutFile.open("FileOne.txt",ios::out);

    for(int i=0;i<10000;i++)
    	OutFile  << i << " ";
    OutFile.close();
    return true;
    

    }

    Can anyone please tell me how to kill the thread ? OnEnd click. Thanking you, Suresh.

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

  • Simple Class [modified]
    S Suresh H

    Hi, why is the size of the empty class is one class Demo { }; void main() { int size; size=sizeof(Demo); cout << " Size oF Class:" << size; } OutPut :- Size oF Class: 1 Can anyone please tell me the reason ?? why its 1.

    C / C++ / MFC question

  • How to get IP adress?
    S Suresh H

    use IPM_GETADDRESS Message Retrieves the address values for all four fields in the IP address control. Syntax To send this message, call the SendMessage function as follows. lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) IPM_GETADDRESS, // message ID (WPARAM) wParam, // = 0; not used, must be zero (LPARAM) lParam // = (LPARAM) (LPDWORD) pdwAddr; );

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

  • How to check the ASCII value ??
    S Suresh H

    Hi Prasad, Thank you very much for the help. i made changes a below and its working now perfectly. i had never used isalpha so i was with ascii code, thanks for the info. while(!fin.eof()) { fin >> word; //strlwr(word); wsize = strlen(word); offset=fin.tellg(); offset = offset - wsize + 1; //Insert Words and its offset in to Map stemp = word; bool bValid = true; for (int j = 0; j < wsize; j++) { if (!isalpha(stemp[j])) { bValid = false; break; } } if (bValid) FMap[stemp] = offset; }

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    Hi Appu,, Thank you very much, code is working i made the changes as below while(!fin.eof()) { fin >> word; //strlwr(word); wsize = strlen(word); offset=fin.tellg(); offset = offset - wsize + 1; //Insert Words and its offset in to Map stemp = word; bool bValid = true; for (int j = 0; j < wsize; j++) { if (!isalpha(stemp[j])) { bValid = false; break; } } if (bValid) FMap[stemp] = offset; }

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    Appu still the problem is there not got the solution still..... i changed the code as below now it only checks for the 1st character if that is valid it will add it to map .. if ( ((stemp[0] >= 65) && (stemp[0] <= 90)) || ((stemp[0] >= 97) && (stemp[0] <= 122)) ) FMap[stemp]=offset; but hwy to check if there is any special character or number in between and hw to add them??

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    using namespace std; typedef map FileMap; #define SIZE 255 char word[SIZE]; int offset; FileMap FMap; i forgot to enable Ignore HTML tags in this message (good for code snippets) -- modified at 4:30 Friday 30th March, 2007

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    appu i made changes but i am getting error for this lines FMap[nIndex++] = stemp[j]; /* Not FMap[stemp] = offset */ error C2679: binary '[' : no operator defined which takes a right-hand operand of type 'int' (or there is no acceptable conversion) FMap[nIndex] = '\0'; /* NULL termination */ error C2679: binary '[' : no operator defined which takes a right-hand operand of type 'int' (or there is no acceptable conversion) Now the problem with adding values to Map.

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    I copied and pasted but still nt working :( again the same output for(int j =0; j<=wsize; j++) { if ( ((stemp[j] >= 65) && (stemp[j] <= 90)) || ((stemp[j] >= 97) && (stemp[j] <= 122)) ) { FMap[stemp]=offset; } }

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    i checked it and added brackets but still no effect same output for(int j =0; j<=wsize; j++) { if ( ((stemp[j] >= 65) && (stemp[j] <= 90) || (stemp[j] >= 97) && (stemp[j] <= 122) ) ) { FMap[stemp]=offset; } }

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    Hi Prasad, Code as no effect its adding all the words. void getoff(char *fname) { ifstream fin; fin.open(fname,ios::in); int wsize; string stemp; //Loops till the end of the file. while(!fin.eof()) { fin >> word; strlwr(word); wsize = strlen(word); offset=fin.tellg(); offset = offset - wsize + 1; //Insert Words and its offset in to Map stemp = word; for(int j =0; j < wsize; j++) { if (isalpha(stemp[j])) { FMap[stemp] = offset; } } } fin.close(); }

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    Hi Appu, Thanks for the response, I made changes but the code as no effect its adding all the words. Including numbers and special characters. for(int j =0; j<=wsize; j++) { if ( (stemp[j] >= 65) && (stemp[j] <= 90) || (stemp[j] >= 97) && (stemp[j] <= 122) ) { FMap[stemp]=offset; } } } Something is wrong in the for loop i am unable to find, what will the cause ?

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    Thanks Cedric Moonen for the response. ASCII values A – 65 to Z – 90 & a – 97 to z – 122. But hw to check them in the condition ???

    C / C++ / MFC help tutorial question

  • How to check the ASCII value ??
    S Suresh H

    Hello All, I am trying a read text file and extracting words from it and adding to a map. I want to add only valid words and eliminate numbers and special character words and then add it to map. Invalid words like 1word , hello# , t2o etc … so I want to eliminate all the number and special characters. Can anyone please help me with this …. strlwr(word); wsize = strlen(word); stemp = word; for(int j =0; j<=wsize; j++) { if ( stemp[j] == '.' || stemp[j] == ';' || stemp[j] == '*' || stemp[j] == '#' && stemp[j] == '!' || stemp[j] == '@' || stemp[j] == '$' || stemp[j] == '%' && stemp[j] == '^' || stemp[j] == '&' || stemp[j] == '(' || stemp[j] == ')' && stemp[j] == '-' || stemp[j] == '+' || stemp[j] == '/' ) break; else FMap[stemp]=offset; } This conditions are very lengthy, is there any way I can reduce it by checking the ASCII value and add them to MAP. Thanking you, Suresh HC.

    C / C++ / MFC help tutorial question

  • After the shameful defeat of Team India, [moved]
    S Suresh H

    are u SACHIN ?????? Ho Noooooooooooooooooooooooooo :doh:

    The Back Room sharepoint collaboration beta-testing help question

  • Funny
    S Suresh H

    Good one ..Thanks for posting ..........:laugh:

    The Lounge question collaboration regex lounge

  • AOTD
    S Suresh H

    :-D

    The Lounge css
  • Login

  • Don't have an account? Register

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