Click here to Skip to main content
15,881,173 members
Everything / Programming Languages / Visual C++ 9.0

Visual C++ 9.0

VC9.0

Great Reads

by logicchild
An article that explains how to use this library
by SBJ
A Model-View-Controller Framework that integrates with the MFC Doc/View architecture
by Ernest Laurentin
Full-fledged ATL Windowless ActiveX Container. Ideal for hosting Windows Media Player, Transparent Flash and Silverlight Animations.
by Michael Dunn
Create custom tasks in your app's jump list on Windows 7

Latest Articles

by QxOrm
QxOrm C++ library: Persistence (based on QtSql Qt library) - Serialization (based on boost::serialization library) - Reflection (introspection)
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 Ravimal Bandara
An implementation of Bag-Of-Feature descriptor based on SIFT features using OpenCV and C++ for content based image retrieval applications.

All Articles

Sort by Score

Visual C++ 9.0 

10 Sep 2010 by logicchild
An article that explains how to use this library
20 Mar 2009 by SBJ
A Model-View-Controller Framework that integrates with the MFC Doc/View architecture
5 Mar 2009 by Ernest Laurentin
Full-fledged ATL Windowless ActiveX Container. Ideal for hosting Windows Media Player, Transparent Flash and Silverlight Animations.
29 Jun 2009 by Michael Dunn
Create custom tasks in your app's jump list on Windows 7
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.
3 Sep 2013 by Nikolay Ananenko
Avoid horizontal scroll and effectivelly use whole horizontal control width: resize all columns except one to their content and this one to all remaining space.
15 Mar 2011 by gtest_vs
See GetPrivateProfileString & WritePrivateProfileString in MSDN. ;)
15 Mar 2011 by Nuri Ismail
You already know about GetPrivateProfileString and WritePrivateProfileString from the answer of gtest_vs. You can find examples on this functions in MSDN. Also consider using a helper library or class instead of raw APIs. This can simplify things a lot.For example you can use this INI...
24 Nov 2011 by Scanix
SystemFramework defines interfaces, classes, and types to support a native runtime system with its own garbage collector, delegates, etc. The design of SystemFramework classes is similar to those of the .NET Framework.
8 Jul 2012 by Jochen Arndt
You may connect a 'DVI Dummy' (Google for it) that simulates a monitor to be attached to the graphics card.For a VGA port see this VGA Dummy[^] solution.You may also try ZoneScreen which is designed to extend desktops over network connections. It contains a virtual graphics card with...
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.
18 Mar 2010 by HimanshuJoshi
You can use Wininet Please look at this article[^] for further info
18 Apr 2010 by Sharjith
This article shows how to instantiate a COM object in Tcl/Tk and use its methods and properties.
4 Dec 2010 by pasztorpisti
Instead of DoModal() try to put your initialization to virtual BOOL OnInitDialog() if its not there already. It was long ago I used MFC for the last time but I think that at the time DoModal() is called not all the underlying resources (HWNDs) are created, but when InitDialog() runs, they...
19 Jan 2011 by #realJSOP
That error is "Access denied". http://msdn.microsoft.com/en-us/library/ms681381(v=vs.85).aspx[^]
29 Jul 2011 by Sayyed Mostafa Hashemi
Code for checking the avilabiltiy of Internet connection.
9 Jul 2012 by shankha2010
Hi All, I want to extract some data from a flash website by OCR[Optical Character Recognition] programmatically.By taking Internet explorer handle and navigating to apage and taking screenshot of it.Everything went fine until I scheduled it in a server that have no monitor.Any Idea...
26 Jan 2010 by Richard MacCutchan
This question has been posted once already. Please do not multi-post questions, but wait for an answer.
11 May 2010 by «_Superman_»
There are some example articles here on CP -http://www.codeproject.com/KB/buttons/roundbuttons.aspx[^]http://www.codeproject.com/KB/buttons/CRoundButton2.aspx[^]
28 Oct 2010 by JF2015
The article also says, that you must create the WindowsFormsControlLibrary1.dll as first step. If you can't find the dll then this means you didn't follow the first steps "To create the .NET user control". It is all very good explained - just follow the instructions step by step.
13 Jan 2011 by Espen Harlinn
Did you register it as administator? Using "Run as Administrator" ?There is also this:Creating Shortcut Menu Handlers[^]RegardsEspen Harlinn
21 Jan 2011 by Andrew Brock
This could be quite tricky, as the library will be built with a different version of the CRT (and possibly MFC if it uses that too). The only thing that should really matter is the linking to the CRT in Properties>C/C++>Code Generation>Runtime Library. This should be set to what it was set to...
19 Jan 2011 by Nish Nishant
Adding to JSOP's answer.The fact that it runs fine in your local machine does not mean it will run remotely via COM. You may need to configure the DCOM server to run as a higher privileged user. Alternatively, try writing to a path where you have permissions.
23 Feb 2011 by Nish Nishant
This is one option (MSXML):http://msdn.microsoft.com/en-us/library/ms759192(v=VS.85).aspx[^]
24 Feb 2011 by Espen Harlinn
You can use the XML Schema Definition Tool[^] to generate c# code based on your xml schema.The generated code can be used to easily read and write your xml files.Updated for C++A good C++ validating xml parser can be found at:Xerces-C++[^]Best regardsEspen Harlinn
23 May 2011 by Stefan_Lang
I think Emilio is on the right track. The fact that you crash inside free.c indicates that the operation push_back() tries - and fails - to free some internal pointer inside the struct, DEV_INFO.push_back does two things:1. Ensures that the vector provides sufficient memory (reallocate if...
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();}
8 Feb 2012 by Ashish Tyagi 40
So you are on windows-Try any of these.ClipboardCOMData CopyDDEFile MappingMailslotsPipesRPCWindows SocketsWell Data Copy^ and Pipe^ would be easy options.
3 May 2012 by Chandrasekharan P
I guess GetClientRect and MoveWindow Will help you on that. Look at this link. [^]
17 Jul 2012 by Jake Franta
27 Jul 2013 by pasztorpisti
Regardless of the actual implementation/class you instantiate put the result pointer into a base class pointer and all the general implementation independent code should work with base class pointers/references.BaseClassPointer* GetInstance(){ if (globalsettings == "whatever") ...
20 Nov 2009 by Dilip Jaju (DJ)
Hi,I have to shift MFC(MDI Application) project into C# .net windows applications(windows forms).I have used MVC architecture in MFC( Model and Controller part is in DOC itself.).Iam little confused about use of MVC architecture and one more thing Iw
29 Nov 2009 by AspDotNetDev
Have you tried:UPDATE TableName SET Result = 2 ^ 2
29 Nov 2009 by AspDotNetDev
So, what you really want to do is call VBA functions from MS Access queries? This page explains how to do that.
29 Nov 2009 by AspDotNetDev
I don't really follow you. If you want to use a VBA function in an Access query, just create your own UDF that wraps that VBA function, then you can use that UDF in your Access query. And if you want to use some Access query function from VC++, you can make database calls to an Access DB from...
15 Dec 2009 by Rajesh R Subramanian
I'm not sure if you could go to specific line number. The selection is based on the criteria of character numbers (for example, select the contents in the control from 34th character to 45th character).Look at the CRichEditCtrl::SetSel()[^] function.
19 Jan 2010 by CPallini
What about documentation?Multithreading with C++ and MFC.Multithreading: When to Use the Synchronization Classes.Multithreading How to Use the Synchronization Classes. :)
19 Jan 2010 by Richard MacCutchan
Is this the only place that EnumFontFamExProc is defined? It looks as though the compiler has another definition from somewhere; perhaps you could post some more of the code, including the CFontDlg class definition.ps I also put your code in tags to make it more readable.
19 Jan 2010 by Graham Breach
There's a ready-made MFC class called CFontDialog you can use to get a font selection from the user, but to answer your question...It sounds like the signature of your function definition doesn't match a function prototype, which is why the error says 'overloaded-function'.A simple way...
10 Mar 2010 by Richard MacCutchan
I think Error message 1 is pretty clear. You have a reference to the item basedataobj_ProxyFileInfo in file C:\workspace\cominterfaces\basedataobj_dlldata.obj which is not externally defined anywhere. Check the source to find the reference and see if you can discover where the definition should be.
15 Mar 2010 by thakurbond
Is there any utility/lib/code to convert excel data to xml data and vice versa?
18 Mar 2010 by Markus Antonius
I know that we can use CHttpFile, in VC, to write a HTTP client. I want to write a HTTPS client with cpp. Can anyone help me?
27 Jul 2010 by Sandeep Mewara
I guess, you are missing the Tamil Locale MUI. You need to install the language pack such that the text in that locale can be seen properly. Read all about them here: Multiple User Interface (MUI) Language Packs[^]
31 Jul 2010 by #realJSOP
Why don't you just create a static class and put the variable in there (don't forget to make it public static as well). Then you can get to it from anyplace in the program.
31 Jul 2010 by Aescleal
If you have two dialogues that have to communicate why not do something radical like pass the address of the one data has to be fetched from to the constructor of the one that wants to consume the data?Then you don't have to mess about calling global functions, casting (you might like to use...
2 Aug 2010 by Richard MacCutchan
I think you probably need to set "Precompiled Header" to "Not Using Precompiled Headers", in your compile options. You should then do a complete rebuild.
2 Aug 2010 by Niklas L
A rebuild is mostly what is needed. This error is not necessarily related to using precompiled headers or not, even though the error indicates the file is stdafx.obj.
2 Aug 2010 by Yusuf
There are a number of reasons that can give LNK1104 error. See MSDN documentation for a list and make sure you don't have any one of those cases.http://msdn.microsoft.com/en-us/library/ts7eyw4s(VS.71).aspx[^]
3 Aug 2010 by bleedingfingers
If the application is not supposed to be multithreaded and fairly simple, using good old global static variables will get you by this.For data exchange, use the relevant event handlers.Since you haven't posted anything but just a line of code, out of context, I assume that what you need...
3 Aug 2010 by CPallini
You may have a look at the following oldie-goldie article: "Dialogs Communication"[^]. :)
30 Aug 2010 by Uwe Keim
I would recommend to compile in release mode with debug infos so you can debug the release mode, too.Probably you know that variables in debug mode are initialized with zero/null automatically, whereas they have random values in release mode.CheersUwe
29 Oct 2010 by Nish Nishant
You are not checking for errors. You need to check and see that LoadLibrary succeeded, GetProcAddress succeeded etc.
31 Oct 2010 by Nish Nishant
You don't need to write multiple dialogs, most people just extend property sheets/pages to get this done the way you want to. For an example, see the following article:CTreePropSheet - A Netscape/Visual Studio .NET like Preferences Dialog[^]
10 Nov 2010 by Abhinav S
Check that you have the right .Net framework (+ updates) installed on the non-developer system.
11 Nov 2010 by Nemanja Trifunovic
Check the linker settings for your MFC dll. If MFC and CRT are not linked statically, than you need to distribute them as well. One way to do it is by installing this: Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) [^]
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
29 Dec 2010 by Henry Minute
Rather than asking such a general question here, you might have been better served by doing an internet search.I found Socket Programming with MFC (Part 1)[^] by doing so and it should at least get you started.
14 Jan 2011 by Member 546551
I have an MFC application with an context menu handler which works fine on all 32 bit win.I have tried it on (XP, Vista,7, Server 2000/2007...).Then I installed 64 bit 7 and now I can't get it to rear it's head anymore.It's the same on all 64 bit windows versions.First I recompiled...
23 Jan 2011 by Indivara
Does this help?http://support.microsoft.com/kb/948477[^] Replying to comments has become tediousKozlov_Sergey (KS): No, it doesn't (implicit reply)Indivara (I): Try removing the setting that embeds the manifestKS: That fixes error, but absence of manifest causes program...
22 Jan 2011 by Nish Nishant
Adding to T2102VC++ 2010 is far more standards compliant than VC++ 6 was, so you will probably need to do quite a bit of tweaking of your code. It all depends on how you wrote your code in VC++ 6.
21 Jan 2011 by Steve Maier
Here is an article from Microsoft on how to do it.http://support.microsoft.com/kb/168151[^]
30 Jan 2011 by Abhinav S
Have a look at the properties section as described here[^].Properties="Configuration=Debug;"
15 Feb 2011 by Sergey Alexandrovich Kryukov
"Without the DLL" sounds ridiculous! You could also say "without C# file". Well, change DLL extension to something else, you will have without DLL :-)Seriously, using .NET assembly by native (unmanaged) code is a problem. Is that what you tried so far? Suggested use is COM, but I this is not...
20 Feb 2011 by Cedric Moonen
If you have no idea about anything about it, I suggest you first start to learn about xml and xsd, it will help a lot to communicate with others about the subject. There are some good tutorials here[^]: you have to look in the XML section, there is an entry about xml and an entry about schema...
21 Feb 2011 by Nish Nishant
Once you add the project, use the Add Reference dialog on the original project to add a project-reference to this newly added project.
21 Feb 2011 by Yusuf
First read Nish's answer then here is how to do ithttp://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx[^]http://msdn.microsoft.com/en-us/library/ftcwa60a(v=vs.80).aspx[^]
22 Feb 2011 by Andrew Brock
Check out WM_WTSSESSION_CHANGE on MSDN[^].wParam == WTS_SESSION_UNLOCKNot sure if this is send on a suspend (sleep), you may need to handle WM_POWERBROADCAST[^] as well.For future reference, I found this by opening up Spy++ from the Visual Studio Tools menu and spying on messages sent...
23 Feb 2011 by Olivier Levrey
OK I will do your job and ask a proper question (you should do it by yourself if you want a chance to have answers...).Correct me if I am wrong. Your FireMTURL function looks like:CString FireMTURL(CString msisdn, CString mesg, CString MT_URL, CString MT_SHORTCODE){ ...
15 Mar 2011 by Kurt Degiorgio
Read: GetPrivateProfileStringCheck the following link for more details on the function: http://msdn.microsoft.com/en-us/library/ms724353(v=vs.85).aspx[^]Write: WritePrivateProfileStringCheck the following link for more details on the function:...
25 Mar 2011 by Eugen Podsypalnikov
1) sTextInside will be empty in case of (0 == buff) or (0 == buff[0])2) It is a reaction of your form (not of this->tbxPw)3) The coming buffer is here to be filled in, not to be read4) Be sure also you need char and not WCHAR
25 Mar 2011 by miqmago
The solution: (also see http://blog.tcx.be/2008/04/making-your-password-textbox-more.html[^])#pragma once#include using namespace System;using namespace System::ComponentModel;using namespace System::Drawing;using namespace System::Windows::Forms;using namespace...
16 Apr 2011 by OriginalGriff
Well the VS designer is a good place to start...From a user POV I don't like it much though. Have you considered using a table based view instead? You can put check boxes inside them and they could be a bit more flexible than that! That is a bit "busy" and difficult to work out what period...
11 May 2011 by Stephen Wiria
I believe you need to add a delay there, the simplest thing you can do is adding a Sleep.Sample code[^]
11 May 2011 by Olivier Levrey
Check the return value of ReadFile. Is it returns FALSE, then call GetLastError to have details about the error. Also check the number of bytes really read 'cp.dwBytesTransferred).Form this code:bResult=ReadFile( hPort, &cp.Byte, 1, ...
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[^]
17 May 2011 by barneyman
it would appear to be shorthand for creating a couple of locals on your stack for some bstr/wstr functions ...http://www.codeproject.com/Messages/1870028/Re-USES_CONVERSION.aspx[^]
21 Jun 2011 by Joan M
Take a look here[^], you will find the answer in the topic 4.2.It is easy, you need only to handle the WM_ERASEBACKGROUND message.You can't change the dialog background colour using the resource editor...
18 Nov 2011 by Gokulnath007
I would like to place the icon in the notification tab.The entire application after executing should place the icon in the notification panel with no more dialog boxes.
19 Nov 2011 by Philippe Mori
You should create managed object in your mixed-mode C++ assembly.That is, public ref class Test.C# will not be able to call unmanaged code directly. The recommanded way is that any public class are managed one.There is a lot more to learn if you want to mix managed and unmanaged...
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...
15 Dec 2011 by CPallini
Coder Block wrote:now when i wrong intput file contain only 5 bytes i got assertionbecause i excepted 15 bytes so what is alternative to come out of this errorThe alternative, of course, is checking the file length before actually parsing the file.
19 Feb 2012 by Gokulnath007
Will the function getenv() works in all windows machine?
20 Feb 2012 by Johannes Hillert
Hi,getenv(...
9 Mar 2012 by Jochen Arndt
I did not see anything serious wrong. But you should useint fd = open(sFilePath, O_RDONLY | O_BINARY, 0);to ensure that the file is opened in binary mode, because the default Windows fmode is O_TEXT.With binary mode, read should then return iBytesToRead while not just before the end of file.
21 Mar 2012 by Jochen Arndt
A very simple solution:void Encrypt(LPCTSTR lpszFile, const BYTE *pBuf, unsigned nSize){ LPBYTE pEnc = new BYTE[nSize]; memcpy(pEnc, pBuf, nSize); for (unsigned i = 0; i
1 Apr 2012 by chaiein
CString WriteString;.... WriteString.Format("%s.%d d",WriteString,NI);At above WriteStringthe buffer too small warning is shown when executed any times because CStringtype is not enough to hold string of any size.My goal is to get content ofWriteStringto write in to a file at...
1 Apr 2012 by chaiein
WriteString.Ap...
9 May 2012 by CPallini
change fromif(textmessage=="PLAY")toif( strncmp(textmessage, "PLAY", 4) == 0 )(or use a CString).
23 May 2012 by Sergey Chepurin
For this answer i have compiled the information from different sources but mainly from Q&A of Stackoverflow.com.A process has 5 different areas of memory allocated1. Code - text segment2. Initialized data – .data segment3. Uninitialized data – .bss segment4. Heap5. Stack...
19 Jul 2012 by barneyman
The docs for GetProcAddress[^] say it returns NULL if if failsYou're getting a NULL back (i worked that out from the exception) and you've got zero error handling in there
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...
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 May 2013 by Amit Deshmukh 1010
Accessing class object present in exe from explicitly loaded DLL using Inheritance and virtual function.
27 Jul 2013 by saqib.akhter
Hello Friends,I have a problem to integrate new feature in my product, framework team providing us some new APIs and we have to integrate in our application without impacting our old code.Following is my question:there is some 3rdParty classesThese classes are provided by...
6 Nov 2013 by Ganesh Jeevaa
Hi,Try this code.void CTestMFCDlg::OnBnClickedButtonLoadPng(){ CString pngPath=L"c:\\test.png"; CImage pngImage; CBitmap pngBmp; CDC bmDC; CBitmap *pOldbmp; BITMAP bi; UINT xPos=450,yPos=300; CClientDC dc(this); pngImage.Load(pngPath); // new...
10 Dec 2013 by nv3
The error message says it all: The CMatroxAudioExtractor class has no public assignement operator ("operator="), i.e. the designers of this class did not want that anybody assign another object directory to an object of this class. This can have several reasons, for example because the object is...