Tag Archives: 2010

IntelliSense in VC + + 2010: unable to open source file “StdAfx. H”

Refer to http://social.msdn.microsoft.com/Forums/en-US/vcprerelease/thread/efdf4ae8-437d-4a7f-8cf5-b895257da2bd
 
Problems such as unable to find files can be solved with this method, is the path problem. Similar problems may occur when a VC ++2008 project is transferred to VC ++2010.
 
Solution:
Add $(projectDir) to the Project Properties = Configuration Properties = C/C++ = General = Additional Includes directory
See below

In VS2010, the compiler cannot open the file “GL / glaux. H”: no such file or directory

 
We recently tested an example OpenGL program:
#include < GL/gl.h>
#include < GL/glaux.h>
#include “glos.h”
 
void main(void)
{
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
,0,500,500 auxInitPosition (0);
auxInitWindow(“simple”);
 
GlClearColor (0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
GlColor3f (1.0, 0.0, 0.0);
GlRectf (0.5, 0.5, 0.5, 0.5);
 
glFlush();
_sleep(1000);
}
 
It runs normally under VC6.0, but under VS2010 there is a compilation error as follows:
1> D :\elec\mymfctest\vs2010p\openglapps\opengltest\opengltest.cpp(4): fatal error C1083: Could not open included file: “GL/glaux.h” : No such file or directory
It seems that this error can be found in versions VS2008 and above.
Only two Files can be seen in the path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\Include\gl after VS2010 installation
Gl. h and glu. H instead of glaux. H,
C:\Program Files\Microsoft Visual Studio\VC98\Include\GL
The next one has three files
H, glu. H, and glaux. H, so the relevant header files are not found in VS2010.
The glaux.lib library file is not found in the VC6.0 installation path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\ lib, but in the VS2010 installation path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\ lib.
The solution is to copy the glaux. H and glaux. Lib files from their respective folders to the path referenced by default in VS2010 if you have VC6.0 installed. It is possible that the application will also need glaux. DLL support at runtime, which can also be downloaded.

The perfect solution of VS2010 console program running in a flash

When the console application in VS2010 is running, the result screen will flash, whether you use F5 or Ctrl + F5, so you can’t see the result. There are a lot of ways on the Internet, which is to add a pause statement to the program at the end or to get user input from the console statement. There’s a better solution:
 
Right click on your project entry, select the last item “Property/Properties” on the pop-up menu, and in the left column, find “Configuration Properties”
-> Connector – & gt; System, after clicking on the System item, subSystem in the right column configuring the value of the subSystem to “Console “.
 
After doing this, press Ctrl+F5 again and the program will stop at the console screen and prompt you to “Press any key to continue.” That’s the perfect solution.  

VS2010 debugging window flash solution

These days the development integration environment has been changed to VS2010, just started to use, some places are not very understand, by consulting the relevant documents, is now solved.
Take the VS2010 debugging window flash through the solution is as follows:
#include < iostream>
using namespace std;
void main()
int add(int,int,int);
float business (int);
int x, y, z, sum;
cout< < “Input x, y, z:”;
cin> > x> > y> > z;
the sum = add (x, y, z);
cout< <” sum=”< < sum< < endl;
cout< <” average=”< < average(sum)< < endl;
// system (” pause “);
}
}
Int add (int a, int b, int c)
{return (a+b+c); }
float business (int s)
{return (s/3.0); }
This is the test code.
The solution is as follows:
If you are compiling (F5), you can run the program (Ctrl+F5). If it is still flashing, use the following method to solve it.
method one:
1. If the c + + files, in the final to write a program before (return) add: system (” pause “);
= #include”stdlib.h”;
= #include”stdlib.h”; Then add: system(“pause”) at the end of the program (before the return).
Method 2:
. Right click on the current project – Properties
2> 3. Change the SUBSYSTEM configuration in System Options, select the first ‘/ CONSOLE’ in the drop-down menu and then select ‘Start Executing (Don’t Debug)’, that is Ctrl +F5;
This solves the flash window problem once and for all.
 

Vc2010 configuring OpenGL environment

Glut32.Lib Glut32.dll and Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h
2, the glut. H in the C:/Program Files/Microsoft SDKs/Windows/AA/Include/gl v7.0 directory; GLUT32. lib: C:/Program Files /Microsoft SDKS /Windows/ V7.0a/lib Glut32.dll is placed in the C:/WINDOWS/system32 directory
3. Create a new empty project in VS2010 and select Win32 Console Project
 
4. Add a.cpp file to the project with the following contents:
# include “stdafx. H”
#include< gl/glut.h>
 
Void myDisplay (void)
{
GlClear (GL_COLOR_BUFFER_BIT);
GlRectf (0.5-0.5 f to 0.5 f, f, 0.5 f);
GlFlush ();
}
Int _tmain(int argc, _TCHAR* argv[])
{
GlutInitDisplayMode (GLUT_RGB | GLUT_SINGLE);
GlutInitWindowPosition (100, 100);
GlutInitWindowSize (400, 400);
GlutCreateWindow (” the first OpenGL program “);
GlutDisplayFunc (& amp; myDisplay);
GlutMainLoop ();
Return 0;
}
5. Set the IDE environment: project->; new Property-> Configuration propertites-> linker-> Input-> Additional dependencies
OpenGL32. lib GLUT32. lib, apply, confirm.
 
 
6. F5, Start Debugging, you should see a window with a white square in the middle.

