Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OnDraw() & Timer animation problem Pin
Luc Pattyn28-Jul-08 17:08
sitebuilderLuc Pattyn28-Jul-08 17:08 
GeneralRe: OnDraw() & Timer animation problem Pin
ccaprani28-Jul-08 17:31
ccaprani28-Jul-08 17:31 
GeneralRe: OnDraw() & Timer animation problem Pin
Luc Pattyn28-Jul-08 17:38
sitebuilderLuc Pattyn28-Jul-08 17:38 
GeneralRe: OnDraw() & Timer animation problem Pin
ccaprani28-Jul-08 17:40
ccaprani28-Jul-08 17:40 
AnswerRe: OnDraw() & Timer animation problem Pin
ccaprani28-Jul-08 18:50
ccaprani28-Jul-08 18:50 
QuestionHow to pass a wstring value to a string pointer [modified] Pin
monsieur_jj28-Jul-08 15:06
monsieur_jj28-Jul-08 15:06 
AnswerRe: How to pass a wstring value to a string pointer Pin
Mark Salsbery28-Jul-08 16:14
Mark Salsbery28-Jul-08 16:14 
AnswerRe: How to pass a wstring value to a string pointer Pin
Jijo.Raj28-Jul-08 17:16
Jijo.Raj28-Jul-08 17:16 
I think still you're in trouble with wstring to string conversion. Smile | :) http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2653980[^]

Well, the capsule answer for your query is this -

#include "atlconv.h"

// function to convert wide string to string.
string* WstringToString( wstring& WideString )
{
    // Allocate the string.
    string* pString = new string;
    
    {
        USES_CONVERSION;
        
        // converted string.
        *pString = W2A( WideString.c_str());
    }
    
    return pString;
}

// Your main function.
void ConversionFunction() 
{
    // The wide string.
    wstring WideString = L"Hello";
    string* pString = WstringToString( WideString );

    // after usage, delete the allocated string.
    delete pString;
}


Hope its clear now!

Regards,
Jijo.

_____________________________________________________

http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

QuestionOwnerdraw a Dialog Pin
KellyR28-Jul-08 13:32
KellyR28-Jul-08 13:32 
AnswerRe: Ownerdraw a Dialog Pin
Stephen Hewitt28-Jul-08 14:21
Stephen Hewitt28-Jul-08 14:21 
QuestionRe: Ownerdraw a Dialog [modified] Pin
KellyR28-Jul-08 14:59
KellyR28-Jul-08 14:59 
AnswerRe: Ownerdraw a Dialog Pin
Stephen Hewitt28-Jul-08 15:09
Stephen Hewitt28-Jul-08 15:09 
AnswerRe: Ownerdraw a Dialog Pin
KellyR28-Jul-08 15:23
KellyR28-Jul-08 15:23 
QuestionEfficient Object Management Pin
Ehsan Baghaki28-Jul-08 10:39
Ehsan Baghaki28-Jul-08 10:39 
AnswerRe: Efficient Object Management Pin
Cedric Moonen28-Jul-08 20:27
Cedric Moonen28-Jul-08 20:27 
GeneralRe: Efficient Object Management Pin
Ehsan Baghaki29-Jul-08 1:05
Ehsan Baghaki29-Jul-08 1:05 
Questionbaudrate and other serial communication parameters Pin
hariakuthota28-Jul-08 9:36
hariakuthota28-Jul-08 9:36 
AnswerRe: baudrate and other serial communication parameters Pin
Joe Woodbury28-Jul-08 10:11
professionalJoe Woodbury28-Jul-08 10:11 
QuestionRe: baudrate and other serial communication parameters Pin
Luc Pattyn28-Jul-08 10:32
sitebuilderLuc Pattyn28-Jul-08 10:32 
AnswerRe: baudrate and other serial communication parameters Pin
hariakuthota28-Jul-08 18:18
hariakuthota28-Jul-08 18:18 
GeneralRe: baudrate and other serial communication parameters Pin
Cedric Moonen28-Jul-08 20:29
Cedric Moonen28-Jul-08 20:29 
QuestionMFC/Win32 Enumerate Font size ? Pin
Maximilien28-Jul-08 9:31
Maximilien28-Jul-08 9:31 
AnswerRe: MFC/Win32 Enumerate Font size ? Pin
_AnsHUMAN_ 28-Jul-08 9:42
_AnsHUMAN_ 28-Jul-08 9:42 
GeneralRe: MFC/Win32 Enumerate Font size ? Pin
Maximilien29-Jul-08 7:23
Maximilien29-Jul-08 7:23 
Questionshortcut for menu operations Pin
hariakuthota28-Jul-08 8:54
hariakuthota28-Jul-08 8:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.