|
How do I send data through the parallel port in C#... in other words... can i?
/\ |_ E X E GG
|
|
|
|
|
Hello All
I am developing in eVC++ an application that reads from the serial port the binary data sent by a GPS receiver (Sirf protocol)
The way of reading is the typical one, with a thread as shown in the tty example (Pocket PC 2002). Every time a character arrives, I do more or less the following:
BOOL bReturn = TRUE;<br />
DWORD dwCodsError, dwNumBytes, dwNumBytesRead; <br />
COMSTAT ComState;<br />
unsigned char BufferRead[5600];<br />
<br />
ClearCommError(m_hPort, &dwCodsError, &ComState);<br />
dwNumBytes=ComState.cbInQue;<br />
if(dwNumBytes>0)<br />
{<br />
bReturn=ReadFile(m_hPort, BufferRead, dwNumBytes, &NumBytesRead, NULL);<br />
}
The problem is that the application does a lot of work, and from time to time, when the application is busiest, I lose some of the messages of the reveiver. In such cases, I have notice that cbInQue value is 2047, and that it never exceeds that number. I guess that is the maximum value of the Port Serial buffer-in. That should be the reason why subsequent messages are not stored in the buffer.
At present I am trying not to overload so much the application, but I would like to know if it is possible to change the buffer-in size. In this way, I would not lose so many messages. I have tried with:
SetupComm(m_hPort,BUFFER_IN_SIZE,BUFFER_OUT_SIZE);
with BUFFER_IN_SIZE = 4095 and BUFFER_OUT_SIZE = 2047, but it doesn't work.
Any Suggestions?
Thanks in Advance
PD: I am using the Emtac PCMCIA GPS receiver (just in case it was a problem with the driver)
Carlos
|
|
|
|
|
Try to increase the priority of the reading thread!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Does anybody know, how to get the free disk space using RAPI, even in case of storage cards.
CeGlobalMemoryStatus does not provide enough information.
I'm out of ideas.
With best regards
Klaus Langelüddeke
|
|
|
|
|
I think you'll have to write a DLL for the device which calls GetDiskFreeSpaceEx , and invoke it from the desktop with CeRapiInvoke .
The Pocket PC 2002 SDK includes a sample called CeInvoke, typically located at C:\Windows CE Tools\wce300\Pocket PC 2002\samples\win32\Ceinvoke .
|
|
|
|
|
Thats the way i tried to avoid, but this seems also to me the only possible solution.
Thanks
Klaus
|
|
|
|
|
LOGFONT lf;<br />
memset(&lf,0,sizeof(LOGFONT));<br />
_tcscpy(lf.lfFaceName,_T("Arial"));<br />
lf.lfHeight=18;<br />
m_font.CreateFontIndirect(&lf);<br />
m_wndCommandBar.SetFont(&m_font);<br />
m_wndCommandBar.Invalidate();
Why can't I set font to CCeCommandBar variable ??? I want my menu have some characters in Vietnamese (Unicode) but something's wrong there. And another thing is that I can't input Unicode text in Resources. (I tried to input like \x1ea3... but also failed)
|
|
|
|
|
Does anyone know how to convert BSTR/CString to _bstr_t
|
|
|
|
|
The _bstr_t constructors accepts both const TCHAR * and BSTR , so it should be direct:
CString strOne(_T("One"));
_bstr_t bstr(strOne);
|
|
|
|
|
I'm getting this error:
error LNK2019: unresolved external symbol "void __cdecl _com_issue_error(long)" (?_com_issue_error@@YAXJ@Z) referenced in function "public: __thiscall _bstr_t::_bstr_t(unsigned short const *)" (??0_bstr_t@@QAE@PBG@Z)
Any suggestions?
|
|
|
|
|
Anonymous wrote:
Any suggestions?
Yes. You have to declare this function in order to trap COM errors. This function will only be declared once. You can use the following:
void __stdcall _com_issue_error(HRESULT m_hr)
{
TCHAR pcszError[1024];
_stprintf(pcszError, TEXT("_com_issue_error(%ld)\n"), m_hr);
OutputDebugString(pcszError);
}
|
|
|
|
|
I'd avoid _bstr_t altogether. Use ATL's CComBSTR. It's smaller.
|
|
|
|
|
hi all,
How to create a pocket excel file using eVC++. Can anyone give me a sample code.
Thanks in advance
Mahesh
|
|
|
|
|
hi
i tried to connect to pocket access using eVC++. But i am not able to establish connection.Can any one help me ..please. A sample code for connecting to pocket access will do.
Mahesh
|
|
|
|
|
|
Hello,All;
How to scan access point around?
Thanks.
Joye
|
|
|
|
|
I first had an older iPaq connected via it's cradle/usb. I went out, bought a new iPaq, installed ActiveSync 3.7 (after un-installing 3.5), now Visual Studio .NET 2003 can't establish a connection to the new iPaq.
What's with that?
Thanks!
-v
****************************
V. Jenks
www.scientifik.com
|
|
|
|
|
Does ActiveSync 3.7 see your new iPAQ?
|
|
|
|
|
Yes it does, however vs.net 2k3 does not. It did see it when I was using my old iPaq w/ AS 3.5. I uninstalled that and installed AS 3.7 to accomodate w/ my new iPaq.
Now vs.net won't recognized my pocket pc device. This means I don't have debugging capabilities, which really, really bites.
Thanks!
****************************
V. Jenks
www.scientifik.com
|
|
|
|
|
... and reinstalling vs.net must be out of the question, right? Try to ask this question in www.pocketpcdn.com. There is a .Net-specific forum. Good luck!
|
|
|
|
|
It's not entirely out of the question, however that's not something I'm at all interested in doing. There is no guarantee that it will solve the problem and it may end up causing new and unexpected problems that I don't have time to deal with right now (big deadlines coming up.)
Thanks, I'll try the folks there.
|
|
|
|
|
Hello,
Where has a FTP client sample code written by evc?
Thanks.
Joye
|
|
|
|
|
Hi all,
Can any one tell me how to connect to pocket access database and execute commands.I am using eVC++.
Mahesh
|
|
|
|
|
Try using ADOCE. The type library is available in the adoce31.tlb file. You can use the #import directive on this file.
|
|
|
|
|
hi
i am new to eVC++. can you please give me a sample code.
Mahesh
|
|
|
|