|
kuttiam wrote: from worker thread to UI thread
You can only post messages to UI threads.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You can use events for worker threads.
You cant send message to worker threads.
|
|
|
|
|
kuttiam wrote: Can any one tell me how to post a message from worker thread to UI thread and vice-versa.
If you have the thread id then use PostThreadMessage . You should have a message loop running in the thread proc.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
kuttiam wrote: Can any one tell me how to post a message...
Other than PostMessage() ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I am using Bluesoleil sdk to get the information from a nokia phone on pc and also use the phone's services on pc. I need to get the battery level and signal strength from the phone and display on my gui.
The sdk provides an api Btsdk_VendorCommand for this. It uses a structure called BtsdkVendorCmdStru.
typedef struct _BtSdkVendorCmdStru
{
BTUINT16 ocf;
BTUINT8 param_len;
BTUINT8 param[1];
} BtSdkVendorCmdStru, *PBtSdkVendorCmdStru;
The structure BtSdkVendorCmdStru contains information about a vendor
specific command .
Ocf Specifies the OpCode Command Field value of this
vendor specific command.
param_len Specifies the size in bytes of the content in the buffer
pointer by the param element.
Param Pointer to the buffer containing the command
parameters.
I need some help as to what value should be passed to each of the members in the structure. any help would be great...
Thanks in advance.
|
|
|
|
|
Did you try to use AT commands directly??
|
|
|
|
|
Hello
Is there any way to start a program with command line parameters form MFC console application?
I appreciate any link or information about this
Tnx,
Best regards
Mihai
|
|
|
|
|
See here[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi all,
i m using a DateTimeCtrl in VC++2005.
i want initially the editbox of it is blank ,can this is possible,
or how can enter the selected date value in editbox.
please tell me.
thanks for help.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: i want initially the editbox of it is blank ,can this is possible,
See MSDN article Q238077.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
its not working its show the date in shortdate format.
please tell me another answer.
thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
use the second approach in [Q238077^]
if not working you didn't exactly followed it, in the m_dateCtrl.SetFormat(" "); //one blank, have you put blank space, if you put empty string "" without space won't work.
|
|
|
|
|
Thanks, r u right , i m using this without one space thatswhy its not working.
now its working.
thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
how can enter the selected date value in editbox.
please help me for this also.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
when the date is selected in the embedded calender, this string is formatted and entered into the edit box of datetime picker control. or explain what do you want.
|
|
|
|
|
i m not want to use edit box of datetime picker control,in place of this i want to use a seprate Edit box.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
that's poor UI design, user will be expecting on the edit field of date time picker control(DTPC), keeping the edit box of DTPC blank always and using another edit box some where else to show up the date selected in DTPC is bad design, i suggest you to use the same control, if you want an explicit calender control without edit box go for Month Calender control instead of Date time picker control. And show and hide the Month Calender Control when a button is pressed, if you donot want to have that control visible always.
anyway, answer to you question is, use CTime::Format to format date string and set the formatted text to edit box, same usable for Month Calender control.
CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_DATETIMEPICKER1);
CEdit* pEdit = (CEdit*) GetDlgItem(IDC_EDIT1);
ASSERT(pCtrl != NULL);
ASSERT(pEdit != NULL);
CTime timeTime;
DWORD dwResult = pCtrl->GetTime(timeTime);
if (dwResult == GDT_VALID)
{
str = timeTime.Format(_T("%x"));
pEdit->SetWindowText(str);
}
|
|
|
|
|
Thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
if the reply is useful, you have "Helpful Answer" option in the post.
|
|
|
|
|
Hi all..
I want to convert CString to _TCHAR*
//////////////////////////////
_TCHAR *sEndDate;
CString CurrDate;
/////////////////////
I am trying this code..
sEndDate = (LPCSTR)CurrentDate;
Its not working ...
plz help me
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
You could try,
TCHAR* sEndDate = CurrDate.GetBuffer(1);
but I highly recommend you don't use CString at all until you've read the source code for it and got an understanding of it.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Please don't forget to mention that she will need to call CString::ReleaseBuffer() after making a call to CString::GetBuffer() . You may think that it is obvious, but you are guiding a person here, who is confused about string conversions. I hope you get the point.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hence my advice to read and understand the source code or not use CString at all. It's not much use saying she will need to call CString::ReleaseBuffer(), (which is not always true ) if she doesn't understand when she should and when she shouldn't. Rather than me trying to post an entire CString tutorial here I recommended reading the source as it's the only sure way to understand the hairy mess that is CString.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
OK - there's this extra layer of understanding that I have about the OP, since I've been interacting with her for quite sometime now. She will not be able to understand anything from CString source code. And that was the point behind me stating whatever to you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
No problem, in that case my recommendation not to use CString stands
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|