Click here to Skip to main content
15,917,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionpdf creation(in MFC application) Pin
Midhun_M14-May-07 23:01
Midhun_M14-May-07 23:01 
AnswerRe: pdf creation(in MFC application) Pin
Nelek15-May-07 2:55
protectorNelek15-May-07 2:55 
QuestionHow to spawn CDialog by CWinThread? Pin
pkyiu14-May-07 22:59
pkyiu14-May-07 22:59 
AnswerRe: How to spawn CDialog by CWinThread? Pin
Arman S.14-May-07 23:46
Arman S.14-May-07 23:46 
GeneralRe: How to spawn CDialog by CWinThread? Pin
pkyiu15-May-07 3:31
pkyiu15-May-07 3:31 
AnswerRe: How to spawn CDialog by CWinThread? Pin
kasturi_haribabu15-May-07 1:13
kasturi_haribabu15-May-07 1:13 
GeneralRe: How to spawn CDialog by CWinThread? Pin
pkyiu15-May-07 3:45
pkyiu15-May-07 3:45 
QuestionHelp with textbox control Pin
Stick^14-May-07 22:49
Stick^14-May-07 22:49 
Ok, I'm new to doing this in C++, although I have done it in C#. As this code has to work inside another larger C++ project I have (game program) I can't just do it in C#.

In my click handler for a button I want to put text into a textbox control on my form. Unfortunately, the "text" is in a c-string (ie null terminated string), and so I'm not sure how to get it to work:

System::Void btnGen_Click(System::Object^ sender, System::EventArgs^ e)
{
BYTE bMacaddress[MAC_DIM];
CSoftwareKey::RetrieveMACAddress(bMacaddress);

char* pMacString = NULL;
CSoftwareKey::Buffer2HexString( bMacaddress, MAC_DIM, &pMacString );

tbMacAddress->Text = *pMacString; // <---- Problem line
}

I tried first making a string:

string strMacAddr(pMacString);

and then:

tbMacAddress->Text = pMacString;

but this doesn't work either (and I'm sure you are laughing now) =)

Anyway, how can I do this? Basically, pMacString points to something like this:

"000C41805D2D\0" ( if I am making sense )

and so that's what I want in the text box.

Thanks


Patrick
QuestionRe: Help with textbox control Pin
Nelek14-May-07 23:34
protectorNelek14-May-07 23:34 
AnswerRe: Help with textbox control Pin
Stick^14-May-07 23:40
Stick^14-May-07 23:40 
GeneralRe: Help with textbox control Pin
Nelek15-May-07 1:01
protectorNelek15-May-07 1:01 
AnswerRe: Help with textbox control Pin
Hamid_RT15-May-07 0:56
Hamid_RT15-May-07 0:56 
GeneralRe: Help with textbox control Pin
Stick^15-May-07 1:10
Stick^15-May-07 1:10 
GeneralRe: Help with textbox control Pin
Nelek15-May-07 1:44
protectorNelek15-May-07 1:44 
GeneralRe: Help with textbox control Pin
Stick^15-May-07 2:21
Stick^15-May-07 2:21 
GeneralRe: Help with textbox control Pin
Nelek15-May-07 3:12
protectorNelek15-May-07 3:12 
GeneralRe: Help with textbox control Pin
Stick^15-May-07 3:21
Stick^15-May-07 3:21 
GeneralRe: Help with textbox control Pin
Nelek15-May-07 21:11
protectorNelek15-May-07 21:11 
GeneralRe: Help with textbox control Pin
Hamid_RT15-May-07 1:53
Hamid_RT15-May-07 1:53 
QuestionChanging datatype from VB.NET to VC++ 6.0 Pin
ctlqt1214-May-07 22:36
ctlqt1214-May-07 22:36 
AnswerRe: Changing datatype from VB.NET to VC++ 6.0 Pin
fang_eric15-May-07 0:13
fang_eric15-May-07 0:13 
QuestionRegistry notification Pin
Alexandre GRANVAUD14-May-07 21:43
Alexandre GRANVAUD14-May-07 21:43 
AnswerRe: Registry notification Pin
Rajesh R Subramanian15-May-07 7:16
professionalRajesh R Subramanian15-May-07 7:16 
GeneralRe: Registry notification Pin
Alexandre GRANVAUD15-May-07 7:22
Alexandre GRANVAUD15-May-07 7:22 
QuestionHow to print with a new CPrintDialog derived DBox?? Pin
Nelek14-May-07 21:03
protectorNelek14-May-07 21:03 

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.