|
|
Hi, I need to send a button click message to a dialog window button from a thread. I use "PostMessage(BN_CLICKED, IDC_GPS,m_hWnd) " but I think the lparam and wparam are incorrect. I don't find an example or something else.
Can anybody help me?
Thank you.
Regards.
Regards,
Javier
|
|
|
|
|
I try to use use PostMessage(WM_COMMAND, MAKEWPARAM(IDC_GPS, BN_CLICKED), <button
> handle>).
Then I try to use "HWND GetDlgItem( int nID )" to get the button handle, but the
compiler makes a error: I can use Cwnd::GetDlgItem ( ) , but not
CWindow::GetDlgItem , which returns the button handle.
How can I use the Window classe?
Thanks.
Regards,
Javier
|
|
|
|
|
The BN_CLICKED message is a notification sent to the button's parent window. If you want to simulate a button press, send the BM_CLICK message to the button.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Hi, João .
ok, I use:
HWND Hbutton = GetDlgItem(ptrDlg->m_hWnd,IDOK);<br />
SendMessage (Hbutton,BM_CLICK,0,0);
from my thread and it works.
Another question: if I want to send it from the same dialog window (for example from other button), How can I get the handle to the button? Well, I test the following:
SendDlgItemMessage(IDC_GPS,BM_CLICK, 0, 0 );
from the same dialog and it works.
Thanks
Regards,
Javier
|
|
|
|
|
Hi,
What is the difference between Win CE 4.2 and Windows Mobile 2003?
Does Embedded visual c++ 4 support development for Windows Mobile 2003 as it does for WinCE 4.2?
Regards,
Eli
|
|
|
|
|
O.K
I realized that Windows Mobile 2003 is actually Windows CE .NET 4.2.
There is a good article :
http://www.oreillynet.com/pub/a/wireless/2003/07/23/mobile_2003.html
|
|
|
|
|
..good.. sorry the link was wrong, here's the correct one:
www.opennetcf.org/Forums/topic.asp?TOPIC_ID=317
|
|
|
|
|
I had problems using GetDC and ReleaseDC, so I built a blank MFC app like this:
BOOL CTestdcDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
<br />
CenterWindow(GetDesktopWindow());
<br />
SetTimer(1,200,NULL); <br />
return TRUE;
}<br />
<br />
<br />
<br />
void CTestdcDlg::OnTimer(UINT nIDEvent) <br />
{<br />
CDC *myDC;<br />
switch(nIDEvent)<br />
{<br />
case 1:<br />
myDC=GetDC();<br />
ReleaseDC(myDC);<br />
break;<br />
}<br />
CDialog::OnTimer(nIDEvent);<br />
}
The memory used by this application increases continuously.
What am I missing?
This issue is causing me a lot of problems, do you ever encountered a problem like this?
Thanks,
Keraam
|
|
|
|
|
Hi,
I don't really see the problem,but try to change the timer interval(i don't think that GetDC() and ReleaseDC() takes more than 200msec,but maybe it's the problem).
Good luck
Eli
|
|
|
|
|
I already tryied but it doesn't change. Thank you anyway.
I fixed the problem using handles instead of pointers for the dc, but I really don't understand why it happens.
|
|
|
|
|
Hi, I need to have a pointer to a dialog window from a thread. I made a global pointer variable to a dialog window and it works. But Is it possible to do a pointer which can pointer to several dialogs (one at the same time)?
I need to pointer to the active dialog from the thread(the active dialog window it's not the same all the time). I try "void* pointer" but doesn't work, (there'is a error in the reference to the pointer inside the thread).
Regards.
Regards,
Javier
|
|
|
|
|
You must access the pointer value inside a critical section. Otherwise you risk having data corruption.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Hi everybody,
I am developing a collaboration application on a Win CE .NET 4.2 based device and Windows 2k/XP based devices and I am trying to remote control the CE device (e.g. like it is possible on desktops with VNC). Basically, this is possible, since it can be done with the Active Sync remote display application. However I'd like to create my own remote control and integrate it into my appliaction, hence my question is: Is it possible to use the interface the AS remote display uses? Does anybody know if this protocol/API is documented somewhere?
Thank you very much
|
|
|
|
|
Hi,
In order to create a virtual COM port(for BlueTooth Comunication),
I need the address of the BlueTooth device.
I know the BD_ADDR,but i must convert it to BT_ADDR if i want to use
the RegisterDevice() function.
anyone?
Regards,
Eli
|
|
|
|
|
First, you must know the bluetooth stack that your device has. RegisterDevice() is only supported by Microsoft Bluetooth stack. For example IPAQs uses Windcomm Stack and "RegisterDevice()" doesn't work. So if it's not microsoft Stack, you must buy the correct bluetooth Stack SDK for development.
I made a virtual serial port without "RegisterDevice()" in my IPAQ. Simply uses the normal Open port, close port , read port and write port like it'was a normal serial port. I use the COM8 in my IPAQ hx4700 and it's works. When I open the port, appears a Window Dialog (made by the own Operative System) for choose the bluetooh device to connect. If you want to do this in your own app you must use a bluetooth Stack SDK for development in your device.
Regards.
Regards,
Javier
|
|
|
|
|
Hi Javier,
First,I really appriciate your detailed answer.
just today i saw that iPaq uses the widcom stack and not the MS stack(is that the reason i can't use WSALookupServiceBrgin() etc.)?
anyway,are you using COM8 for both incoming and outgoing massages(i use also the ipaq h2210 and it use COM5 for input and COM8 for output)
Best regards,and thanx,again
Eli
|
|
|
|
|
If you have a IPAQ (uses windcom stack) then you cannot use RegisterDevice. About " WSALookupServiceBrgin()" I dont know, surely not, but you can ask in the microsoft Pocket PC 's developer: http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.pocketpc.developer[^]
Yes, I use the COM8 for read and write. I saw the Bluetooth config and I saw COM5 for input too, but using COM8 both works. Simply try a sample serial com code (easy to find it, in this web there is something), using COM8 and it must work. If not, try another COM.
Regards.
Regards,
Javier
|
|
|
|
|
Hi Javier,
I tried to open COM8,but when i open this port,and choose the remote device,
it automaticly create ActiveSync SerialPort connection(instead of generic serial connection).
Here is my code:
//============================================================================
bool PDA_BlueTooth::OutputPortOpening()
{
DWORD dwError;
DCB PortDCB;
COMMTIMEOUTS CommTimeouts;
// Open the serial port.
hOUTPUT = CreateFile(TEXT("COM8:"),GENERIC_READ |
GENERIC_WRITE,0,NULL,CREATE_ALWAYS,0,NULL);
// if it fails to open the port, return FALSE.
if ( hOUTPUT == INVALID_HANDLE_VALUE )
{
// Could not open the port.
AfxMessageBox (TEXT("Unable to open BlueTooth Output Port!!!"));
dwError = GetLastError ();
return false;
}
::SetupComm(hOUTPUT,4000, 2048);
PortDCB.DCBlength = sizeof (DCB);
// Get the default port setting information.
GetCommState (hOUTPUT, &PortDCB);
// Change the DCB structure settings.
PortDCB.BaudRate = 115200; // Current CANgine Baudrate
PortDCB.fBinary = TRUE; // Binary mode; no EOF check
PortDCB.fParity = FALSE; // Disable parity checking
PortDCB.fOutxCtsFlow = FALSE; // No CTS output flow control
PortDCB.fOutxDsrFlow = FALSE; // No DSR output flow control
PortDCB.fDtrControl = DTR_CONTROL_ENABLE;
// DTR flow control type
PortDCB.fDsrSensitivity = FALSE; // DSR sensitivity
PortDCB.fTXContinueOnXoff = TRUE; // XOFF continues Tx
PortDCB.fOutX = FALSE; // No XON/XOFF out flow control
PortDCB.fInX = FALSE; // No XON/XOFF in flow control
PortDCB.fErrorChar = FALSE; // Disable error replacement
PortDCB.fNull = FALSE; // Disable null stripping
PortDCB.fRtsControl = RTS_CONTROL_ENABLE;
// RTS flow control
PortDCB.fAbortOnError = FALSE; // Do not abort reads/writes on
// error
PortDCB.ByteSize = 8; // Number of bits/byte, 4-8
PortDCB.Parity = NOPARITY; // 0-4=no,odd,even,mark,space
PortDCB.StopBits = ONESTOPBIT; // 0,1,2 = 1, 1.5, 2
// Configure the port according to the specifications of the DCB
// structure.
if (!SetCommState (hOUTPUT, &PortDCB))
{
// Could not create the read thread.
AfxMessageBox (TEXT("Unable to configure BlueTooth Output Port"));
dwError = GetLastError ();
return false;
}
// Retrieve the time-out parameters for all read and write operations
// on the port.
GetCommTimeouts (hOUTPUT, &CommTimeouts);
// Change the COMMTIMEOUTS structure settings.
CommTimeouts.ReadIntervalTimeout = MAXDWORD;
CommTimeouts.ReadTotalTimeoutMultiplier = 0;
CommTimeouts.ReadTotalTimeoutConstant = 0;
CommTimeouts.WriteTotalTimeoutMultiplier = 10;
CommTimeouts.WriteTotalTimeoutConstant = 1000;
// Set the time-out parameters for all read and write operations
// on the port.
if (!SetCommTimeouts (hOUTPUT, &CommTimeouts))
{
AfxMessageBox(TEXT("Unable to set the time-out parameters\n for
BlueTooth Output Port"));
dwError = GetLastError ();
return false;
}
AfxMessageBox(TEXT("Output Port is open"));
return true;
}
//============================================================================
Can you give me a sample of your code,plz?????
it is driving me crazy.....
Best Regards,
Eli
|
|
|
|
|
Hi,
i want to develop application using eVC++ 4.0 for windows ce 5.0 device. Actually, i want to get the phoone book data(such as call hsitory list, outgoing, received calls, missed calls, address book, sms message list ) from nokia phone to my pocket pc over bluetooh conenction.
i am refering http://www.palowireless.com/infotooth/tutorial.asp for BT developement.
i am able to establish BT connection between two BT devices successfully.
what profile do i need to use for this task ?
do i need to use AT command over serial profile, or object push profile or syncML or IrMC standard ?
please do let me know if you have any idea about it.
please suggest me in detail.
regards,
aks
|
|
|
|
|
Hi,
im creating a pocket pc aplication using Visual Studio 2003, and i have to make a main menu in top of it...
I tried everything, but didnt find any articles about it... any help would be really great!
Thanks!!
Marcelo Oliveira
|
|
|
|
|
Hi,
Every one
i m new to handheld programming and i m trying to work in vb.net. Now i m getting some errors while running pocket pc application in
VS.NET 2003. First i want to ask that the compact framework of vs.net
installs every time when ever i run my application. Is there any problem with my vs.net or
is it a bug in vs.net.
Secondly i cannt call webservice within my application please suggest me the solution i m getting
error "Unable to connect to remote server"
and
also tell me that which book is best for study in this context.
Thirdly,
i want to ask that developers currently are making which type of projects for Pocket Pc s if possible then plz send me few websites that are helpful to me.
Plz reply me in detail or send me the links of articles on web.
I shall be grateful to you.
Thanks in advance.
|
|
|
|
|
I need to me ake communication between VB6 and C#. can some one help me on this...stuck with it for quite long man ,......HELP
LIfe isn't happy any more
|
|
|
|
|
Greetings,
I need a way to interecept the ExtTextOut function for all the running applications. What is the best way to do that? I'm trying to connects characters before they get displayed on the screen. Is there anyway to do that?
Thanks for your help.
If you give me a solution, i will be very happy clan :,)
Bassam
|
|
|
|
|
Greetings,
I need a way to interecept the ExtTextOut function for all the running applications. What is the best way to do that? I'm trying to connects characters before they get displayed on the screen. Is there anyway to do that?
Thanks for your help.
If you give me a solution, i will be very happy clan :,)
Bassam
|
|
|
|
|