|
No one has ran across this before or has any advice?
I have tried all the settings in my linker, and C++ tabs in my project properties, I have tried rearranging the order of my includes (read this from another site) as well as redownloading and reinstalling the Windows SDK. I am about to reinstall Visual Studio 2008.
Any help at all would be appreciated!
|
|
|
|
|
I have a problem where I wish to receive broadcast UDP using call recvfrom, it just sits on the call waiting, although the packets are arriving as I can see in Wireshark.
In the scenario, I have a virtual machine which provides the broadcast packets on UDP port 3000, which are being received on the host machine through the loopback adapter. As a starting point, I’ve used the example code from the MSDN Library entry for recvfrom and changed the port value to 3000, and used setsockopt to set SO_BROADCAST to true.
Using netstat, I can see an active connection on my process for 0.0.0.0:3000.
Where am I going wrong?
Any help appreciated
david
EDIT: im kind of thinking its something to do with it coming from a virtual machine over a loopback adapter???
And by the way, its on Vista64 using Visual Studio 2005
modified on Wednesday, December 3, 2008 11:35 AM
|
|
|
|
|
seadsl wrote: im kind of thinking its something to do with it coming from a virtual machine over a loopback adapter???
Did you attempt to prove that theory by executing the systems without using the virtual machine?
led mike
|
|
|
|
|
Unfortunately its not an option, I must use the UDP packets from the virtual machine. I dont have any other broadcast source.
|
|
|
|
|
seadsl wrote: I dont have any other broadcast source.
Umm, then you make one so you can test the theory.
led mike
|
|
|
|
|
Its fixed now.
For anyone else with the same problem:
In Windows Vista, you cant bind a socket to 0.0.0.0 to receive all broadcasts.
If you are receiving from a multicast address, you need to set the socket options to indicate the multicast group (address) you need to subscribe to, the source address, and the local interface:
imr.imr_multiaddr.s_addr = inet_addr("224.x.x.x");
imr.imr_sourceaddr.s_addr = inet_addr("s.s.s.s");
imr.imr_interface.s_addr = inet_addr("192.168.1.1");
retvalset = setsockopt(
RecvSocket,
IPPROTO_IP,
IP_ADD_SOURCE_MEMBERSHIP,
(char*)&imr,
sizeof(imr));
|
|
|
|
|
Hello,
I've searched very much to find an example of using keyboardmanger() class.
Could you lead me and give me an example of using last key was pressed.
Please help me as soon as possible.
Thanks
hnaghdali
|
|
|
|
|
what is this 'keyboardmanger() class' supposed to do?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
hnaghdali wrote: Could you lead me and give me an example of using last key was pressed.
Ofcourse. Why not! Basically you have to hook the keyboard. Check these articles - Hooking the Keyboard[^] and An All-Purpose Keyboard Hooker.[^].
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I have a Property Sheet and I need to disable the close button, the red "X" button that appears on the right top of the sheet. What is the procedure for disabling it?
|
|
|
|
|
CMenu* pSysMenu = GetSystemMenu( FALSE );
pSysMenu->DeleteMenu( SC_CLOSE, MF_BYCOMMAND );
|
|
|
|
|
Thanks
|
|
|
|
|
Hi,
I would like to know if there is a better way of writing a particular pattern of the code as mentioned below. I have been encountering this type quite frequently and do not like the way it is implemented. The code piece is as follows
class Address
{
public:
Address():m_address("")
{}
Address(const CString& addr) : m_address(addr)
{}
CString GetAddress()------------------ (1)
{
return m_address;
}
CString GetAddress() const ------------------ (1a)
{
return m_address;
}
const CString& GetAddress() const -----(2)
{
return m_address;
}
private:
CString m_address;
};
Now somewhere in main method
Address addr("Living somewhere on Earth");
further down a call is made into a third party library which only takes char* and has a method like
void FormatAddress(char* address); -------(3)
Now if I make a call to this method, I must do this
FormatAddress(const_cast<char*>(addr.GetAddress().GetString()); -------------(4)
So my query is whether the whole piece of code is correct, sure it does compile and gives the result as expected
but I am looking to improve my programming skills and want to write a better and cleaner code.
Out of the methods 1 and 1a which is more correct? Does it makes sense to make the m_address variable as mutable.
Thanks and Regards
|
|
|
|
|
LPCTSTR GetAddress() const
{
return m_address;
}
as the only access function
when void FormatAddress(...) is NOT changing the input paramters
Greetings from Germany
|
|
|
|
|
Can any one direct me to develop a generic report writer with VC++ 6. What I need is I have some data in some text files and I want to display it in some report-viewer-style. Please don't ask me to dump it into some standard database and use a third-party tool to view it.
There are some utilities provided in this site itself but is not up-to-the mark.
|
|
|
|
|
Member 275519 wrote: I have some data in some text files and I want to display it in some report-viewer-style.
Can't you use SDI/MDI with doc/view architecture...?
|
|
|
|
|
Thanks
But I didn't get you. What I want is a report-viewer-style presentation. I want to display the data page by page. I want a form-view or a control in SDI/MDI which will represent a white-paper (page) and I can arrange the headers,body,sub-footer and footer in it. Is there any kind of window-class already developed and distributed in codeproject. I just want a child window ( control ) which will represent a A4-size paper. Rest I can do....
|
|
|
|
|
Member 275519 wrote: Is there any kind of window-class already developed and distributed in codeproject.
You may search for that...
Member 275519 wrote: I just want a child window ( control ) which will represent a A4-size pape
What about simply coding that??? If you just want to show it page by page, a Dialog Application is enough...
|
|
|
|
|
On the status bar in first pane how can i show the help information about the menu items when they are selected or positioned in a dialog based application?
thanks in advance
|
|
|
|
|
|
Anjali Patil wrote: dialog based application?
Anjali Patil wrote: On the status bar in first pane
Excuse me, a dialog has a status bar? Why can't you just use the doc/view architecture instead? A lot of such work will be done by the framework automatically for you then!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
but requirement is like this.
i should use dialog box only.
|
|
|
|
|
Does this[^] article help?
Regards,
Sandip.
|
|
|
|
|
Hi
experts i tried a lot to update the IOlkAccount properties data but failed,please provide me code for the use the
HRESULT IOlkAccount::SetProp(DWORD dwProp, ACCT_VARIANT *pVar);
i need a code that set the following propeties of the IOlkAccount interface.
PROP_ACCT_ID
PROP_ACCT_IS_EXCH
PROP_ACCT_NAME
PROP_ACCT_SEND_STAMP
PROP_ACCT_STAMP
PROP_ACCT_USER_DISPLAY_NAME
i hope experts will give soon a code for my above problem!
Sanjay Vishwakarma
|
|
|
|