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
R

Raj Prathap

@Raj Prathap
About
Posts
54
Topics
23
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Is this c/c++ code valid
    R Raj Prathap

    yeah, it was encrypted with 128bit RSA algo. Its great that you could decrypt it :) .Just kidding.. Its neither encrypted nor a question from an interview. I had to write some code today and I re written the code in different way also. But I gor a doubt if this code is valid and wanted a confirmation.

    C / C++ / MFC c++

  • Is this c/c++ code valid
    R Raj Prathap

    I'm not new to C++ :omg: . Today I had to write some code which includes swith cases, but case lables are valid in only some conditions (depending on the device type). I was not completly sure that the code is invalid, and wrote a test pgm in vs2k3, and it worked fine. Before checking in, wanted a confirmation.

    C / C++ / MFC c++

  • Is this c/c++ code valid
    R Raj Prathap

    :) Thanks for the reply. Please post your choice.

    C / C++ / MFC c++

  • Is this c/c++ code valid
    R Raj Prathap

    int i = 10; int k = 100; switch(i) { case 0: cout << "case 0" <<endl; break; if(k == 100) { case 10: cout <<"The device type is 100 so attribute 10 is valid"<<endl; break; } else { case 100: cout <<"attribute 100 is there" << endl; break; } break; default: cout <<"default"<<endl; } Please confirm whether 'if' could be placed inside a switch statement. Pratap

    C / C++ / MFC c++

  • Sockets and multithreading - doubt
    R Raj Prathap

    All, I have a doubt whether two different threads can be working on a same socket descriptor(handle in windows terminology)? Please go through the following scenario: We have one device which supports TCP/IP: 1. Responds to the requests 2. Sends notifications, incase any events Can I have two threads one for continuesly wait to receive the notifications & response and another for sending the requests to the panel? Could someone please provide (link will suffice)a good design for this class. Best Regards, Pratap

    C / C++ / MFC design question

  • DWORD dw='pp' is valid in VC++ 6.0 :(
    R Raj Prathap

    Sorry for replying after so many days.. it was Deevali in India and I was in vacation. Thanks a lot for the link. It was quite helpful. Pratap

    C / C++ / MFC c++

  • DWORD dw='pp' is valid in VC++ 6.0 :(
    R Raj Prathap

    I'm sorry There was a mistake in calculating the value of 0x7070 in decimal format. The value is 0x7070 only!! Thanks a lot for your support!! could you kindly specify that the statement DWORD dw='pp'; is valid in all platforms!! I'm googling for it, but no success!!

    C / C++ / MFC c++

  • DWORD dw='pp' is valid in VC++ 6.0 :(
    R Raj Prathap

    No! The DWORD value is coming as 28784 in my machine

    C / C++ / MFC c++

  • CString to TCHAR & TCHAR to CString
    R Raj Prathap

    I'm not getting what you are trying to do with the code. CString is just a wrapper for TCHAR. That is CString has a member variable like below. CString { private: TCHAR *m_buf; //Several other stuffs! }; if your intention is to construct another CString from the edit box contents then CString messageback(message) will suffice. to get the pointer to member variable m_buf(member variable name might not be exact) by using GetBuffer() method. pratap

    C / C++ / MFC help question

  • About Memory initialization
    R Raj Prathap

    Use char *str = malloc(n*sizeof(char)); if str is local, then foo(int n) { char str[n]; } is also valid in vc6.0 Regards, Pratap

    C / C++ / MFC question performance

  • Read Console Output
    R Raj Prathap

    IO redirection might help you. in command prompt, if abcd.bat is the batch file then I'd gove the command abcd.bat >output.txt hope that was helpful.

    C / C++ / MFC tutorial question

  • DWORD dw='pp' is valid in VC++ 6.0 :(
    R Raj Prathap

    I'm using VS6.0. I was going through the code which was written nearly 3 years before. I have seen one statement like said in the subject DWORD dw='pp'; I was not aware that is a valid statement. And still I'm not clear what will be the value of dw. I calculated if it is equivalent to ('p'<<8 + 'p') but no success. Can some kindly clarify me on whether two characters in single cotes is valid in C/C++ or it is valid only in VC++. If valid in VC++, how would the value is calculated for the literal in two cotes. regards, Pratap

    C / C++ / MFC c++

  • why CArray::GetSize() returns INT_PTR
    R Raj Prathap

    Hi All, Please explain me why CArray::GetSize() returns an INT_PTR. When I see the documentation regarding the function, it says returns the number of elements in the array. Number of elements are int/long. I could not understand why is this INT_PTR. In VS2k3, the compiler throws a warning. In VC6.0 there is no warning. Regards, Pratap

    C / C++ / MFC data-structures

  • Doubt on CString and BSTR LPWSTR
    R Raj Prathap

    Thanks. The link provided is really helpful. I was not clear about the parts of the BSTR i.e length+data+terminator. I used think terminator would not be there since the length is already there. Any ways with the link to MSDN article, all doubts are cleared. Thanks a ton. /pratap

    C / C++ / MFC question workspace

  • Doubt on CString and BSTR LPWSTR
    R Raj Prathap

    Hi All, I have on basic doubt. In windows environment both BSTR and LPWSTR are typedef ed to unsigned short *. But the contents in that pointer are different. BSTR is a wide char string with length in the first byte. LPWSTR is a null terminated string. But, CString str; LPWSTR lpw = L"lpwstr"; BSTR bst = AllocSysString("bstr"); str = lpw; //how at runtime identified whether first char is length or actual data? str = bsw; //Both of the statements work fine The code works fine, and behaves as we expect. My doubt is how at run time the decision on the first byte is decided? i.e whether the first byte is the data or the length?? how the compiler identifies. Thanks and regards, Raja Pratap

    C / C++ / MFC question workspace

  • returning array of BSTRs from the COM component
    R Raj Prathap

    Thanks a ton Mike, working and its very easy to code.

    COM com data-structures

  • Returning an array of BSTR from the COM Component
    R Raj Prathap

    I Tried with BSTR**, could not succeed. Only first string comes, since the marshaller considers only the first string, since length is not mentioned. I got a hint from one of CP members to use SAFEARRAY(BSTR)* that worked fine.

    C / C++ / MFC com data-structures

  • Returning an array of BSTR from the COM Component
    R Raj Prathap

    Hi, I have a method which has to return the array of BSTRs. I'm giving the method here, please let me know if I'm doing anything wrong. HRESULT Login([in] BSTR UserName, [in] BSTR Password, int maxUsrCnt , [out]int *UsrCnt, [out, length_is(,*UsrCnt), size_is(,maxUsrCnt)] BSTR *LoggedUsers); the size of the array to be returned is not known at the time of calling. When I use this method, the first string is coming properly, but other strings are not coming. Please suggest an answer. Regards, Raja Pratap

    C / C++ / MFC com data-structures

  • returning array of BSTRs from the COM component
    R Raj Prathap

    Hi, I have a method which has to return the array of BSTRs. I'm giving the method here, please let me know if I'm doing anything wrong. HRESULT Login([in] BSTR UserName, [in] BSTR Password, int maxUsrCnt , [out]int *UsrCnt, [out, length_is(,*UsrCnt), size_is(,maxUsrCnt)] BSTR *LoggedUsers); the size of the array to be returned is not known at the time of calling. When I use this method, the first string is coming properly, but other strings are not coming. Please suggest an answer. Regards, Raja Pratap

    COM com data-structures

  • Problem facing with connection points
    R Raj Prathap

    The problem got soleved. We have to make the server free threaded and make the class implementing the interface singleton and we need to in _tWinMain.. make sure that CoInitializeEx gets called. Just trial and error caused a break through. Thanks and regards, Raja Pratap

    COM com sysadmin help
  • Login

  • Don't have an account? Register

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