// function declaration
    char* operator LPCTSTR();


// defenition
char* String::operator LPCTSTR()
{
       char* szArry = NULL;
       szArry[1024]; 
       reurn(szArry);  
}

how we can create a LPCTSTR string class member function in c++

LPCTSTR is typedef'ed in windows.h as const char* . So your String class will want to return a char* pointer to its character array, or whatever kind of data it holds.

class String
{
private:
   char* str;
public:
   const char* operator LPCTSTR()
   {
         return str;
   }
};
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.