|
you need to eloborate on this. What micro controler and what kind of binary file. binary file is the firmware or just data
|
|
|
|
|
Hello, I need some suggestions from a GPS-hare!
I am starting to implement GPS into my app, which is running same time as a navigation system is running, thus it has to share the gps port, whatever it is made of (serial, bluetooth, usb and so on).
I saw one can use the commercial solution "Franson GPS Gate", which provides "virtual ports" by taking the original signals and then forwards them to its emulated ports.
So here is my first question:
Is there any way to emualte such a port myself, i mean, grab the signal from the port and provide a virtual port from within my app, so the navi-soft gets its signal from MY app?
And another question I have: Can anyone suggest some mfc classes encapsulating the NMEA protocol?
Thank you very very much!
Martin
|
|
|
|
|
I'm having a bit of a problem getting the handle to my listview. Can anyone suggest how I would pass this so that I can get the listview text and compare?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I am not that experienced but as far as i know you have to pass a callback funtion as parameter:
i have done it useing mfc so zou have to translate that somewhat, this is the member function i declared as member of my derived listview, this example is used to sort numeric columns:
static int CALLBACK CallbackSortNumeric(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
Then, when you add a column, you have to pass the adress of the function (PFNLVCOMPARE pCALLBACKSORT):
this->InsertColumn(nCol, cHead,pCALLBACKSORT,iSortMode,iFormat, nWidth,nSubItem);
This way the sorting is managed in CallBackSortNumeric.
Hope it helps...
Martin...
|
|
|
|
|
ClockDivider wrote:
I am not that experienced but as far as i know you have to pass a callback funtion as parameter:
Yeah I did that. My problem is that in my callback I need to access the window handle and I cannot. I get a compiler error:
illegal reference to data member 'FileTransfer::hWnd' in a static member function
Here is my callback code:
<br />
int CALLBACK FileTransfer::ListViewCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)<br />
{<br />
static LV_FINDINFO fi;<br />
static int nItem1, nItem2;<br />
static char szBuf1[30], szBuf2[30];<br />
<br />
fi.flags = LVFI_PARAM;<br />
fi.lParam = lParam1;<br />
<br />
nItem1 = ListView_FindItem(hWnd, -1, &fi);<br />
<br />
fi.lParam = lParam2;<br />
<br />
<br />
return 0;<br />
}<br />
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I am not sure why but here is some code i have in my function that might belong to the problem:
int CALLBACK CListCtrlEx::CallbackSortString(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the list view control.
CListCtrlEx* pListCtrl = (CListCtrlEx*) lParamSort;
}
Thus you should be able to convert lParamSort to a CWnd* which then provides the propper m_hWnd
Is that true?
|
|
|
|
|
The problem with this is that I'm not using any MFC.
Here is my event code:
<br />
LPNMLISTVIEW lpNmlv = (LPNMLISTVIEW) lParam;<br />
<br />
case LVN_COLUMNCLICK:<br />
if (lpNmlv->hdr.hwndFrom == GetDlgItem(hWnd, IDC_LOCAL_FILELIST))<br />
{<br />
ListView_SortItems(lpNmlv->hdr.hwndFrom, ListViewCompareProc,(LPARAM)(lpNmlv));<br />
}<br />
<br />
if (lpNmlv->hdr.hwndFrom == GetDlgItem(hWnd, IDC_REMOTE_FILELIST))<br />
{<br />
HWND RemoteHwnd = GetDlgItem(hWnd, IDC_REMOTE_FILELIST);<br />
}<br />
return TRUE;<br />
<br />
<br />
int CALLBACK FileTransfer::ListViewCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)<br />
{<br />
static LV_FINDINFO fi;<br />
static int nItem1, nItem2;<br />
static char szBuf1[30], szBuf2[30];<br />
NMLISTVIEW *lpNmlv = (NMLISTVIEW*)lParamSort;<br />
<br />
fi.flags = LVFI_PARAM;<br />
fi.lParam = lParam1;<br />
<br />
nItem1 = ListView_FindItem(lpNmlv->hdr.hwndFrom, -1, &fi);<br />
<br />
fi.lParam = lParam2;<br />
nItem2 = ListView_FindItem(lpNmlv->hdr.hwndFrom, -1, &fi);<br />
ListView_GetItemText(lpNmlv->hdr.hwndFrom, nItem1, lParamSort, szBuf1, sizeof(szBuf1));<br />
ListView_GetItemText(lpNmlv->hdr.hwndFrom, nItem2, lParamSort, szBuf2, sizeof(szBuf2));<br />
<br />
if (lpNmlv)
return(strcmp(szBuf1, szBuf2));<br />
else<br />
return(strcmp(szBuf1, szBuf2) * -1);<br />
<br />
}<br />
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Ummm... Your code compiles here...
But you already changed the calling of the ListView_FindItem and ListView_GetItemText, now using the lpNmlv.>hdr.hwndFrom, no?
What is the exact compiler error?
|
|
|
|
|
Yeah it compiles fine now. Just still not getting anything. I think I'm not setting my pointers correctly or the NMLISTVIEW struct.
You know there aren't very many samples of how to use this out there on the internet. Must be used much.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
The prob is this in:
ListView_GetItemText(lpNmlv->hdr.hwndFrom, lParam2, lParamSort, szBuf2, sizeof(szBuf2));
the parameter lParamsort is wrong here, it should define the column (lpNmlv->iSubItem).
AND: Do you to set the LPARAM value when inserting your item?
Here is an excerpt from .NET help: "The lParam1 parameter is the 32-bit value associated with the first item being compared, and the lParam2 parameter is the value associated with the second item. These are the values specified in the lParam member of the items’ LVITEM structure when they were inserted into the list."
I hade precisely the same problems as you, now that I assured being the item.lPram member valid and changing the wrong parameter value to the item.iSubitem it works...
Hope it helps now?...
|
|
|
|
|
Tom Wright wrote:
My problem is that in my callback I need to access the window handle and I cannot
That's what the lParamSort paramter is for. You pass in whatever you want (for examnple, a number or a pointer to a data structure), and the same value is passed to your comparison function. Your comparision function can then interpret that lParam in the right way (as a number or dereference the pointer to get the data structure again), and process it.
|
|
|
|
|
I think you should be using ListView_GetItemData() with lParam1 and lParam2 .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I’ve used the CopyFile function for copy a file, but are there any “CopyDirectory”-function?
_____________________________
...and justice for all
APe
|
|
|
|
|
|
d00_ape wrote:
’ve used the CopyFile function for copy a file, but are there any “CopyDirectory”-function?
In Continuation with Mr. Ravi, this link provide you wrapper to ShFileOperation:-
http://www.codeproject.com/shell/cshellfileop.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
How would one go about adding a date time picker control to a list control (in report view)?
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
|
Hi
I have used the CFM_LINK, CFE_LINK style to some text in my CRichEditCtrl. The problem is that whatever color you choose for the whole text, the text with link properties is always blue and underlined. Due to design constrains, the background color of my CRichEditCtrl is... blue.
How could I change the color of the link text?
Thanks in advance
|
|
|
|
|
Hello!
I have to write a class in c++ which takes a char* as input, which is the content of an xml document, and gives back the canonical form of it without comments.
The problem is: i have to use msxml 4.0 or older, i cannot use .net, libxml etc.
I have been searching the web for a while now but nothing. If anybody could help me please do so.
|
|
|
|
|
Ruis Ngetal wrote:
...and gives back the canonical form of it without comments.
Are you wanting to canonicalize the name of the XML file or its contents? If the latter, are the strings actually file paths or URLs?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Well i get a string like:
"<?xml version="1.0"?>
<?xml-stylesheet href="doc.xsl"
type="text/xsl" ?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc>Hello, world!<!-- Comment 1 --></doc>
<?pi-without-data ?>
<!-- Comment 2 -->
<!-- Comment 3 -->"
with all the whitespaces and linefeeds and the like, and i have to give back something like this:
"<?xml-stylesheet href="doc.xsl"
type="text/xsl" ?>
<doc>Hello, world!</doc>
<?pi-without-data?>"
normalizing the line feeds and whitespaces etc. as written in w3c's c14n standard (http://www.w3.org/TR/2001/REC-xml-c14n-20010315)
so i have to make a c14n canonicalizer.
|
|
|
|
|
Ruis Ngetal wrote:
so i have to make a c14n canonicalizer.
I wonder if the document's author, John Boyer, knows of any such utility.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
When open up the RHPOP3Connect.ntf (freeware downloaded at http://www.rhacl.de/freesoft.html), there are four java classes for: RHPOP3Connector, Pop3Mail, SMTPMail, and SocketMail. Anyone knows the source code for them?
David Li
|
|
|
|
|
int x = 1;
x = x++;
I think this should be well defined.
The operations are:
1. ++
2. =
As the expression x++ is an operand of operator=, I think it should be evaluated first (??).
The final value of x should then be 1.
But the increment seems to occur after the assignment. And x = 2.
|
|
|
|
|
pesho2932 wrote:
But the increment seems to occur after the assignment.
x++ is the post-increment operator. it increments after returning the value of the variable.
++x is the pre-increment operator. it increments before returning the value of the variable.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
I know that (of course).
It can still be after the return and before the assignment. I think it should be there because the expression x++ is evaluated before the assignemet and it's effect should be complete by the time assignment occurs.
|
|
|
|