Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7192875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:02:43+00:00 2026-05-28T20:02:43+00:00

I have been assigned to update an old code written in MSVC++ 6. I

  • 0

I have been assigned to update an old code written in MSVC++ 6. I have been getting unknown definition for PCTSTR but it was not defined even if I included the tchar.h. In my previous experience I know there is an LPTSTR but no PCTSTR.

I grep the C:\Program Files\Microsoft Visual Studio\VC98\Include\ folder and did not found a definition of PCTSTR. But to my surprise when I searched the Windows SDK folder [C:\Program Files\Microsoft SDK] there was no definition of PCTSTR but it was used in one of the samples. [C:\Program Files\Microsoft SDK\Samples\winui\Resource\Iconpro*]. So I am guessing that this may just be a relic from the Windows API of 16-bit windows but I cannot find any thing from google.

Does anyone know what is the PCTSTR for. I am guessing since this was from an old code that this works before. Any ideas how to make this compile? [I changed this to LPCTSTR and it compiled, I want to know if there are other ways than changing the definition name]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:02:44+00:00Added an answer on May 28, 2026 at 8:02 pm

    The LP in LPCTSTR means Long Pointer. It is an artifact back from the Windows 3 days, a 16 bit operating system. 16-bit code had several memory models to deal with trying to address more than 65536 bytes of memory when you only have a 16-bit cpu register. A short pointer used the default data segment register value and a 16-bit offset. A long pointer was 32-bits, 16-bits to load a segment register and 16-bits for the offset.

    The T in LPCTSTR means TCHAR, a typedef for char or wchar_t, depending on the presence of the UNICODE macro.

    Which makes PCTSTR a time anachronism, humans-and-dinosaurs movie style. There was never a 16-bit Unicode version of Windows, 32-bit versions of Windows always use 32-bit pointers. It sounds merely like a mistake. Enshrined though, the current version of winnt.h does have a typedef for it, making it the same as LPCTSTR. And used in only one place, the stralign.h header with a strange function named TSTR_ALIGNED_STACK_COPY. However only in a comment.

    Mistake. Your workaround was the right choice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written some code to do a bulk update of a gridview. In
I have been assigned a project to develop a set of classes that act
I have been assigned wit the task to write a program that takes a
For my assignment I have been assigned the task of creating a DTD for
Part of a new product I have been assigned to work on involves server-side
My company has a web document management application and I have been assigned to
I need some help with a work project I have been assigned. At the
I have recently been assigned a CSS & design project that's in a CakePHP
I found a bunch of scripts in the project I have been newly assigned
Have been studying the file system related classes of Adobe AIR 1.5, but so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.