|
TQ, what i mean here is, actually search for other device. Actually i has a bluetooth development kit from erricson. now my problem is command in MFC that help me establish a connection to this kit through serial connection. hope you can help me.
|
|
|
|
|
Arghhhh... That is exactly the question I don't know the answer for...
|
|
|
|
|
Do you want do the job with WindowsAPI?
|
|
|
|
|
Hi,
is there the possibility to select and highlight an item in the ListCtrl
only with a tap on it and how can i use "tap and hold" with a CListCtrl?
And is that even possible with Win CE < 3.0?
Thanks,
Frank
_____ easySMS for pocket PC _____
www.Siedler-Net.de/WinCE/easySMS/
|
|
|
|
|
Hi,
Check my article on this subject: Handling tap-and-hold[^]. In this article I explain a technique that allows you to select an item using a tap while keeping the tap-and-hold capability: you have to correctly handle the NM_CLICK notification. This notification will be sent after a normal tap and after a tap-and-hold operation. When you handle the tap-and-hold (through the GN_CONTEXTMENU notification), use a flag to store this state, ans test it in the NM_CLICK handler. If the flag is TRUE , this is a tap-and-hold, otherwise it is a normal tap.
I know nothing about Windows CE < 3.0...
Hope this helps.
|
|
|
|
|
Hi,
i have read your article ... but it doesn't work with my DialogBox Window
which has a CListCtrl Window inside. That was build with the Resource
Manager.
So, if i tap on the CListCtrl Window nothing happens, only if i tap beside
where the DialogWindow is. The message is only handled if i tap on
the Dialog Window of my App. Is there the possibility to handle the messages
even if i tap on a Window inside that Dialog Window?
Perhaps with SetCapture() ?
Greetings,
Frank
_____ easySMS for pocket PC _____
www.Siedler-Net.de/WinCE/easySMS/
|
|
|
|
|
Frank S. wrote:
That was build with the Resource Manager.
So this means that you have a "raw" CListCtrl in your dialog? No subclassing?
Frank S. wrote:
So, if i tap on the CListCtrl Window nothing happens, only if i tap beside
where the DialogWindow is.
You mean, the red dots do not show up when you tap-and-hold the CListCtrl ? What is the platform you are working on?
I'm just trying to figure out what is happening to you. My approach has worked as well for dialogs, but it was tested only under Pocket PC 2002.
|
|
|
|
|
|
I see you are using Pocket PC 2000. I still do not understand why the list control does not adequately respond to the tap-and-hold. There can be only three answers for this: 1-The PPC2K version of the control does not handle tap-and-hold natively (I doubt it). 2-You are overriding the WM_LBUTTONDOWN message and are not allowing the control's window procedure to handle it. 3-I have no idea what is happening...
|
|
|
|
|
Hi,
i think, the CListCtrl-Subwindow in the Dialog Window doesn't send the stylus tap-recognition to the Dialog Window, so that the notification of WM_LBUTTONDOWN doesn't work. I only can handle the Click-operation in that window (tap and release) if i tap on the ListCtrl-box the selection isn't changing, only by a click it's changing. I think that's the problem, but i don't know how to handle ...
Greetings, Frank
_____ easySMS for pocket PC _____
www.Siedler-Net.de/WinCE/easySMS/
|
|
|
|
|
Is it possible to handle these input messages from the stylus with PreTranslateMessage(MSG* pMsg) ?
I have figured out, that if i use that function, i can handle the WM_LBUTTONDOWN message even if i click on the ListCtrl-window, and not only on the dialog box window. But now the problem is, that i have to know, which window in the dialog box is active and should be handled! Because the other Windows should be handled normal.
And is it normal, that the selected item in a listbox is only changing, if you are clicking on it? With normal windows applications, you only have to tap on it and it's quite changing.
Greetings,
Frank
|
|
|
|
|
I need to display data in a grid with automatic colors depending on the data (e.g. -1 = red, 0 = black, 1 = green). I've found
http://www.codeproject.com/csharp/custom_datagridcolumnstyl.asp
but this doesn't work with the compact framework.
I think the reason is that it's not possible to override the Paint methods of DataGridTextBoxColumn in the compact framework.
Is there any way to have such a datagrid (with different colors for each cell) based on the .NET compact framework datagrid or will I have to reimplement the wheel (i.e. DataGrid) for our application?
|
|
|
|
|
Hi,
I have exactly the same problem
did you find a datagrid?
anyone has an idea?
thank you!
Jermo
|
|
|
|
|
I ended up implementing a datagrid myself... it's pretty much optimized for "perceived performance"... if you're interested, you can contact me at david@purple-sunshine.de...
david
|
|
|
|
|
Hello, I have an application that has to start a new thread. In this thread I acquire and I calculate data. So, when I exit the program, I terminate the Thread but the thread doesn't exit!
Here is the code:
Starting the Thread:
CMyClass::Enable()
{
fEnabled = 1;
DWORD ThreadID;
m_hNewThread = CreateThread(
NULL,
0,
MyClassThreadProc,
this,
0,
&ThreadID);
}
Thread Proc function:
DWORD WINAPI MyClassThreadProc( LPVOID pParam )
{
CMyClass* pObject = (CMyClass*)pParam;
if (pObject == NULL)
return -1;
pObject->ServiceHandler();
return 0;
}
Idle function:
void CMyClass::ServiceHandler()
{
while (fEnabled)
{
}
}
When I want to exit the Thread, I call this function:
void CMyClass::Disable()
{
if (!fEnabled)
return;
DWORD ExitCode;
fEnabled=0;
GetExitCodeThread(m_hNewThread,&ExitCode);
while(ExitCode == STILL_ACTIVE)
GetExitCodeThread(m_hNewThread,&ExitCode);
WRS232::Close();
return;
}
But that doesn't work !! The while loop in the Disable function never ends !!! I have not this problem when I set a breakpoint in this loop !
Thanks for help !!
|
|
|
|
|
Have you added the volatile keyword to the fEnable flag? That's needed, otherwise the compiler will remove the while (fEnabled) statement during optimizing the code.
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hello!
Thanks for reply . I forgot the volatile keyword ! But, it doesn't work with it neither
When I exit my application, the Pocket PC goes much much more slowly (the thread is still in use)!
Any idea?
|
|
|
|
|
Take a look at the following code that I use in some of my projects. I create a thread at program start and terminate it when the user close the dialog.
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_bRunning = TRUE;
m_pSendDataThread = AfxBeginThread(SendData, this,
THREAD_PRIORITY_NORMAL,
0,
CREATE_SUSPENDED);
ASSERT_VALID(m_pSendDataThread);
m_pSendDataThread->m_bAutoDelete = FALSE;
m_pSendDataThread->ResumeThread();
return TRUE;
}
UINT CMyDlg::SendData(LPVOID pParam)
{
CMyDlg* pDialog = reinterpret_cast<CMyDlg*>(pParam);
ASSERT(pDialog);
if (pDialog)
pDialog->SendData();
return 0;
}
void CMyDlg::SendData()
{
while (m_bRunning)
{
}
}
void CMyDlg::OnDestroy()
{
CDialog::OnDestroy();
m_bRunning = FALSE;
WaitForSingleObject(m_pSendDataThread->m_hThread, INFINITE);
delete m_pSendDataThread;
}
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Ok, that works fine with AfxBeginThread and WaitForSingleObject (I just replaced these functions).
Don't know why it didn't work with my method!
Thanks a lot for your help
|
|
|
|
|
PocketPC 2002
EVC 3.0
Using MFC
I've tried a numer of things to get a splash screen displayed, but nothing seems to work. I'm also trying to get a *full screen* splash screen.
[EDIT] I can't seem to get a modeless dialog box to display at all.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Hello,
Is there a wireless 802.11b utility sample code which can detect SSID and singal ...?
Joye
|
|
|
|
|
Dear Friends,
I have created an MFC ActiveX Control using embdedded VC++ 4.0.
I have two problems/issues here. All the functionality which i
need i have already imeplemented.
problem1
---------
If i want change the default CLSID of my ActiveX Control to
some other CLSID. how can i do that.
problem2
---------
In some situations i need to use TreatAs registry key to transfer
the request that comes to my ActiveX Control. This TreatAs registry
key is not working for me currently. Is there any specific setting
i have to do in ActiveX Control for using TreatAs key.
Thanks and Best Regards,
subramjobmail,
2003/06/26 (09:49 JST).
|
|
|
|
|
Hello,
How to detect a thread function was ended(exit)?
When a thread function ended and I will close it's handle. How to Close this handle in another thread?
Thanks.
Joye
|
|
|
|
|
Take a look at the following article Using Worker Threads.
void CMyView::OnClose()
{
myWorkerThread->m_bAutoDelete = FALSE;
running = FALSE;
WaitForSingleObject(myWorkerThread->m_hThread, INFINITE);
delete myWorkerThread;
CView::OnClose();
}
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hello everyone,
I write a POCKET PC Irda Chat application.
Two POCKET PC transmiss data to each other.
When one application is close, then start up again and ready to send data but this action will get a error code=1359.
If two devices closed and start up again, the function will work fine.
The question is when one closed and never can connect with the other one.Why?
Please reply the answer to tsung-yu@yahoo.com.tw simultaneously.
Thanks.
|
|
|
|