Click here to Skip to main content
15,888,454 members
Everything / Programming Languages / VC++

VC++

VisualC++

Great Reads

by Eugene Balabanov
A tiny sandbox primer
by jurhas
A small simulator for a 6 axis articulated robot
by Marius Bancila
Using managed COM objects in C++ without registering the server in Windows Registry
by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation

Latest Articles

by Ștefan-Mihai MOGA
Task Manager shows you the programs, processes, and services that are currently running on your computer. You can use Task Manager to monitor your computer’s performance or to close a program that is not responding.
by Ștefan-Mihai MOGA
This article is about the IntelliFile application which is a free alternative Windows version to Total Commander and uses many components that have been published on CodeProject.
by Ștefan-Mihai MOGA
You can use IntelliPort to transfer large files from a computer onto your portable computer using a serial port rather than going through the process of setting up your portable computer on a network.
by Tough Developer
How to compile WinQEMU v0.10.2 in VS2008 and VS2012

All Articles

Sort by Updated

VC++ 

8 Jul 2011 by #realJSOP
Just add a reference for the C++ assembly in your vb.net app, and call the method.
15 Jul 2011 by #realJSOP
I believe you need to call EnableDocking for the control, and possibly the window in which the DialogBar object resides. While you're waiting for a better answer, Google is your friend.
22 Jul 2011 by #realJSOP
Most of the reasons an application that runs fine on XP but will fail on Vista/Windows 7 has to do with new tighter security requirements for the newere OSs. Some things that you could do regarding file placement, rgeistry access, and other things are simply not allowed on the newer OSs. In the...
25 Jul 2011 by #realJSOP
This is for DotNet, but you may be able to use the same general technique for C++/MFC:Application Trial Maker[^]If you find it unworkable, you could review the answers to this question[^]. Of course, you could also just use google...
2 Sep 2011 by #realJSOP
what type is BtnState? If it's not a bool, and it's not set to null (or zero), it will evaluate to true.EDIT ======================0) Are you sure m_pg isn't null?1) Try it this way:CPage* m_pg = ((CPage*)((CGSPropertySheet*)GetParent())->GetParent());if (m_pg){ ...
8 Sep 2011 by #realJSOP
Because a critican section is only a critical section in the process in which it is defined.
25 Dec 2011 by #realJSOP
That's a circular reference, and you can't do that. Refactor your code.
4 Mar 2012 by #realJSOP
You probably put the button on the tab control instead of onto a tab page.
25 Mar 2012 by #realJSOP
You can't minimize the console window to the system tray. That's a GUI function, and the console app isn't a GUI app.You could create a WinForms app and simulate the appearance of a console window, and then minimize it to the system tray.
9 Nov 2016 by #realJSOP
Why convert to C#? Just create a managed C++ assembly with your C++ code in it, and call if from your C# app.
7 May 2019 by #realJSOP
You're migrating through 4 or 5 versions of VS. You should honestly expect issues.
17 Oct 2011 by 01.mandar
How can we parse RegOpenKeyEx(HKEY_LOCAL_MACHINE,L"SYSTEM\\CurrentControlSet\\Enum\\BTHENUM\\{00001101-0000-1000-8000-00805f9b34fb}_LOCALMFG&000f\\9&3408FE52&0&646E6C00E02E_C00000000\\Device Parameters", 0, KEY_QUERY_VALUE, &hKey) )so that we can use it for each GUID (traversing...
19 Oct 2011 by 01.mandar
i have written Bluetooth code in win32 which detected bluetooth devices in range andafter installing bluetooth device on my PC it creates more than one COM portto get serial port i search in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSetbut some time the newly installed bluetooth do not...
11 Nov 2011 by 01.mandar
i my serial port reads only 30 bytes ?i cant find issue in dcb though. DCB dcb_ob; COMMTIMEOUTS ct_ob; dcb_ob.DCBlength =32;//sizeof(DCB); dcb_ob.BaudRate = CBR_115200; // Current baud dcb_ob.fBinary = TRUE; // Binary mode; no EOF check dcb_ob.fParity =...
12 Nov 2011 by 01.mandar
i have created dll in vc++init_set(char *) takes char *extern "C" MYDLL_API int init_set(char*);extern "C" MYDLL_API int init_valid();in c# i want to pass an string to init_set(). [DllImport("MYDLL.dll")] public static extern int init_set(char[] s); ...
14 Nov 2011 by 01.mandar
Quote: it is necessary to do GetCommState() before SetCommState() reference code: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363201(v=vs.85).aspx[^]
3 Apr 2012 by 01.mandar
i want to create an application(UI) like Windows Media Center (one with good glossy feel). In same MDI application i want to embed some .exe(opengl demo) to browse in and play selected in full screenmy question is, is it possible to build such thing? if yes, how it could be built in...
19 May 2012 by 01.mandar
i have win32api mdi form with 4 child window.one of the child window runs opengl code but really slow.i want to make fullscreen when f key is pressed.what is better solution to make window fullscreen(no taskbar & titlebar) without delay in opengl execution.
28 May 2012 by 01.mandar
i want to integrate an iframe in win32 application(plain c++) which will display an simple web page located on local drivecurrently i am using this methodHow to Integrate C# Window in C++ Project[^]i want to know if is there any component i can use more efficiently with vc++
21 Jun 2012 by 01.mandar
i have done a opengl application in win32 only using platform library.it was performing very slow so i decided to do the same opengl project using glut libraryopengl code workes fine in glut but not in win32.i thought it would be because of wm-paint so i did it with timer but no effect...
2 Oct 2015 by 0xF4
Hi,I started using VS2015 Community edition some time back, and today when I downloaded WDK for Windows 8.1, I found that it did not integrate with my VS2015. My VS installation is fine. Why is this happening?Thanks.
11 Apr 2013 by 125Azazelo
I have custom type called cell and when i try to convert from int to cell i got this strange results:typedef long int int32_t;typedef int32_t cell;cell foo(){ int xz; xz = 150; return xz;}Expected: 150Output: 32736
4 Apr 2013 by 20038427
I am using UDP Server which receives data through port 50001. I used wireshark to monitor the data. Here the data what i receive in UDP server buffer and what data is showing in wireshark is not matching fully . but some places it is matching exactly ...What could be the reason for this? here is...
19 May 2013 by 20038427
Hi,I have an MFC application, i need to change the background of the MFC to other color.Also I have some button inside the MFC i need to give different color for each button.can anyone pls help me in this .Thanks in advance
6 Dec 2013 by 20038427
Hi Everyone...I have a server client GUI application. Server application will be running in one PC and Client Application will be in another PC. I am able to send data between Server and Client . Now i want to send voice data from one PC (Server) to another (Client). The audio from one PC...
26 Oct 2014 by 503925
fopen example */#include int _tmain(int argc, _TCHAR* argv[]){ FILE * pFile; for(int i=0; i
3 Oct 2011 by @BangIndia
IUrlHistoryStg...
3 Oct 2011 by @BangIndia
i created the program to connect remote system . using wmi..but it not execute the exe. why..is there any other methods are there to lanch exe in remote machine...
4 Oct 2011 by @BangIndia
i want to delete the IE history.It located in that path.C:\Documents and Settings\admin\Local Settings\HistoryIf i try to delete means it provide system not find the path.and i can't able to delete ..can you help me .i am using msdev editor
4 Oct 2011 by @BangIndia
Delete browsing history for multiple users? i am logon into the adminstrator account..i want to use cmd prompt to deleteproviously i use system("rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 1");but it delete the history for current users only.How to delete History...
10 Oct 2011 by @BangIndia
i want to delete the files in the internet temporary files .. Location is "C:\Documents and Settings\users\Local Settings\Temporary Internet Files"if i try to delete from the files it not showing .i use cmd prompt to delete it..but if i try to search the files the cmd prompt...
10 Oct 2011 by @BangIndia
I use system("del") like that I gave. But it not reading the path.How do I delete the files underC:\Documents and Settings\users\Local Settings\Temporary Internet FilesI use DeleteFile() method but it needs the file name.I am unable to read the file name in that folder.
11 Oct 2011 by @BangIndia
i am using msdev editor for my c++ programing..i have one vb script.. But i want to do same operation using my c++ program..if any one explain me how..Set objFSO = CreateObject("Scripting.FileSystemObject")objFSO.DeleteFile("c:\dmmm\df\*")how to write the same coding in c++
16 Oct 2011 by @BangIndia
#include "stdafx.h" #define WINVER 0x0500#include #include #include int main(int argc, char* argv[]){ DEVMODE dev; DWORD DispNum = 0; DISPLAY_DEVICE DisplayDevice; ...
17 Oct 2011 by @BangIndia
This is my vb script that removes a firewall rule that allows an application through the Windows firewall.Set objFirewall = CreateObject("HNetCfg.FwMgr")Set objPolicy = objFirewall.LocalPolicy.CurrentProfileSet colApplications = objPolicy.AuthorizedApplicationserrReturn =...
2 May 2012 by @BangIndia
Hi,How to hide the button in MFC using his ID..
31 May 2012 by @bhinay
I had designed an application app.exe which reads the input from command prompt and will perform action accordingly.To run that application I am executing the following command in command prompt: "C:/Users/abhinay/Desktop> echo int_value | app.exe" Note: int_value is the integer to be...
29 Oct 2012 by @member191989
Hi,I am trying to write a code in vc++ for reading as well as writing .ods file i.e. excell file for open office which an open source software. Kindly help meMadhukar
6 Sep 2012 by __John_
You will need to add the SS_BITMAP style when you create your static control. http://msdn.microsoft.com/en-us/library/b7w5x74z.aspx[^]
12 Sep 2012 by __John_
the expression "sum + *((word16 *) addr)" is not an lvalue i.e. you cannot assign to it. I think you will need to do the increment as a seperate statement.
12 Sep 2012 by __John_
That will depend on what value you want to increment.If you want to increment the word16 that addr is pointing to, then ...(*((word16 *) addr))++;... should do it.Having sead that, I am not sure what you are trying to do, casting addr to a word16 pointer looks a bit wrong.
12 Sep 2012 by __John_
Having looked at your code a bit more I can say that you should not modify the data that addr is pointing to because it is constant data.char data[6]="CM00";data points to constant.const char data[6]="CM00";Would be correct.
16 Nov 2012 by __John_
Is this what you are looking for?...CSerialPort v1.03 - Serial Port Wrapper[^]
26 Nov 2012 by __John_
You are calling UtilityHelper::MvResolutionInfoToVTVideoStandard(sResInfo) Using the type name "UtilityHelper" rather than calling the function from an instance of UtilityHelper.Only static functions can be called in this way (i.e. no instance required).
1 Aug 2012 by _Amy
How can you forget Google[^]?These books may help...
22 Aug 2014 by _Asif_
I have looked over this issue. You need to do following to get what you want.* On Your test machine open VS* Goto: Project->Properties->Configuration Properties->C/C++->PreProcessor* Add _TEST_MACHINE at the end in Preprocessor Definition* Change your macro like this#if _TEST_MACHINE...
5 Feb 2014 by _Maxxx_
This isn't really an answer but I wanted to be able to format the code ...Your code you posted - with my comments...Txtsolution.Text = Math.Sin(Txtsolution.Text)' so Txtsoluton.Text now has the Sin of whatever was there originallyvariable1 = Val(txtsolution.Text)Txtsolution.Text...
19 Dec 2011 by _Tushar Patil
Hi,I have One Dll created in VC++ application ...I want to use that in Windows Forms Apllication...? I have To Call Functions Of That dll From Dot Net app...?Thanks in Advance.........
29 Dec 2012 by A-s-h-l-e-y
Microsoft offer the Kinect Labs SDK for windows. It works in visual studio so c# or ++. Im assuming this is what you mean.
17 Jun 2015 by Aashish Aswal
I have a 32 bit MFC Print Application that uses StartDoc API for printing. In 32 bit OS, i didn't configure any Default Print Driver, then on File Print I selected Microsoft XPS Document Writer. A "Save as File" Dialog pops up which runs in the same Process as that of Application. Now I have...
12 Mar 2013 by Abhijeet Shetkar
Hi to all. I have been trying to debug an application but it is giving me error only in debug build. release build works fine. do i need to change some project settings or exclude some dlls?i get the following debug output message in output window.C:\Program Files\Microsoft Visual...
25 Sep 2013 by Abhinandan Shetty
I want to write the test cases for the already existing VC++ application.Please suggest me an efficient and easy unit testing tool for VC++ 6.0.If possible, pls let me know the steps to integrate the tool with VC++ 6.0. I tried with winunit, unfortunately it doesn't support vc++ 6.0. Also gone...
14 Jul 2011 by Abhinav S
This[^] might help you get started.
21 Jan 2013 by Abhinav S
SELECT * from TableRegistration where PersonID='%d'",ss);You can remove the quotes in the query and try again ->SELECT * from TableRegistration where PersonID=%d",ss);
17 Sep 2014 by Abhinav S
This might help - Programmatically Configuring Permissions on a Share[^].
6 Nov 2012 by Abhineet Ayan Verma
I am trying to write some codes for detecting the user-mode hooks. Would you please guide me through the steps and ways to detect hooks. Till now I have tried enumerating all the running processes and enumerating the modules for each of the process. I read somewhere to compare the in-memory...
5 Oct 2014 by Abhishek Nandy
a simple walk through of project anarchy Wild Card
20 Dec 2012 by Abhishek Pant
have look at thisProgrammable Logic Controller Editor[^]
24 Jan 2013 by Abhishek Pant
RDP sessions mstsc[^]hope it helps
26 Feb 2013 by Abhishek Pant
this can help you a little-Wt(witty) - C++ library for developing web applications[^]
19 May 2013 by Abhishek Pant
How To Change Window Background Color with Foundation Classes[^]CColorBox[^]
22 Jan 2012 by abhishek.biradar
Hi all,Is there any function call or the code block to get the file type. I could have used the last three char like for "a.txt" can identify as text file.But this doesn't work when the check box in the folder options i.e."Hide extension for known file types" is checked.PS I...
22 May 2014 by aboutjayesh
Dear all ,I need to Open a folder and i used this code as sample and its working wellPROCESS_INFORMATION ProcessInfo = {0};STARTUPINFO StartupInfo = {0};BOOL result =CreateProcess(_T("C:\\Windows\\explorer.exe"), _T("/e,/root,F:\\Images\\Car\\AUDI"), ...
29 May 2014 by aboutjayesh
Hai,I would like to convert String^ to UTF-16.Can any one helpRegardsJay
25 Oct 2014 by aboutjayesh
Hi, is there an equivalent to the PHP rawurlencode in C#? I've already tried HttpUtility.UrlEncode and HttpUtility.UrlEncodeUnicode but they're not the same.It shows problem when char like Space '(' ')' etc..
5 Nov 2014 by aboutjayesh
HI,I created an ATL Control(ATL Project) that is invisible at run-time(property).When i Used it in a MFC dialog based application it seems visible.I need that ATL control invisible at run time.Can you help meRegards Jayesh
10 Dec 2014 by aboutjayesh
hiI created a MFC application.Sometimes the controls(Button,Label etc) in the Dialog goes invisible at run time.The Dialog form remains.This is a random issue.The screenshots of the dialog in normal time and when goes blank are attached.Can anyone help me to find the solution for this...
13 Jul 2012 by adithya.hari
I am using VS 2010.I have 3 integers.month, day, yearEach have values assigned.what is the real datatype format used in VC++ for date time?how can i join the values to get a datetime format?and how can i find the difference btn that date and the current date?
29 Jul 2013 by ADITYA PAVAN
Hi,I am trying to enter a set of characters in text box in mfc dialog application.In this text box, the condition is I should enter '*' only once. I can use '*' any where in text box. And if I use the same character('*') again, that entry should be disabled. That character should be...
15 Mar 2012 by adityarao31
How to use HotKey Control in VC++?
17 Mar 2012 by adityarao31
have written following code,I am able to see tabs but with only text not imagesIDB_BITMAP is image of size 96*32;CImageList...
28 Mar 2012 by adityarao31
I have subclassed CTabCtrl as following,but when I want to add a variable to my tab control of this new class,new class does not come in list at " Add variable->variable type" list of claswizard.This feature was there in VC6.0 does it removed in VC++ 2010class CMyTabCtrl : public...
29 Mar 2012 by adityarao31
I have created user DSN using odbcad32.exe. As it seems only connection with office 2007 32 bit available drivers.But when for DataSource( while adding CRecordSet) class ,I mention this DSN,VC++ 2010 professional edition(original)crashes without any warning,Please help me on this issue? ...
2 Apr 2012 by adityarao31
I am not able to delete data using ADO ,Will you please help me ?Code I written as follows#include #include #import " C:/Program Files/Common Files/System/ado/msado15.dll" \ rename( "EOF", "AdoNSEOF" )_bstr_t bstrConnect =...
3 Apr 2012 by adityarao31
I have a makefile secondsps.mk, How to make proxy stub dll from it.I used nmake.exe from run menu,from command prompt,but it does nothing.I tried VC++ wizard utility to create dll,but it seems it can only create exeswhen I typed output file as dll,it gives error.Can any one tell me...
10 Apr 2012 by adityarao31
I hve two different machines on one I have VC++ 6.0 and on other VC++ 2010.I developed a full server MDI application on both (very same). I am able to see my object in Microsoft word 2007 in insert Object list which is developed by using VC++ 6.0. But In case of VC++ 2010 I am not able to...
20 Jun 2012 by adityarao31
I have developed two dialog based application One for reading from COM1 port and otherto write on COM1 port.Read application waits for com event.Problem is write application able to open com port if read applcation is not running.but not able to open com port if read application is ...
21 Jun 2012 by adityarao31
CString itemno;UpdateData(TRUE);itemno.Format("%x",m_itemno);// here m_itemno is integer in range 0 to 100int len = itemno.GetLength();if(len == 1)itemno = "0x0" + itemno;if(len == 2)itemno = "0x" + itemno;unsigned char data[1] = itemno; // Here I get...
21 Jun 2012 by adityarao31
My problem got solved by using following code snippetsCString Class::IntToHex(int* yourint){unsigned char ch[1];Cstring output;memcpy(ch,yourint,sizeof(int));retVal = WriteFile(hPort,ch,1,&byteswritten,NULL);}CString Class::FloatToHex(float* yourfloat){unsigned char...
22 Jun 2012 by adityarao31
I have created very simple dialog based project by using visual C++.I have build it in release modeNow I added this exe is FileGroups link of installshild ,then I compiled and run the setupfolder get created in C:\program files ,but it contains only uninst.isu fileI have...
26 Jun 2012 by adityarao31
I am using VC++ 6.0. After adding Listbox I seen multicolumn property of list box .But I am not able to use it. I have three field data, empno,empname,empcity.How to add multi column data for this. I know how to use list ctrl,but still it will be great if some one shows me how to get...
29 Jun 2012 by adityarao31
I want to learn STL library,I am new to it.Does STL is included in VC++ 6.0or I need to download.If I needed to download please let me know how to install it. I found on internet STL ,but it is just bunch of header files.Please Guide me for this.
29 Jun 2012 by adityarao31
My problem got solved after adding one lineusing namespace std;and by defining std::vector vec ,instead of vector vec
1 Jul 2012 by adityarao31
when I added new class of type MFC class and given base class as CDaoRecordset and clicked ok, Wizard opens Database option dialog box ,selecting DAO radio button. When I selected Data.mdb file,it gives error Unrecognized Database format. My file is not corrupt ,as odbc...
10 Jul 2012 by adityarao31
I have googled for example of these macros but,I did not got any example.I tried to use both macros,out of which first one i used like this ListView_EditLabel(m_ctrl.m_hWnd,1); but not able toedit the text in list control.Next Macro ListView_SetToolTips, I am unable to use as...
8 Aug 2012 by adityarao31
How do i send a WM_CLICK message to a listctrl?I am trying to do it as follows, but this doesn't work.NMHDR hdr;hdr.hwndFrom = this->m_hWnd;hdr.code = NM_CLICK;hdr.idFrom = ??;m_List1.SendMessage(WM_NOTIFY, 0, (LPARAM)I also tried like...
12 Jun 2018 by adityarao31
I have created simple database connectivity using Visual C++ 2010 professional and SQL server 2008. I want to deploy the project to other machine. I am keeping database backup file in setup.But how should I restore it programmatically ? At Present I am deploying in Computer where...
17 Sep 2012 by adityarao31
I created MDI Template like Following CMultiDocTemplate* pRunTemplate; pRunTemplate = new CMultiDocTemplate(IDR_MerilisaRTYPE, RUNTIME_CLASS(CMerilisaRDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CRunView)); if...
19 Sep 2012 by adityarao31
I am creating MDI application. By default it uses by default toolbar resource IDR_MAINFRAME_256 and class CMFCToolBar .How to hide and show particular toolbar button. I require this functionality as there are different users withdifferent user rights are going to use this Software. Please...
19 Sep 2012 by adityarao31
I have written only this code in MDI applicationMy toolbar button gets removed by On Button.The issue is that If I run and test the application to remove the button two or three times , The next time I dont require to press button,toolbar button gets automatically removed.Even after clean...
23 Sep 2012 by adityarao31
I want to know is there any software available which can be usedto create reports from VC++,MDI application.I have heard about Crystal Reports but can it be linked with MFC. Moreover Crystal Reports is very costly I am doubtful my company will purchase it.Can any one suggest any...
2 Oct 2012 by adityarao31
DoModal Works On Windows XP But Not Working On Windows 7.0.Dialog Does not open at all in Windows 7.0What Could Be the reason. Please let me know,its urgent CCaxu1 Dcaxu1; Dcaxu1.DoModal();
7 Oct 2012 by adityarao31
I have written following code for connectivity CDatabase database; CString SqlString; CString ssn,firstname; CString sDriver = _T("SQL Server"); CString sDsn, sMc; sMc.Format(_T("MERILDSK33")); CString sFile = _T("C:\\Program Files\\Microsoft SQL...
7 Oct 2012 by adityarao31
While doing trial and error I found solution following connection string worked.sDsn.Format( _T("DSN=Trial;Trusted_Connection=Yes;WSID=MERILDSK33;DATABASE=DBTrial"));
8 Oct 2012 by adityarao31
I tried many permutations and combinations but unable to create System DSN using SQLConfigDataSource.SQL server is with Windows AuthanticationI have written following code if (!SQLConfigDataSource(NULL, ODBC_ADD_SYS_DSN,_T("SQL Server"),_T("DSN=EIAQUANT\0 DATABASE=DBEIAQUANT\0...
16 Nov 2012 by adityarao31
Hi, I am developing a project in VC++ 2010 MFC. I need Serial PortCommunication Control like MSCOMM32.ocx of VC++ 6.0. For MFC based application which control can I use?I tried to register MSCOMM32.ocx ,but it fails to registeras I am using Windows 7.0
29 Nov 2012 by adityarao31
If I write like below it goes perfectly to device at other end char ch[18] = {0x01,0x01,0x01,0x02,0x00,0x01,0x01,0x0C,0x05,0x00,0x01,0x01,0x55,0x55,0x55,0x55,0x55,0x77}; pPortInterface->;Writechar(ch);But if I write like below it does not go char ch[18]; ch[0]=...
7 Dec 2012 by adityarao31
As I have saave Hexadecimal Data To Database I have to convert it into CString.But when I convert char array to CString ,nothing gets saved in Database andthus instrument reading from Database does not work.This is because CString remains empty.Please help on this issue. char...
18 Dec 2012 by adityarao31
Actually Problem was that ch[4] = 0x00; and ch[9] = 0x00; It was causing CString to terminate.So I changed Protocol And Remove The Need Of 0x00 and passed other value like 0x01 And things worked.