visual-c++

(Windows) How to lock all applications (explorer, task manager etc.) and make only the browser active?

I'm trying to run only the browser in the system - locking access to everything else. Only the supervisor can resume the normal functioning of the system after giving a password. This kind of activity is usually done by virus. Disabling the registry for Task manager etc. Does anyone know of any source available that does this? I might b...

Warning about data loss c++/c

I am getting a benign warning about possible data loss warning C4244: 'argument' : conversion from 'const int' to 'float', possible loss of data Question I remember as if float has a larger precision than int. So how can data be lost if I convert from a smaller data type (int) to a larger data type (float)? ...

How to create a Mutex with security attribute to share resource from different application?

How to create a Mutex with security attribute rigth to share resource from different application? In according with Microsoft SDK documentation the CreateMutex API accept as first parameter a SECURITY_ATTRIBUTES pointer. HANDLE WINAPI CreateMutex( __in LPSECURITY_ATTRIBUTES lpMutexAttributes, __in BOOL bInitialOwn...

Why does VC++ 2010 Express say "Evaluation"?

I was under the impression that the express version of Visual C++ 2010 was free for commercial use. However, when I start it up, the slash screen says that the app is for evaluation use only. What gives? ...

How do I edit a "ell in an MFC Listbox?

I have CListBox control that has 2 columns and any number of rows. I want the user to be able to click(or maybe double-click) a "cell" and be able edit the text therein. See this screenshot (Can't post images yet, need +10). What I mean is that I want to be able to click and edit any of the places where it says "TEST" by clicking on ...

How to free member (i.e BSTR, SAFEARRAY, VARIANT) of an IDL User Defined Structure which is encapsulated in a VARIANT?

Hi, I have a structure defined in IDL. This structure has following members: { BSTR m_sFirst; BSTR m_sSecond; VARIANT m_vChildStruct; //This member encapsulate a sub structure SAFEARRAY __RPC_FAR * m_saArray; }CustomINFO; I am allocating the memory for the structs using CoTaskMemAlloc and encapsulating it in Varian...

Visual C++ preprocessor definitions

Is there a way to transfer C++ preprocessor definitions into a custom pre-link step procedure call as a command-line parameter or export them into a file any other way? Example: Let's say, I have a c++ project, and in it's Debug configuration I put a preprocessor definition like MAKUMBA_OBA=0x13 Then I add custom pre-link step which exec...

What are useful functions for drawing text (MFC)?

I'm creating a line chart control, and I need to write (or better say draw) the axis names and axis values. I found DrawText and TextOut functions, but the text they show is flickering and don't know how to set the font and text orientation (I will need vertical text orientation as well as horizontal). Are there any other functions you...

In what ways is MSVC not standards-compilant?

I read that MSVC is not fully compilant to the ISO C++ standard (German Wikipedia and several Tech sites). In which ways isn't C++ standards compilant? ...

issues linking .lib files

I am trying to add a .lib file to my project. I have the following in my main.h #ifndef _UGP_MAIN_H_ #define _UGP_MAIN_H_ #include"StrandedEngine/engine.h" #pragma comment(lib, "lib/StrandedEngine.lib") #define WINDOW_CLASS "StrandedGame" #define WINDOW_NAME "Stranded" #define WIN_WIDTH 800 #define WIN_HEIGHT 600 ....

How to add a wrapper to the MFC WinMain?

I want to add a wrapper to the MFC WinMain in order to be able to make a MFC application be able run as GUI application or as a service. Can I add a wrapper to WinMail from MFC without modifying MFC source code? ...

MFC : How to check if a character input is unicode?

Hi All, I have an input text field which accepts a certain maximum number of characters. This number of characters should change though if the character inputs are unicode. Question: Is there a way I could check if the character input is unicode or not? ...

Visual C++ Testing problem

Hi there I have installed VisualAssert and cFix. I have been using Visual Studio C++ and programming in CLI/C++. I have a working Chess Game Program that works perfectly by itself.....and I have been studying testing and have many examples(with tutorials) I have found on the net, that compile and run in Visual Studio..... But as soon a...

Why do I have to specify pure virtual functions in the declaration of a derived class in Visual C++?

Given the base class A and the derived class B: class A { public: virtual void f() = 0; }; class B : public A { public: void g(); }; void B::g() { cout << "Yay!"; } void B::f() { cout << "Argh!"; } I get errors saying that f() is not declared in B while trying do define void B::f(). Do I have to declare f() explicitly i...

Array of datas returning issue, Overwriting

Hi, Please help me on this Here i want to save the converted data into new pointers. But everytime the data is overwriting with most recent data. Please check my code TCHAR nameBuffer[256]; //Globally Declared void Caller() { TCHAR* ptszSecondInFile= QStringToTCharBuffer(userName); TCHAR* ptszOutFile=QStringToTCharBuffer(Destinati...

Understanding VC++ ASM generation

I've got as far as telling VC++ to generate ASM files during compilation, which I never really used before. But it seems quite limited, like they are just extra files thrown out during the compilation. I'd thought maybe the ASM/C++ code might be linked, so I can jump from C++ directly to the generated ASM code? Or could set breakpoints i...

Visual C++ 2008 Intellisense is not displaying DocXml comments

In Visual C++ 2008, I have documented a method with DocXML: /// <summary>Function to generate and map channel.</summary> /// <param name="a_cfi">Raw CFI (1, 2 or 3)</param> /// <param name="a_ns">Slot number in frame</param> static void myFunc(unsigned a_cfi, unsigned a_ns); Intellisense displays this, but it displays the actual tags ...

Using MPI under VC++ MFC project?

Does any body know how can I use MS_MPI in my VC++ MFC project? I already have a big MFC project and I only want to use parallel processing in a part of it with MPI. (I know how to use MPI in a separate code, but I don't know how to integrate it with my VC++ MFC project) ...

Most useful MSVC++ non-standard macros

The standard includes macros line __LINE__ & __FILE__, and C99 adds __FUNCTION__ which is technically not part of C++ yet. What additional ones does MSVC++ add which are useful/cool? I found __FUNCTION__ is supported but are there any other totally MS-specific ones worth knowing about? ...

Does Microsoft make available the .obj files for its CRT versions to enable whole program optimization on CRT codepaths?

Given the potential performance improvements from LTCG (link time code generation, or whole program optimization), which requires the availability of .obj files, does Microsoft make available the .obj files for the various flavors of its MSVCRT releases? One would think this would be a good place for some potential gain. Not sure what th...