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 7016155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:44:52+00:00 2026-05-27T22:44:52+00:00

I have looked for similar problems but none are in the context I require.

  • 0

I have looked for similar problems but none are in the context I require. The odd thing with this is that I get this error yet a different project set out in code the same way seems to work perfectly.

I am trying to load images into textures in openGL and have a function which takes in this parameter:

GLuint loadTexture(LPTSTR szFileName);

I then call it like this:

textureLib[0]= loadTexture("texturelib/texture1.bmp");
textureLib[1]= loadTexture("texturelib/texture2.bmp");
textureLib[2]= loadTexture("texturelib/texture3.bmp");
textureLib[3]= loadTexture("texturelib/texture4.bmp");

it then says “1>e:\usb\uni work\graphics\coursework\coursework\main.cpp(291): error C2664: ‘loadTexture’ : cannot convert parameter 1 from ‘const char [24]’ to ‘LPTSTR'”

As stated above another program that I have seems to allow it so if there is a way of just fixing it to run it that would be appreciated 🙂

  • 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-27T22:44:52+00:00Added an answer on May 27, 2026 at 10:44 pm

    LPTSTR is either char* or wchar_t*, depending on whether Unicode macros are set (UNICODE, _UNICODE). And if you’re passing literals to that function, you should not use it (and use LPCTSTR instead, which is const char/wchar_t*). After you change the signature, use _T() or TEXT() macro to match the literals to the type, i.e.

    GLuint loadTexture(LPCTSTR filename);
    loadTexture(TEXT("texturelib/texture1.bmp"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked at this and this which both describe similar problems but don't
I'll preface this question with the note that I have looked at this similar
I have looked at the Suggested related questions but none of them are what
I've looked around and cannot figure this one out: I have a object that
I have a problem with Gridview sorting that is similar to others but I'm
I have looked already and cannot find this but does anyone know of an
I looked at similar question on SO but none of them answer my problem.
I found some questions that looked similar, but not exactly the same so I'll
I have looked into this fairly extensively, but have not found quite what I
I have posted a question on here previously asking similar advise, but this project

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.