Results 1 to 12 of 12
  1. #1
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,306
    Reputation
    170
    Thanks
    2,165
    My Mood
    Flirty

    How to convert char* to LPTSTR

    I've got some code here
    Code:
    result = dsound->Create(&wave, filename);
    	if(result != DS_OK)return NULL;
    Its supposed to load a .wav file, but it only takes filenames in LPTSTR format. And I have no idea what a LPTSTR is o_O? So I have no idea how to convert it. Please help...

    Oh yeah here's error message:
    Code:
     error C2664: 'CSoundManager::Create' : cannot convert parameter 2 from 'char *' to 'LPTSTR'
    Last edited by why06; 11-30-2009 at 03:39 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  2. #2
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,192
    Reputation
    205
    Thanks
    1,424
    My Mood
    Mellow
    Change character set to Multi byte.

  3. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,306
    Reputation
    170
    Thanks
    2,165
    My Mood
    Flirty
    Quote Originally Posted by Davidm44 View Post
    Change character set to Multi byte.
    Well I'm not really sure what "Multi Byte" means, but I know how to change it so I guess I can dabble around with it since I have nothing else to do.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  4. #4
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    could try type casting to LPSTR, or you Could use the L or TEXT macros

  5. #5
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,192
    Reputation
    205
    Thanks
    1,424
    My Mood
    Mellow
    Quote Originally Posted by why06 View Post
    Well I'm not really sure what "Multi Byte" means, but I know how to change it so I guess I can dabble around with it since I have nothing else to do.
    I think instead of using characters to hold data it uses multiple bytes.

  6. #6
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    31
    My Mood
    Lonely
    Quote Originally Posted by Davidm44 View Post
    Change character set to Multi byte.
    yup VC++ 2003 and up: Project>>Properties>>Configuration properties>>character set>>change it to >>Use Multi-Byte Character Set.

  7. #7
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,306
    Reputation
    170
    Thanks
    2,165
    My Mood
    Flirty
    I did it... still doesn't seem to be working....

    I did this:
    Code:
     //attempt to load the wave file
    	result = dsound->Create(&wave, (LPTSTR)filename);
    	if(result != DS_OK)return NULL;
    Code:
    HRESULT Create( CSound** ppSound, LPTSTR strWaveFileName, DWORD dwCreationFlags = 0, GUID guid3DAlgorithm = GUID_NULL, DWORD dwNumBuffers = 1 );
    That's the proto of Create so I don't see the problem.


    Hmmm... searched around a bit, and it seems DirectSound is obsolete... this might be the problem, it might be calling for audio libraries that don't exist. I think I might just go ahead and use OpenAL or something and screw this chapter on sound... it was explained that well anyway. >_<
    Last edited by why06; 11-30-2009 at 08:35 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  8. #8
    char32308's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    PA
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Sneaky
    Quote Originally Posted by why06 View Post
    Well I'm not really sure what "Multi Byte" means, but I know how to change it so I guess I can dabble around with it since I have nothing else to do.
    Hey jz this is charlieOo

  9. #9
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,306
    Reputation
    170
    Thanks
    2,165
    My Mood
    Flirty
    Quote Originally Posted by char32308 View Post
    Hey jz this is charlieOo
    Womg. You found my hiding spot. Hey wats up charlie! I don't know why you put your handle, I mean I know who you are. Yeh... I'm pretty sure I told you my name was Shaun. But this off-topic. PM me.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  10. #10
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Quote Originally Posted by why06 View Post
    Womg. You found my hiding spot. Hey wats up charlie! I don't know why you put your handle, I mean I know who you are. Yeh... I'm pretty sure I told you my name was Shaun. But this off-topic. PM me.
    Say what... Shaun, are you cheating on me?

  11. #11
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,647
    Reputation
    236
    Thanks
    4,030
    My Mood
    Cheeky
    Quote Originally Posted by zeco View Post
    Say what... Shaun, are you cheating on me?
    WTF?! Why you have a whole lot to explain first you attempt to get me to marry you, and now I find out about your two other boyfriends? I dun want party rape
    Ah we-a blaze the fyah, make it bun dem!

  12. #12
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,306
    Reputation
    170
    Thanks
    2,165
    My Mood
    Flirty
    Omg... >_>.

    Wow guys. I'm trying to run a forum here. I would close this thread, but I still need someone to answer my question... so just chill with the gay humor for a bit... k? plz? ;(

    EDIT: Wait I just remembered I'm not doing the sound chapter any more so....

    \Closed.

    (Oh, man I love doin that! )

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

Similar Threads

  1. char* to LPTSTR
    By Hell_Demon in forum C++/C Programming
    Replies: 1
    Last Post: 12-01-2009, 09:45 AM
  2. How to convert FRAPS?
    By TheDesolate in forum Combat Arms Glitches
    Replies: 17
    Last Post: 07-04-2009, 10:19 PM
  3. How To: Convert Address to long
    By stonie in forum Visual Basic Programming
    Replies: 4
    Last Post: 12-18-2008, 12:41 PM
  4. Can someone teach me how to convert a bypass into a adress
    By frono15 in forum Programming Tutorial Requests
    Replies: 2
    Last Post: 05-18-2008, 11:38 AM
  5. Share :how to convert dvd and video to zune
    By goodfriend in forum Entertainment
    Replies: 3
    Last Post: 02-20-2008, 07:06 AM

Tags for this Thread