|
Looks good, but I have never used select() on Windows.
Perhaps have a look at the questions I had, they might give you some ideas.
|
|
|
|
|
In ARM processor, which BSP r u using? how r u receiving Data? U TCP stack implemented? If u have stack implementation, there should not be problem in sending. If u dont have stack implementation, u have to assemble the packet in the TCP/IP struct and have to send it.
|
|
|
|
|
I'm not using any BSP and I implemented the TCP stack myself. I am able to establish communication via the 3-way handshaking process and then I assemble the package and send it. I used Wireshark to trap the packets between the PC and the micro and it recognizes it as a valid TCP/IP packet so I'm assuming it's formated properly.
|
|
|
|
|
Please, write international English, not stenography.
We are not chatting with a phone.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Please elaborate as to which part of the post wasn't in "international" English and I will be happy to clarify.
|
|
|
|
|
masnu wrote: Please elaborate as to which part of the post wasn't in "international" English and I will be happy to clarify.
"r"
"u"
Mind you, once translated from text messaging, it was a helpful question / answer.
Iain,
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
For those of you who are interested I finally figured out what the problem was. When I implemented the TCP/IP stack on the micro I made a mistake in the routine that calculates the IP header checksum. With an invalid checksum Winsock just disregarded the message. Once the correct checksum was sent everything worked fine.
Thanks to all of you for your help. I appreciate it.
Paul
|
|
|
|
|
So it was not a Winsock problem at all.
|
|
|
|
|
Nope! It was a me problem!!
Thanks Moak!
|
|
|
|
|
If you don't mind me asking, which network analyser did you use that didn't display an incorrect checksum?
|
|
|
|
|
I was using Wireshark, but it DID display an incorrect checksum. I just got busy doing other things and completely overlooked it. It wasn't until I focused on the problem that I paid attention to what the analyzer was telling me.
|
|
|
|
|
Cool, the reason I asked is we have a similar project coming up, and a long time ago I ran into a goofy problem with a fairly early version of Ethereal where it didn't flag some field as having an invalid value, I lost a lot of hair over that one!
|
|
|
|
|
I can see how that would happen. Thankfully this one didn't take me that much time. Try WireShark http://www.wireshark.org/[^] it's a useful tool.
|
|
|
|
|
What wonders me now... that you actually have seen the corrupt IP packages in Wireshark. I was assuming you ran Wireshark on Windows PC and your hosts are connected via a switch, shouldn't the switch throw away the IP packages from the embedded board with wrong header checksum instead of forwarding them?
|
|
|
|
|
Oops I was thinking wrong. IP packages are OSI Layer 3 and network switches operate on Layer 2... so they couldn't care less about IP header checksums. Sorry for the confusion.
Happy coding!
|
|
|
|
|
No.. I had my embedded board connected to the PC with a cross-over cable.. no switch.
|
|
|
|
|
Hi
In my application I run Windows Search (Find files and fodlers) using IShellDispatch::FindFiles. However when the Search feature is disabled I get a message "There is no program associated to perform the requested action...". This is not nice.
I'd like to disable my search functionality when Windows Search is uninstalled. Does anybody know how to detect if Windows Search is available?
Thanks
Ivo
|
|
|
|
|
Try IShellDispatch2::IsServiceRunning with service name as WSearch .
|
|
|
|
|
Thanks, that did the trick.
|
|
|
|
|
Hi I have created a list box using CListBox class. I want to give the hover effect on the list box item. like combo box.
Please anyone can help me how to do that.
Thanks
|
|
|
|
|
You will need to handle the WM_MOUSEMOVE message and do the handling yourself.
|
|
|
|
|
Can u post some sample code please ???
|
|
|
|
|
No, but here is the rough idea.
1. Create a new class derived from CListBox -> CHoverListBox.
2. Make it owner drawn (a window style).
3. Override DrawItem() and possibly OnMeasureItem(). You will need DrawItem since you will be changing the visual appearance of the control while hovering.
4. Add a message handler for WM_MOUSEMOVE, and in this handler figure out which item the cursor is over. Cooridnates of the mouse is supplied in screen coords, so you should convert them to client coords using CListBox::ScreenToClient(). Then use CListBox::GetItemRect() to find the hovered item. Set a flag for this item, and then call Invalidate(FALSE) to force a repaint.
5. Implement DrawItem() to look at the flag set, and paint the items accordingly.
6. Now you have a reusable class.
7. Write an article about what you did and post it on this site.
Tip: Do not use CListBox::SetItemData() to set the flag, because the space is likely to be needed by the users of your control. Use a separate integer in your class instead.
|
|
|
|
|
Hi!
I'm passing a string variable to a function. Only the first letter of the string value is assigned to the formal parameter. Here is my function:
void setTextToButtons(stringw country, int tabSelected);
irr::core::stringw country = irr::core::stringw(list->getItem(countryCode));
setTextToButtons(country, tabSelected);
void CGameMenuPlayerProfileState::setTextToButtons(stringw country, int tabSelected)
{
stringw query;
query = L"Select Name from ";
if(tabSelected = 17) {query += L"Test";}
else if(tabSelected == 18){query += L"ODI";}
else if(tabSelected == 19){query += L"T20I";}
else {query += L"Test";}
query += L" WHERE Team = '";
query += country;
query += "' ORDER BY RANDOM() LIMIT 11";
printf("%s\n",query.c_str());
playerLst = SQLdb.Query(query);
printf("Selected Country%s\n", country);
for(int i = 0; i < 11; i++)
{
m_pPlayerBtn[i]->setText(irr::core::stringw(playerLst[i]).c_str());
cout<<query.c_str()<<endl;
}
}
How to pass the full string value in to the function?
|
|
|
|
|
You are not using this correctly
printf("Selected Country%s\n", country);
First off, unless stringw is a typedefed _wchar_t* you need a cast function. Then, you need capital %S to print a unicode string using printf.
The parameter passing looks ok otherwise. (even though I alway use const& for those types)
|
|
|
|