|
The problem is that a host could have lots of network interfaces, and an interface could be bound to more than one IP address. And to top that, not all IP addresses will be reachable from off the machine. Some could be virtual devices, and others could be private network IP addresses.
How do i know my local ip address which is currently reachable from outside network?
|
|
|
|
|
Is this something to do with C++?
Veni, vidi, abiit domum
|
|
|
|
|
Yes, i am looking for a C Program for this...
|
|
|
|
|
|
|
Thanks Ahmad.
But I have one doubt in the above solution.
Suppose there are two ips configured in the system(one is through LAN and other one through USB) and we can connect external ip through one of the local ips(say through USB).
Then does this solution always returns the local ip which can connect outside(USB in this case) or it will return any one ip.
|
|
|
|
|
char cNamearr[255];
gethostname(cNamearr, 255);
hostent* hp = gethostbyname(cNamearr);
_sockaddr.sin_addr.s_addr = _nAdapterIp;
_sockaddr.sin_addr.S_un.S_un_b.s_b1 = hp->h_addr_list[0][0];
_sockaddr.sin_addr.S_un.S_un_b.s_b2 = hp->h_addr_list[0][1];
_sockaddr.sin_addr.S_un.S_un_b.s_b3 = hp->h_addr_list[0][2];
_sockaddr.sin_addr.S_un.S_un_b.s_b4 = hp->h_addr_list[0][3];
|
|
|
|
|
Recently my old Visual C++ (2005 or earlier) decided to upgrade itself to Visual C++ 2008, or whatever happened, and that has different features. I am having to re-make all my projects for Visual C++ 2008. I am currently doing this with my project ppp_vc, which is a simple image reader and outputter and editer, and it is very useful to me. (The -'_vc' means "Visual C", to distinguish it from stuff made with my old faithful Borland C++ 4.52, which I had to stop using when modern Windowses became incompatible with it.) So far, the Release version of ppp.exe runs OK, but the Debug version of ppp.exe fails with a MessageBox saying "The application has failed to start because its side-to-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more details."
What is sxstrace.exe, and how to call it? What is a side-to-side configuration? This needs to be sorted out, before I have to repeat this ordeal with my application makeobj, which is a very useful CGI 3D mesh-editor which I wrote. And ditto with several other applications which I wrote.
I was brought up on MS-DOS, where things were much simpler.
This difficulty became much worse today when my PC's Windows decided to upgrade itself from the web.
One thing that I did in my Borland C++ days was to make the .JPG graphics software into a DLL, which was useful, until a way arose of calling JPG directly from the Windows software.
modified 30-Nov-13 15:00pm.
|
|
|
|
|
|
Which of the updates listed on that page linked to, should I install? My PC has Windows 8, 64-bit.
Which #insert file declares the name WS_SYSMENU ?
|
|
|
|
|
I would suggest installing the 64-bit 2008 version.
You can find the definition of a symbol by right-clicking it, and selecting "Go to definition."
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard Andrew x64 wrote: I would suggest installing the 64-bit 2008 version.
Please where can I download it? http://msdn.microsoft.com/en-us/vstudio//[^] does not list it.
Would Visual Studio 2013 work on my PC?
I tried running an old compiled .exe file that ran OK before my computer was reformatted and reinstalled (with a newer version of Windows 8), and it gave the fault as described above. What IS happening? How do people make .exe files that are not so dependent on exact details of which system it is run on?
modified 30-Nov-13 18:07pm.
|
|
|
|
|
Does this application use MFC? If so, then that may be the problem.
The VC Express editions don't come with MFC, so you might be missing the debug libraries. The only solution for that is to install VS 2008 Professional Standard or higher.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Anthony Appleyard wrote: Which of the updates listed on that page linked to, should I install?
It depends upon which one is missing and/or corrupted.
Try installing both the 32-bit and the 64-bit versions and see if that fixes it.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
The version that I have running now is
Microsoft Visual Studio 2008
Version 9.0.21022.8 RTM
Microsoft .NET Framework
Version 3.5 SP1
Installed Edition: VC Express
Microsoft Visual C++ 2008 91909-152-0000052-60767
Microsoft Visual C++ 2008
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am running Windows 8, but how can I find exactly which update of Windows 8 I have?
|
|
|
|
|
Thank you for your help with my continuing query.
The link http://www.visualstudio.com/en-us/downloads/[^] lists many applications. Please, which do you recommend me to use, and what update/cure-for-bug packages to install on top of it, do you recommend?, given that:-
I have a PC a few months old with Windows 8, apparently 64-bit.
Considerations of expense, if I must buy the software.
The link http://support.microsoft.com/kb/2890846/en-us[^] lists several current bugs in Visual Studio 2013.
I am seriously affected by the "The application has failed to start because its side-to-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more details." bug, and many of the .exe files that by current Visual C++ creates cannot run due to that bug. One of you gave me this link[^] for possible cures for it; I installed one of those recommended updates, but the bug has continued. The bug seems to also affect old compilations which compiled on Visual C++ and ran OK before my PC was recently reformatted and reloaded in a big computer repair shop, thus likely giving me a later version of Windows 8 than I was running before; they used the reload disks that came with my PC, but they set it to auto-update itself from the internet.
* How should I call sxstrace.exe ?
* Is there any chance that this bug could be caused by malware?
I only need to compile C++.
The version that I have running now, and has the bug described here, is
Microsoft Visual Studio 2008
Version 9.0.21022.8 RTM
Microsoft .NET Framework
Version 3.5 SP1
Installed Edition: VC Express
Microsoft Visual C++ 2008 91909-152-0000052-60767
* It is Visual C++ alone, not the whole Studio.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am running Windows 8, but how can I find exactly which update of Windows 8 I have?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Which #insert file declares the #define name WS_SYSMENU ? I have been having nuisance with the compiler saying that I have not declared it.
modified 1-Dec-13 2:18am.
|
|
|
|
|
WS_SYSMENU is defined in the WinUser.h and Winuser.rh files. You should include windows.h in your source code, and winresrc.h in your resource files. Make sure that you also have the correct SDK installed; this comes automatically with VC++ Express 2010 and above as far as I recall, but I'm not sure about 2008. I am also a bit confused as to how your 2005 version automatically updated itself to 2008, since these products need to be downloaded manually.
Veni, vidi, abiit domum
|
|
|
|
|
I have been through my uninstall list and uninstalled everything from Microsoft whose names included "Visual C++", to try to get the decks clear before a re-install.
Should I have also uninstalled everything whose name includes "Microsoft SQL"? And what else also?
I am now trying to install Visual C++ 2010 (download and then run the file vc_web.exe ), but the install has now hung for an hour at the start of downloading the first of its 8 components (= Microsoft Application Error Reporting).
Should Visual C++ 2010 run without the "side-to-side configuration is incorrect" bug? What is side-to-side configuration? if that bug persists, what should I do then?
I have just found these from Microsoft in my installations list:-
Microsoft Silverlight -- (What is this?)
Microsoft Office 2007
Microsoft Office
Microsoft SQL Server Native Client
Microsoft SQL Server Setup Files (English)
Microsoft SQL Server VSS Writer
Microsoft SQL Server 2005
Windows Essentials 2012
|
|
|
|
|
|
Stop, stop! It is no good randomly uninstalling things just because you don't know what they are. Many of these Microsoft products will be installed as part of Windows, they are support libraries which are requirted by various other products. I have a suspicion that what you thought was a silent upgrade of VC++ Express 2005 to 2008, was merely an upgrade of the runtime libraries. The "side-to-side configuration is incorrect" bug could well be caused because some required library is missing, but it is difficult to guess what without more information.
Veni, vidi, abiit domum
|
|
|
|
|
"Stop, stop! It is no good randomly uninstalling things just because you don't know what they are." :: that is why I asked.
I have re-installed my Visual C++ 200(8?).
I installed the packages at http://www.microsoft.com/en-us/download/confirmation.aspx?id=29[^]
and
http://www.microsoft.com/en-us/download/details.aspx?id=3387[^]
And my Visual C++ programs work again!!, as far as I can see in a quick check.
Thanks for letting me take up your time.
A query :: the programs that I have been developing with my Visual C :: would they run on everybody else's modern PC computers?, or would they have the side-to-side configuration problem?
(I remember, way back when my Borland C++ 4.52 still worked, with any program compiled using it I had to include a particular DLL, to make the program work on computers that did not have Borland C++ 4.52 on.}
Side-to-side configuration seems to be a common problem :: just now a Google search for "side-to-side configuration" (in quotes) found about 733,000 results (although some may refer to shotguns etc).
modified 1-Dec-13 12:12pm.
|
|
|
|
|
Just noting that I find it unlikely that VS 2005 upgraded itself to 2008. And even less likely that it did it by itself.
|
|
|
|
|
About the error "The application has failed to start because its side-to-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more details." :: why such an obscure error message? If a .DLL or something like that is missing, why not say so directly clearly?
In ancient times I used my Borland C++ 4.52 compiler to make Windows applications to make calculations about polymers, for where I worked. And the generated .EXE, when run on another computer, faulted, similarly to this recent fault :: but it said clearly that a .DLL was missing. So I at once knew what was wrong, and I put the required .DLL in with the .EXE file, and it ran OK.
|
|
|
|
|
Yeah the error message is unbelievably stupid and that you almost need to be an IT expert to find what DLL is actually missing just makes it worse.
|
|
|
|
|
"side-to-side configuration": sounds more like 2-barreled shotguns, or layout of pipes or of blood vessels.
|
|
|
|