Click here to Skip to main content
16,005,734 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: RegisterClass() in 98.. Pin
Michael P Butler23-Jan-02 0:53
Michael P Butler23-Jan-02 0:53 
QuestionHow to configure STLPort ? Pin
Ravish23-Jan-02 0:48
Ravish23-Jan-02 0:48 
AnswerRe: How to configure STLPort ? Pin
23-Jan-02 2:47
suss23-Jan-02 2:47 
GeneralApplication Closing Pin
Micheal John23-Jan-02 0:33
Micheal John23-Jan-02 0:33 
GeneralRe: Application Closing Pin
Vladimir Georgiev23-Jan-02 1:15
Vladimir Georgiev23-Jan-02 1:15 
GeneralRe: Application Closing Pin
NormDroid23-Jan-02 4:38
professionalNormDroid23-Jan-02 4:38 
GeneralDynamic resource Declaration Pin
User 2674023-Jan-02 0:00
professionalUser 2674023-Jan-02 0:00 
GeneralProgrammatically adding route (CreateIPForwardEntry) Pin
Martijn22-Jan-02 21:54
Martijn22-Jan-02 21:54 
I've got a problem with the API "createipForwardEntry"). I'm trying to add a routing rule in the piece of code hereunder. It works just fine. However, if i use the IP address assigned to my ethernetcard as the "next hop" (thereby making it the default gateway for the particular network segment) it fails me. Can anyone help me out?

<br />
PMIB_IPFORWARDROW pRow = NULL;<br />
ULONG dwSize = 0;<br />
DWORD dwStatus = 0;<br />
<br />
// Allocate some memory to store the row in<br />
pRow = (PMIB_IPFORWARDROW)malloc(sizeof(MIB_IPFORWARDROW));<br />
<br />
if (!pRow) {<br />
MessageBox("Malloc failed, Out of Memory!\r\n");<br />
exit(1);<br />
}<br />
<br />
// changing dwForwardNextHop into anything else works...<br />
// 172.31.64.9 is the ip address assigned (through DHCP) to my ethernetcard.<br />
// route add 172.0.0.0 mask 255.0.0.0 172.31.64.9 metric 30 if 2<br />
// works just fine.<br />
pRow->dwForwardDest = inet_addr("172.0.0.0");<br />
pRow->dwForwardNextHop = inet_addr("172.31.64.9"); // --> this doesn't work, any other value does<br />
pRow->dwForwardMask = inet_addr("255.0.0.0");<br />
pRow->dwForwardIfIndex = 2;<br />
pRow->dwForwardType = 4;<br />
pRow->dwForwardProto = MIB_IPPROTO_NETMGMT;<br />
pRow->dwForwardAge = 0;<br />
pRow->dwForwardMetric1 = 30; <br />
<br />
// Create a new route entry for the default gateway.<br />
dwStatus = createipForwardEntry(pRow);<br />
<br />
if (dwStatus == NO_ERROR)<br />
MessageBox("Route Added Successfully\n");<br />
else if (dwStatus == ERROR_INVALID_PARAMETER)<br />
MessageBox("Invalid Parameter\n");<br />
else <br />
DisplayErrorMessage(dwStatus);<br />
<br />
// Free resources<br />
if (pRow)<br />
free(pRow); <br />


pretty please?
GeneralRe: Programmatically adding route (CreateIPForwardEntry) Pin
Jon Hulatt22-Jan-02 22:51
Jon Hulatt22-Jan-02 22:51 
GeneralRe: Programmatically adding route (CreateIPForwardEntry) Pin
Martijn22-Jan-02 23:09
Martijn22-Jan-02 23:09 
GeneralRe: Programmatically adding route (CreateIPForwardEntry) Pin
Jon Hulatt22-Jan-02 23:32
Jon Hulatt22-Jan-02 23:32 
GeneralRe: Programmatically adding route (CreateIPForwardEntry) Pin
Martijn23-Jan-02 0:58
Martijn23-Jan-02 0:58 
GeneralRe: Programmatically adding route (CreateIPForwardEntry) Pin
Jon Hulatt23-Jan-02 1:04
Jon Hulatt23-Jan-02 1:04 
GeneralRe: Programmatically adding route (CreateIPForwardEntry) Pin
Martijn23-Jan-02 1:12
Martijn23-Jan-02 1:12 
QuestionIs there anybody who knows how to program using the BHO(Browser helper object)? Pin
gropex22-Jan-02 18:39
gropex22-Jan-02 18:39 
AnswerRe: Is there anybody who knows how to program using the BHO(Browser helper object)? Pin
Michael P Butler23-Jan-02 0:50
Michael P Butler23-Jan-02 0:50 
GeneralCAsyncSocket trouble Pin
Craig S22-Jan-02 18:31
Craig S22-Jan-02 18:31 
GeneralService - CreateService Pin
22-Jan-02 12:44
suss22-Jan-02 12:44 
GeneralRe: Service - CreateService Pin
Michael Dunn22-Jan-02 13:04
sitebuilderMichael Dunn22-Jan-02 13:04 
GeneralMulitline Edit Box on a Wizard Pin
RK_200022-Jan-02 10:51
RK_200022-Jan-02 10:51 
GeneralMS Agents in C++ Pin
MaTrIX2k222-Jan-02 10:45
MaTrIX2k222-Jan-02 10:45 
GeneralRe: MS Agents in C++ Pin
Michael P Butler23-Jan-02 0:56
Michael P Butler23-Jan-02 0:56 
GeneralCSplitterWnd Question Pin
borland22-Jan-02 10:34
borland22-Jan-02 10:34 
GeneralRe: CSplitterWnd Question Pin
borland22-Jan-02 17:05
borland22-Jan-02 17:05 
GeneralRe: CSplitterWnd Question Pin
Jonnie White23-Jan-02 0:45
Jonnie White23-Jan-02 0:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.