Click here to Skip to main content
15,867,870 members
Everything / Programming Languages / Visual C++ 10.0

Visual C++ 10.0

VC10.0

Great Reads

by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
by Lars [Large] Werner
Windows has built inn support for a lot of keyboard languages, this class makes it possible to extract that info in an easy manner and present it to screen.
by Eugene Sadovoi
Integrating third party tools and libraries into Visual Studio (MSBuild) configuration environment.
by Petrov Vladimir
Weiler-Atherton algorithm in 3D codes demo implementation

Latest Articles

by libbyliugang
A splitter control for dialog can auto change the linked window's position
by gintack
C++ header file to plot data in the form of x, y, z arrays and list as potential lines and graphs
by tonywilk
Not 'Just Another Parser', this reads elements from JSON simply and without memory overhead in C
by Petrov Vladimir
Weiler-Atherton algorithm in 3D codes demo implementation

All Articles

Sort by Score

Visual C++ 10.0 

25 Feb 2018 by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
18 Dec 2012 by Lars [Large] Werner
Windows has built inn support for a lot of keyboard languages, this class makes it possible to extract that info in an easy manner and present it to screen.
30 Mar 2015 by Eugene Sadovoi
Integrating third party tools and libraries into Visual Studio (MSBuild) configuration environment.
11 Mar 2018 by Petrov Vladimir
Weiler-Atherton algorithm in 3D codes demo implementation
10 Jan 2011 by #realJSOP
An abstract class cannot be instantiated. You MUST derive a new class from it, and implement all of the pure virtual functions in it, and then use the new class instead.This is basic C++ stuff...
4 Apr 2011 by Olivier Levrey
You just need to change the window styles. You can set the styles with the CreateWindow or change them with the SetWindowLong function or SetWindowLongPtr.For example, try this://get the styleLONG_PTR style = GetWindowLongPtr(hWndEditbox, GWL_STYLE);//use |= to add a stylestyle...
28 Dec 2013 by nv3
You are not assigning a value to the location where lpvBuffer points, but to the pointer itself.And why did you use a pointer to void if you want to pass a DWORD as in/out parameter? Use a pointer to DWORD instead. So you code should look like this:void Test (DWORD* pArg){ DWORD code...
7 Mar 2001 by grebulon
This Add-in converts the text format (DOS or UNIX) of a file when it is saved in Visual Studio.
7 Dec 2010 by Alain Rist
Hi Rajesh,Use the Visual Studio Configuration Manager (in Build menu) to create different project configurations, see How to: Create and Edit Configurations[^].Use compile time definitions to adjust specific configuration features.cheers,AR
9 Apr 2011 by Richard MacCutchan
The first form is C++ not C, so if you add it to VC2010 as a C program (with file extension .c) it will give errors. If you save the same code as C++ (give the file a .cpp extension) it should compile OK. These are just the rules of the languages, and I can only presume that Code::Blocks...
10 Apr 2011 by krmed
The problem lies in this area:while((nd=getchar())!=EOF){ if(nd!='\n') { temp[digit]=nd; ++digit; } else if (digit>=80) { printarray(temp[MAXLINE], digit); initialize(temp[MAXLINE], digit, nd); } else...
29 Jul 2011 by Sayyed Mostafa Hashemi
Code for checking the avilabiltiy of Internet connection.
27 Jul 2012 by Jochen Arndt
From the updated question and the comments, this seems to solve the problem:Using the Windows timers is often not the best choice. For periodic actions that are hardware related and/or sensitive to system load, a worker thread may be a better solution:Create a worker thread and a...
19 Apr 2013 by Chandra Shekhar Joshi
If you are migrating your COM application to Visual Studio 2012 then this could be helpful for you.
4 Sep 2013 by KillBot Project
A make-over of one of the most popular family games, Monopoly.
3 Feb 2017 by Satish Jagtap
This article is written in VC++ as utility to manage startup applications of Windows.
19 Nov 2010 by James_722
put "john.h" in the same directory as your project. I'm not sure, but if you wanted to include a header from the c drive root, then you could (maybe) put something like #include "c:\header.h"again, I'm not sure about that one. Just a note, generally you use for global includes and...
7 Dec 2010 by Andrew Phillips
This is a large topic and there are many considerations. For example, at one extreme you can have one executable and use run-time flags to control which features are seen. At the other extreme you can create different release configurations (see below) that define macros (for conditional...
3 Feb 2011 by Andrew Brock
Did you try searching[^]?
6 Feb 2011 by Nish Nishant
In the old Borland and Turbo C++ for DOS days, it was quite easy to use console-graphics modes. VC++ has traditionally not supported these modes. Although people have hacked around with inline assembly and direct video buffer writes to do console mode graphics from VC++ too. Modern day VC++...
15 Mar 2011 by Sergey Alexandrovich Kryukov
Your question is simply not applicable to IDL. It is applicable to implementation of the functions defined by IDL.IDL is "Interface Definition Language". When you compile it, you got interfaces only (well, just a bit more). When you generate source code in some languages you will get...
2 Apr 2011 by Hans Dietrich
Usually in an OnPaint() handler you will call BeginPaint(). This fills the PAINTSTRUCT structure with painting info, including the rcPaint RECT.Another very common way is to simply call GetClientRect(), which returns the RECT for the entire client area of a control.
7 Apr 2011 by Sergey Alexandrovich Kryukov
I already commented on Win98. This is the only item which can be highly problematic. If you could exclude it from support (I highly recommend it), you would be fine.Well, on every part of Windows API you need to look for Microsoft documentation and check up the list of compatible platforms,...
8 Apr 2011 by StupidSteve
I am a totally newcomer to C and I am currently reading K&R's The C Programming Language.Today I try to solve 2 simple exercises from this book and I found something wrong with my code----but I don't know why. Could anybody help me about them? THX alot!PS, I am using Microsoft's visual...
19 Apr 2011 by Prerak Patel
http://compnet...
4 Oct 2011 by Nick Kulikovsky
There is ATL CWindow method CenterWindow:void CenterWnd(HWND hWnd){ CWindow wnd; wnd.Attach(hWnd); wnd.CenterWindow(NULL); wnd.Detach();}
17 Jul 2012 by Jake Franta
14 Aug 2016 by Tacitonitus
Well, on the surface, there doesn't seem to be a whole lot wrong with your code. However:1) Read (or re-read) GetMessage function (Windows) - specifically where it says, "avoid code like this" (hint: you have code "like this").2) Kill off the WM_PAINT case - it doesn't do anything.3) Add...
14 Oct 2010 by InActive
How to use the .NET DateTime class in C++ to generate a basic calendar via a console program
19 Nov 2010 by Henry Minute
Try to work it out from this[^].
19 Nov 2010 by #realJSOP
It depends on how you want to decorate the #include. Go here for details:http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.71).aspx[^]
5 Dec 2010 by raja_s
Hi All, I have a quetion. Is it possible to run a method when an event occurs. Not by using infinite loops and events are not from any control, ex., event set by communication port like EV_TXEMPTY.ThanksRajasekhar
7 Dec 2010 by Rajesh G Manwani from Mumbai
Hi,I am developing ActiveX control using VC++ with Visual Studio 2010, on WindowsXP.I want to have multiple release types for my project. The release types will differ in features. The release A may have only features A1...An while Release B may have only features B1....Bn. Also, there...
7 Dec 2010 by #realJSOP
Macros are compile-time features, not runtime features.One way to accomplish this would be to include one or more DLLs in your project that turn one various features, and then base those features' availablity on the presence or absence of the DLLs. Of course, there are many other ways,...
7 Dec 2010 by ShilpiP
One way is like that:a) Create One Function InitializeComponent(Key)// Key is passed as argument.For Different client, the key is different For Client 'A' it is 3123123For Client 'B' it is 2343454b)Client must use this function.c) Check the key value is correct.c)...
20 Dec 2010 by Rajesh G Manwani from Mumbai
I updated an interface of an ActiveX control with two methods. I compiled the .idl file and generated the ocx. The interface had 89 methods. I got the following warning which I ignored:warning MIDL2362: too many methods in the interface, requires Windows NT 4.0 SP3 or greaterI am compiling...
23 Dec 2010 by Manfred Rudolf Bihy
If the interfaces are defined in speparate namespaces it shouldn't matter. You have to make sure though that when one class uses both interfaces they would have to be fully qualified.I hope I expressed it clearly.Modification: After all namespaces were especially made for resolving...
4 Jan 2011 by Nuri Ismail
Yes, it is possible. This[^] MSDN article is a good start point for MFC database programming. :)
10 Jan 2011 by Espen Harlinn
check calling convention, parameters and so on. everything must match the expected method signatures.RegardsEspen Harlinn
4 Feb 2011 by Niklas L
Try using the Depends.exe tool on your executable. It will give all dll dependencies, and hint what's missing. This tool came with VC6 if I remember correctly. It's just a plain exe file you can copy to a target machine and run on your binaries there to easily detect missing dlls, and traverse...
4 Feb 2011 by Andrew Brock
To clarify on Niklas's answer, Depends.exe can be found here[^].Also check to make sure you are using a static link to MFC and the CRT in Project Properties>General>Use of MFC and Project Properties>C++>Code Generation>Runtime Library. If you don't want to or can't use a static link (which...
6 Feb 2011 by #realJSOP
You can't draw a graph in a console application.
6 Feb 2011 by Espen Harlinn
Since Nishant Sivakumar mentioned the "good old days" of DOS, Turbo Vision[^] is an option if you want to develop an "intuitive" console/text mode application.It now works on DOS, FreeBSD, Linux, QNX, Solaris and Win32 :)Have fun :)RegardsEspen Harlinn
11 Feb 2011 by Sharon F
I am developing using VC++ 2010, have an MDI application using tabbed documents using the Ribbon Bar Office 2007 style Fluent UI.I changed the CMFCRibbonStatusBar to CMFCStatusBar in the Main Frame class (because the extended panel text on the right disappeared when the frame size became...
11 Feb 2011 by mbue
If you do it in this way you have to instanciate the vtables in the final class (iPersistStream derived from base classes) example:class iPersist : public IPersist{public: // IUnknown virtual HRESULT __stdcall QueryInterface(REFIID riid,void** ppv){ return E_NOINTERFACE; } virtual...
11 Feb 2011 by Sergey Alexandrovich Kryukov
You cannot instantiate an abstract class. You should understand which classes are abstract: those having at least one pure virtual method, which is often called abstract as well (in newer language it is typical to have the language key word abstract in one or both cases).So, how would you...
11 Feb 2011 by Rajesh G Manwani from Mumbai
What all tools are available for porting Windows-based Active X control which uses DirectX, to Linux platform? I have explored to some extent and zeroed onto two options - WineLib and JAVA. Which one is better choice? Are there any other options available?
12 Feb 2011 by Nish Nishant
You don't put that in the IDL file. Take a look at this MSDN example that shows how to use STL types with ATL:http://msdn.microsoft.com/en-us/library/3stwxh95(v=VS.100).aspx[^]
12 Feb 2011 by Stephen Hewitt
In short, you can't. You can use STL and such to implement COM exposed methods but the methods themselves can only accept certain types as parameters. See here[^] for a list and details. COM is language neutral so it wouldn't make sense to export C++ specific types.
3 Mar 2011 by Emilio Garavaglia
In the way you asked, no. Simply because an Icon is actually two bitmaps: an image (defines the color of the pixels) and a mask (defines which pixels have to be painted and which not, and hence be transparent).An HBITMAP is just one image, so you cannot "extract" the other.But you can...
7 Mar 2011 by CPallini
Documentation[...
9 Mar 2011 by SnowHow
The bitmap editor in VS does not create 32bit bitmaps hence there is no alpha channel which is kind of absurd. Anyhow a quick look at google should provide you with the means to do what you need. Google Time
9 Mar 2011 by ganesh_IT
Hi guys, now am in a MFC project which contains rich ribbon controls. I am using document view architecture and i inherit my view class from CListView.In my UI design i have 6 category ribbons, i need to change my list view when category ribbons are selected.Is there any notification is...
15 Mar 2011 by Rajesh G Manwani from Mumbai
I think I did not pose the problem correctly. The implementation of interfaces by co-class is well-known. The co-class can initialize itself and its method implementation can validate interface inputs etc. However, I am talking of structure data types in IDL which are used in interface methods....
2 Apr 2011 by Hans Dietrich
You need to do the drawing in the OnPaint() handler.
6 Apr 2011 by Satheesh1546
Hi Experts, Is to possible to return the Resource ID form its name ? ie, in Resource.h there are values like IDR_BUTTON1 100 . I needed to return the value 100 by specifying its name as"IDR_BUTTON1". Please help me.Thanks,Laje.
8 Apr 2011 by mbue
Ive done your homework for you:void main(){ struct { static int space(TCHAR c){ return (' '==c)||('\t'==c)||('\r'==c)||('\n'==c); } static int escape(TCHAR c){ return ('\t'==c)||('\b'==c)||('\\'==c); } } is; TCHAR c; int s = 0; // Q1: solution ...
8 Apr 2011 by Albert Holguin
First Question:In this loop, you're removing every other character by checking for EOF and following that up with an if statement that calls getchar() as well, you should only call getchar() once per loop iteration:while ((c=getchar())!=EOF){ if ((c=getchar())!=' ') { ...
13 Apr 2011 by LaxmikantYadav
Dear Anurag, It looks like a ocx registration problem. try to register it with regsvr32 app.regsvr32 ocxfilename
11 May 2011 by Albert Holguin
Again, here's a decent article on why the "No target architecture defined" error comes up, there's environment variables missing that are usually set up by other files:http://mcdermottcybersecurity.com/articles/64-bit-device-driver-development[^]
3 Jul 2011 by CPallini
There are a lot of articles here at Codeproject, have a look at them[^]. You may also find my own article"Plain C Resampling DLL"[^] useful.
21 Nov 2011 by Andrew Brock
1. Perhaps try http://cboard.cprogramming.com/windows-programming/114294-getting-list-usb-devices-listed-system.html[^]2. No idea, there is probably an API somewhere, or a registry key. At least the Windows Firewall has an API documented on MSDN[^]3. These live in 2 basic locations. The...
30 Jan 2012 by Lakamraju Raghuram
In unmanaged C++, Static data members of classes must be initialized at file scope, while you have to do the same in the class itself in C++/CLIcheck this :http://msdn.microsoft.com/en-us/library/27tfb08h.aspx[^]Also check this article for intro to mangaed c++. It's good one.C++/CLI...
30 Jan 2012 by Sergey Alexandrovich Kryukov
You are not migrating from VC++6.0 to VC++ 2010, you are migrating: 1) from native platform to CLR platform implemented by .NET; 2) not from one version of C++ to another one, but from one language to a very different language called C++/CLI.I'm afraid you do not realize one or both of those...
15 Mar 2012 by Dharmateja Challa
Using parallel_for_each which is part of Parallel Pattern Library ( PPL )
14 Apr 2012 by Member 8697687
Hi,I'm sure this is outdated question, but here's the straight answer.Add this to you message map in MainFrm.cpp:ON_REGISTERED_MESSAGE(AFX_WM_ON_CHANGE_RIBBON_CATEGORY, OnRibbonCategoryChanged)then, declare and implement method OnRibbonCategoryChanged:LPARAM...
28 Aug 2012 by Mehdi Gholam
Try using a memory profiler, follow the links below :http://stackoverflow.com/questions/818673/memory-profiler-for-c[^]http://en.wikipedia.org/wiki/List_of_performance_analysis_tools[^]
29 Aug 2012 by JackDingler
Visual Studio has a built in memory profiler....Place the following in each of your .cpp files after the include statements.#ifdef _DEBUG#define new DEBUG_NEW#endifThen run your application in the debugger in debug mode.Close your application.You'll see any memory leaks...
18 Sep 2012 by FranciskaR
Benchmarking Boundary Trace Algorithm against some FloodFill algorithms since they used a stack or recursion
8 Oct 2012 by Maxim Kartavenkov
Sorry, I just proper review your code - some bugs in there.See how it should be:1. Call SetupDiGetClassDevs to create enumeration list with the class guid and device flags - you doing that properly. Example:HDEVINFO hDeviceList = SetupDiGetClassDevs (&KSCATEGORY_TOPOLOGY,NULL, NULL,...
19 Dec 2012 by Stefan_Lang
In VS 2010, open the project property pages, go to C/C++ -> Code Generation. There is an option called "Buffer Security Check" (/GS) which may be what you're talking about. You can disable it right there, or add "/GS-" on the command line to disable it.P.S.: the help page on /GS offers...
6 Apr 2013 by jsolutions_uk
How to have a single declaration of a static member for derived classes, using a simple template
13 Apr 2013 by Ian A Davidson
I doubt we'd be able to help you with this online, as you'd probably need to debug it. At the very least some more information would be needed.However, having said that:1) Are you making sure that you close (dispose) any object (e.g. StreamWriter) that you use to access the file?2)...
1 Nov 2016 by Philippe Mori
The first problem with your code is that identifier that begin are reserved for the system. In your case, you use the well known macro _T as a parameter for your template.Unicode Programming Summary[^]The next problem with your code is inconsistent use of int and size_t for the size....
11 Jul 2010 by Member 4644164
HelloIm looking for a C/C++ code for a computing the minimum distance between a Point and Triangle in 3D. Please anyone can help me.ThanksBojan
11 Jul 2010 by Emilio Garavaglia
You can find the required math and a simple implementation right here:http://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf[^]
8 Sep 2010 by Coder-123456
HiThese days I'm working on writing driver. I've downloaded WDK version 7.1.0from Microsoft download center and in my source code I include ndis.h but when I compile it these messages have been shown:------ Build started: Project: sys_test, Configuration: Debug Win32...
30 Sep 2010 by Pro_Dev
I need to show a modal dialog after the window has been created and shown...I need to know that which event is fired after the window is loaded and shown in the memory so that the modal dialog stays on top of the window..!It is a MDI application and it loads after the OnCreate method has...
30 Sep 2010 by Richard MacCutchan
The simplest method of doing this is to send a private message to your window just after it has first been created. Your code can then respond to that message by showing your dialog.
7 Oct 2010 by Ravikant
I am building a project in which 1 other project is also included. My both projects are built with "Use MFC in a Static Library" and "MT" options. My second project is a library which is compiled successfully but when i compile my main project i get following errors:C:\Program Files\Microsoft...
7 Oct 2010 by #realJSOP
Why do you have this in your code NINE TIMES?#include Also, does myheaderfiles.h also have this line:#include "stdafx.h"
7 Oct 2010 by Aescleal
It looks like you're including the MFC CString definition and then typedefing it as something else. I'm sort of surprised the typedef doesn't give you a redefinition error but that what it looks like from what you've said.Cheers,Ash
19 Oct 2010 by CPallini
you should replace old headers with new ones, namely:Faraz the fighter wrote:#include #include #include with #include #include #include also, add using namespace std;just below the #include lines.
19 Nov 2010 by Member 3997606
I create a header file that I would like to use in my C++ code but it says that it can't find it where do I need to put in order for VC++ to find it?
19 Nov 2010 by Member 3997606
I am using #include "john.h". which is in the c:\ directory how do I get the main program to use this header file?// john.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "john.h"int _tmain(int argc, _TCHAR* argv[]){ return...
6 Dec 2010 by Maximilien
I would assume so.Have a look at WaitCommEvent on MSDN.Max.
7 Dec 2010 by Rajesh G Manwani from Mumbai
I am integrating GDAL (open-source project, for geographic translations)library with my application in VS2010. The library source code has multiple folders. Each folder has its own makefile.vc file. I want to compile the library without certain features which are in turn dependent upon other...
7 Dec 2010 by Alain Rist
Hi Rajesh,The simplest is certainly to use the VS2010 GDAL and MapServer SDK packages[^].Otherwise the Visual Studio facility for this kind of issue is the powerful but poorly documented Property Manager[^].cheers,AR
7 Dec 2010 by Rajesh G Manwani from Mumbai
Thank you all for your response.I have read each of the solutions and admire the knowledge exhibhited in each of them.All the solutions are genuine and feasible. I think that making different Visual Studio Configurations will be sufficient for my needsand I will try this. If it does...
17 Dec 2010 by Rajesh G Manwani from Mumbai
Following is part of log of dependency walker profile :00:00:00.625: DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x00000000) in "f:\clearcase\compomap_source\compomap_cvob\source\vs2010\debug\COMALGOVISIBILITY.DLL" returned 1 (0x1) by thread 1.00:00:00.625:...
21 Dec 2010 by #realJSOP
I found this with google (you know - that free search engine at www.google.com):http://support.microsoft.com/kb/241849[^]
22 Dec 2010 by SIBI V.J.
Hi, I want to change the color, font and style of title bar in a dialog box.I am vc++ developer. Please help me..RegardsSibi Jayan
22 Dec 2010 by jk chan
u can handle WM_NCPAINT message and paint ur own title bar there using GDI/GDI+ functions.see this http://www.codeguru.com/cpp/w-d/dislog/titlebar/article.php/c1987/
23 Dec 2010 by Rajesh G Manwani from Mumbai
My Visual Studio solution has around 10 projects. Each project has different target and some projects use output of other projects. Most of the projects are ActiveX components represented by DLLs. Each project has its own set of interfaces. I want to define new interfaces in ProjectB but want...
4 Jan 2011 by SIBI V.J.
Hi, I am a vc++ developer, and I want to know that, is it possible to connect a database with mfc dialog based application? If it possiblePlease give me some references about it, or some example codes of it. ThanksSibi V J
4 Jan 2011 by Ger Hayden
Have a look at http://www.codeproject.com/KB/cpp/sdba.aspx.I have an MFC dialog based application but its many years since I wrote the connection part - and I was told that such was the "mixed grill" used by me that it was a miricle that I got a connection.This was the all important...
5 Jan 2011 by SIBI V.J.
Thanks.. The following code got a connection between Ms Access and MFC dialog based application.....But I can't see any methods to write data in to database. Please refer that also.... CDatabase database; CString SqlString; CString strUname, strPword; CString sDriver =...
6 Jan 2011 by Sharon F
I am using VC++ 2010 targeting XP and up and would like to dynamically change the ribbon bar which was created using the ribbon designer:1) change the ICON when a user clicks on an item and then change it back when clicked again.2) change the text label when a user clicks on an item and...
10 Jan 2011 by Rajesh G Manwani from Mumbai
I am updating interface of an active x control. It has dual interface. I have manually updated the odi file, compiled it, and added the new methods to co-class and dual interface. On compilation , I get the error 'cannot instantiate abstract class Cobject::XObject due to members --- list of...