|
Actually, the interface which has 172.31.64.9 is a VPN interface (Intel Netstructure), getting a DHCP address every time a connection is set up. So the interface does know how to route 172.0.0.0. As I stated in my sourcecode sample "route add 172.0.0.0 mask 255.0.0.0 172.31.64.9 metric 50 if 2" work just fine. It does make sense.....
|
|
|
|
|
if 172.31.64.9 knows how to route to 172.0.0.0/24, then DHCP will have given a mask of 255.0.0.0 to go with that address. If it did, then yay, your routing works already. If it didn't then trying to manually make a route to that net on that interface won't work.
--- your manual route says that 172.31.64.9 can address the whole of 172.0.0.0
--- your DHCP assigned mask (eg. 255.255.255.0) doesn't agree, hence a conflict.
You can never specify explicit routing rules for local interfaces. IP knows how to route to these already, becuase of their netmask.
The above only applies if you have a single interface.
But, if your DHCP assigned address (172.31.64.9/255.255.255.0) came with a default gateway allocation (eg 172.31.64.254), then you can probably route the whole of 172.0.0.0 to that. eg "route add 172.0.0.0 mask 255.0.0.0 172.31.64.254". That would work.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
No offense, but the routing command i pasted there works like a charm; and besides, that wasn't my question, the question had to do with C++ and CreateIpForwardEntry.
Sorry.
|
|
|
|
|
I know that was your original question. My point is that perhaps CreateIpForwardEntry returns an error in those precise circumstances because the route you're trying to create is invalid!
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I'm missing the point why it should fail. route.exe calls createIpForwardEntry as well (iphlpapi.dll) and from the commandline it works like a charm; I really see no reason why it should fail.
|
|
|
|
|
Is there anybody who knows how to program using the BHO(Browser helper obj)?
I've searched the www,but got no information except for those from MSDN.
|
|
|
|
|
I've done a little bit recently and got most of my info from MSDN, mainly the articles by Dino Esposito.
What is your question?
Michael
|
|
|
|
|
I'm making a client and server program. So far the server works great, but the client is having a little trouble. The problem is coming from 2 connection classes, which are both derived from CBaseSocket which is derived from CAsyncSocket.
One of the classes is CListen and the other is CMessage. CListen listens for a connection and CMessage sends messages to another client program.
Right now, CListen will receive a message from another client program through the socket that basically says "I want to send a message to you, reply please."
CListen then does this:
CBaseSocket *anothersocket;
if(message == "I want to send a message to you")
{
anothersocket = new CMessage();
}
SOCKET socktemp = Detach();
CString sendstring = "Ok, send the message on this socket!";
anothersocket->AttachToSocketAndSend(socktemp, sendstring);
The AttachToSocketAndSend function 'Attach's the CMessage object to the socket and then sends the message.
Basically I want this to transfer control of the socket to the CMessage object. I want the CMessage's OnReceive function to be triggered when the other client sends more data. My problem is that whenever data is received through the the socket, it gets routed to CListen's OnReceive() function (instead of CMessage's.. I want CMessage to handle the received data now)
Can anyone help?
|
|
|
|
|
Hello,
Is there a way to pass in the account name and password in the 12th and 13th parameters of CreateService, by obtaining them. My goal is to pass in the values when the computer is rebooted and the services automatically start.
Thank You
|
|
|
|
|
There is no way to get the password for an account, sorry. It'd be a security hole, and besides the actual passwords aren't stored anywhere, only their hashes.
--Mike--
"Why you keep calling me Jesús? I look Puerto Rican to you?"
-- Samuel L. Jackson in Die Hard 3
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
I have a multiple edit box on a Wizard and I have one problem...when the user clicks on Escape and the focus is on the multiline edit box, the dialog box doesn't close up. However, when I take the multiline property off, the Wizard is closed when I click ESC. In addition, when the foucs is on another single line edit box on the same property sheet, ESC works properly.
Any ideas why this might happen?
I have noticed that when I click on the Cancel button or the focus is on the single line edit box, the PropertyPage::OnReset() is called which eventually calls the OnCancel() function. However, this is not the same sequence that the multiple line edit box follows.
Would appreciate your help!
thanks
|
|
|
|
|
How can i make an app with ms agents compatibility in visual c++
|
|
|
|
|
The Microsoft Agent section of the Platform SDK contains a step by step guide for how to use MS Agent with C++.
Michael
|
|
|
|
|
I have an SDI app which is split into 4 views with 2 CSplitterWnds.
When I resize the internal windows I get a trace message saying 'Warning: Could not find splitter cursor - using system provided alternative.'
This is ok, because it still works and resizes and stuff, but some of the windows are not being redrawn when they should be.
Can anyone tell me how to intercept any messages or anything so I know when the windows are being resized and can call the redraw functions for my views?
I have searched MSDN and a fair few books and found nothing useful.
Thanks a lot people.
: Wherever you go, there you are, and you wish you were somewhere else :
|
|
|
|
|
*BUMP*
: Wherever you go, there you are, and you wish you were somewhere else :
|
|
|
|
|
Have you tried a combination of CWnd::OnSizing() (called when user is resizing the window) and CWnd::OnSize() (called after the user has resized the window)? I don't know that this would work, but it might
|
|
|
|
|
Thanks man I'll try that. It sounds to be exactly along the lines of what I want.
<sigh> if only MSDN told me that
: Wherever you go, there you are, and you wish you were somewhere else :
|
|
|
|
|
Hi,
I am using Bitmap::FromFile(szFileName, ColorFlag)
How can you tell whether the load from file was sucessful?
Thanks
Rich
|
|
|
|
|
I'd presume the pointer returned is NULL.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
That's what i assumed but it ain't! Reckon the GDI+ documnetation is well poor, for such a crucial new technology, put my comments to the Microsoft on the "Tell us what you think link". It'll be interesting to see if i get out back.
|
|
|
|
|
Use GetLastStatus, it will tell you if the last action returns Ok or Fail.
I agree - the docs have a long way to go.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I Detach() an async socket in CAsyncSocket::OnClose(). When the connection is broken by the remote host, it works rather well. But when I close the connection manually by CAsyncSocket::Close(), the callback function OnClose() will not be called, and Detach() will not be called either. I tried to call Detach() soon after my call to Close(), an ASSERTation was the result. Detach() befroe Close() doesn't work either. What should I do to release the handle of this CAsyncSocket and reuse it with lose of resources again? Thanks for your help.
Tiny Flying Elephant
I love flying...
|
|
|
|
|
I was asked by a friend of mine what would happen if someone put this code into the onpaint() function of a program.
((word)-1);
I tried it and got nothing. Is nothing supposed to happen?
|
|
|
|
|
You create a variable, and don't use it or store it, so it immediately goes out of scope. No, nothing should happen.
I dunno what word is though, do you mean WORD ? WORD is an unsigned short, but the cast would make the -1 equal the highest possible value for a WORD, which is 65535. That's because signed values use the high bit to switch between +ve and -ve.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thanks Christian, I appreciate it.
|
|
|
|