There was a problem sending the command to the program in Excel 2010

Environment: MicroSoft Excel 2010
Sending the Command to the program was a problem.

As shown in figure:


Solution: open Excel– & GT; File — — — — — — — — & gt; Options — — — — — — — — & gt; Senior — — — — — — — — & gt; Drop this check (ignoring other applications that use dynamic database exchange (DDE)) -& GT; To solve.
 
As shown in figure:


Resources:
http://support.microsoft.com/kb/211494
http://blog.sina.com.cn/s/blog_4988d99a0100u86i.html

Error c2259 cannot instance abstract class due to following members

Error description:
E:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgquerydlg. H. (295) : error C2259: ‘CDsgFormatDataMgrDlg’ : Always instantiate the abstract class due to the following members:
e:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgformatdatamgrdlg. H (14) : see declaration of ‘CDsgFormatDataMgrDlg’
 
Reason for error:
An implementation class inherits an abstract base class, but does not implement all the methods in the abstract base class.
 
Can be similarly implemented:
Virtual Void EnableControl(PSKOPEROBJECT Lpoo, BOOL bEnable) {}//
 
Code example:
 
class CDsgFormatDataMgrDlg : public CDialogImpl< CDsgFormatDataMgrDlg> ,
public ISkBusinessEngineSink// abstract base class
{
public:
enum {IDD = IDD_FORMATDATAMGR_DLG};

CDsgFormatDataMgrDlg ();
virtual ~ CDsgFormatDataMgrDlg ();
virtual BOOL PreTranslateMessage(MSG* pMsg);

}
 
The class ISkBusinessEngineSink
{
public:
virtual void HandleOneCSObject (LPCTSTR lpszName) {}
virtual BOOL HandleUpdateCalendarResult (int nType, PCALENDAREVENT lpce,
DWORD dwClientTmpId, BOOL bRet, DWORD dwErrorCode) {return FALSE; }
virtual BOOL HandleUpdateDesktopResult (int nType, PDESKTOPITEM lpdi,
DWORD dwClientTmpId, BOOL bRet, dwords dwErrorCode) = 0.

virtual void HandleHotBUList(PHOTBU LPHB, int nCount) {}
virtual void OnDBFuncReady(BOOL bReady) = 0;
virtual void OnDBViewReady(BOOL bReady) = 0;
virtual void OnSNReady(BOOL bReady) = 0;
virtual void OnTableReady(BOOL bReady) = 0;

}
 
Methods in the abstract base class must fully implement…
Appendix:
The choice of http://www.cnblogs.com/shenfx318/archive/2007/01/25/630760.html (abstract base classes and interfaces) and the difference between
http://www.cnblogs.com/TravelingLight/archive/2010/06/02/1750073.html (abstract base class for some of the problems)
http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Companion/cxx_crib/interfaces.html
(OO concepts and abstract classes and interfaces)
 

VS2010 library function problem: objidl. H (11266): error c2061: syntax error: identifier ‘__ RPC__ out_ xcount_ part’

This error was caused by the lack of lib files or include, but the UI in VS2010 was set up so badly that people didn’t know how to edit the original VC++ directory files. The solution is as follows:
Open the VS2010 project
Notice that in the lower left corner are Solution Explorer, Class View, Property Manager, and many other options.
is revised for Directories like the one we introduced in VS2010.

display Property Manager
contains the Debug|Win32 and Release|Win32 options
. You can set the project properties of Debug and Release
. Open any of them
. Double click microsoft.cpp.win32.
is modified here for the tutorial vc Directories. H (11266) : error C2061: syntax error: identifier ‘___, rpc___, out_xcount_part’
use the above method to delete the DirectX SDK Include from the Include path. Supplements: the

Directories that were modified for VC++ Directories in the project property dialog are project specific. The above modified VC++ Directories are large, affecting all project Directories and configuration Directories (Debug/Release/…) .

ssh port forwarding

Haihan Zhou July 2, 2010

Goddady’s Linux virtual host is used to provide SSH. However, when using SSH-D port XXX @server, I encountered the following error of SSH printing:

channel 3: open failed: administratively prohibited: open failed

When the Firefox browser is configured with SOCKS5 pointing to a local port, browsing any web page appears blank.
What is the reason for this?
SSH, open sSHd_config and have a look.

cat /etc/ssh/sshd_config

There was a row:

AllowTcpForwarding no

The original host set the TCP port forwarding for SSH to be disabled. That wants to use SSH as agent to carry out port forwarding is certainly unsuccessful.
Look at the system configuration again, also prohibit IP forwarding;

cat /etc/sysctl.conf | grep ip_forward
net.ipv4.ip_forward = 0

Therefore, the virtual host prompt port forwarding is prohibited, normal.