visual-c++

how to do virtualization ?

Hi, I am newbie in vc++. I have configured my system with WDK,DDK and Visual Studio 2008. I want to implement dual functionality to my wireless hardware and i am using Vista so please help me out from here. so just tell me which function should i use Thanks in advance... :) ...

Program compiled with MSVC 9 won't start on a vanilla SP3 XP

I installed XP on a virtual machine, updated it to SP3 and then tested a small program compiled with Visual C++ 2008 on my real computer - however it didn't start but outputted only an error saying that a problem had been detected and that a reinstall of the application (mine is 10KB in size and doesn't even have an installation) could f...

Access Violation When Accessing an STL Object Through A Pointer or Reference In A Different DLL or EXE

I experience the following problem while using legacy VC6. I just cann't switch to modern compiler, as I am working on a legacy code base. http://support.microsoft.com/kb/172396 Since there are no way to export map, my planned workaround is using static linking instead of dynamic linking. I was wondering whether you all had encountere...

LPCSTR, TCHAR, String

I am use next type of strings: LPCSTR, TCHAR, String i want to convert: from TCHAR to LPCSTR from String to char I convert from TCHAR to LPCSTR by that code: RunPath = TEXT("C:\\1"); LPCSTR Path = (LPCSTR)RunPath; From String to char i convert by that code: SaveFileDialog^ saveFileDialog1 = gcnew SaveFileDialog; saveFileDialog1->...

How to make Visual C++ 9 not emit code that is actually never called?

My native C++ COM component uses ATL. In DllRegisterServer() I call CComModule::RegisterServer(): STDAPI DllRegisterServer() { return _Module.RegisterServer(FALSE); // <<< notice FALSE here } FALSE is passed to indicate to not register the type library. ATL is available as sources, so I in fact compile the implementation of CComM...

Why aren't static const floats allowed?

I have a class which is essentially just holds a bunch of constant definitions used through my application. For some reason though, longs compile but floats do not: class MY_CONSTS { public : static const long LONG_CONST = 1; // Compiles static const float FLOAT_CONST = 0.001f; // C2864 }; Gives the following error: 1...

Why my custom CStatic derived control does not receive WM_SIZE message?

Hello everyone! I'm currently developing a custom control that derives from CStatic MFC class (Smart Device C++ project). I have created the control class using VC++ MFC class wizard, selecting CStatic class as its base class. I have used Class View to add OnSize event handler for my control class (I have selected WM_SIZE message from m...

How to send file from server to multiple clients at a time in mfc using sockets ?

I am making simple one on server side & one on client side application for transfering file from one location to another location or from one computer to another computer if computers are in network. I used the code from http://www.codeproject.com/KB/IP/SocketFileTransfer.aspx. It is working & file transfered successfully. But i need t...

MPI program with a VC++ GUI?

I need to write an application using MPICH2 (64 bit, in case you're wondering). A GUI is entirely optional but would of course be a huge plus. Will mpiexec have any difficulties running managed VC++ code? Are there any other problems I might run into with compiling/linking (calling conventions, etc)? Just to give you an idea, the genera...

Vertical Alignment In a List Box

Hi, I use a listbox in (visualC++ 2008) as a log window, and I use SetItemHeight() to obtain some space between entries. How can I align my entries vertically so that they are vertically centered? Thank You!!! ...

Microsoft VC++ 2005 SP1 and 2008 SP1 Redistributable Package

Dear developers, I have an application that requires Microsoft VC++ 2005 (SP1) Redistributable Package. I know that I can just download it and install it. The problem is, in our server, there is Microsoft VC++ 2008 (SP1) Redistributable Package already installed. Now, do I still need to install the 2005 (SP1) version? Or the 2008 (...

Replacement for vsscanf on msvc

Hi, I've run into an issue porting a codebase from linux (gcc) to windows (msvc). It seems like the C99 function vsscanf isn't available and has no obvious replacement. I've read about a solution using the internal function _input_l and linking statically to the crt runtime, but unfortunately I cannot link statically since it would mess...

How can I register a DLL which I created in C++

I created a DLL in C++ using Visual Studio 2005. My problem is that I cannot register this DLL. Show me the error: "LoadLibrary(MyDll.dll) failed. The specified module could not be found." Someone help me? Thanks ...

is document view architecture same as MVC

Is MFC's document view architecture the same as MVC pattern or not ...

extern "C" has no effect in msvc++ 9.0

I manage project for JNI for both compilers: MSVC++ 8.0 and 9.0, my cpp file contains following implementation: extern "C" { JNIEXPORT jlong JNICALL Java_context_ServiceProviderContext_StartServiceProvider (JNIEnv * env, jclass, jstring jspath){ ..... } With help of depends.exe utility I can see that MSVC 8.0 successfu...

C++ thread safety - exchange data between worker and controller

I still feel a bit unsafe about the topic and hope you folks can help me - For passing data (configuration or results) between a worker thread polling something and a controlling thread interested in the most recent data, I've ended up using more or less the following pattern repeatedly: Mutex m; tData * stage; // temporary, ac...

msbuild slower than devenv

Hi, I'm experiencing performance inconsistencies with regards to build duration when building a VS2008 solution file with either devenv or msbuild from command line. My solution contains both C# and C++ projects, and I have these results: devenv.exe (either command line or within the ide): 7 minutes msbuild.exe: 14 minutes I tried tun...

c++ check installed programms

Hi i want to know what programs installed on my system, i use MsiEnumProducts and MsiGetProductInfo functions, but not all application what i can see in "Add/Remove Program" i get by this functions. ...

How to reliably replace a library-defined error handler with my own?

On certain error cases ATL invokes AtlThrow() which is implemented as ATL::AtlThrowImpl() which in turn throws CAtlException. The latter is not very good - CAtlException is not even derived from std::exception and also we use our own exceptions hierarchy and now we will have to catch CAtlException separately here and there which is lots ...

OnSize() Problem in VC++

Hi, In my VC++ MFC applcaiton,i have different views.And in each view,when i maximize it,i changed the size and position to new thing(Normally it fully get maximixed to screen size).But i dont want tht.So in OnSize() i coded like this. void CChildFrame::OnSize(UINT nType, int cx, int cy) { CMDIChildWnd::OnSize(nType, cx, cy); int XBo...