C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am trying to set permission on an application as read/execute only, I can achieve this by using c++ windows SetSecurityDescriptorDacl() function.

But after that admin can change it by right clicking on a file

    properties->security->advanced->Change Permission

But somehow antivirus prevents these charges on their application ..
What does it mean to be "Always On"?
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

//************************** tracks indexs*******************
each track saved in sd card has index , so to play track number we will using it's index 
for example to play track number 1 we will using "00003"  index which will send to play track function 
all the same for the rest of all tracks 
char buffer15[6]={"00001"};  // track 15 index 
char buffer16[6]={"00002"};  // track 16 index
char buffer1[6]={"00003"};   // track 1 index
char buffer2[6]={"00004"};   // track 2 index
char buffer3[6]={"00005"};   // track 3 index
char buffer4[6]={"00006"};   // track 4 index
char buffer5[6]={"00007"};   // track 5 index
char buffer6[6]={"00008"};   // track 6 index
char buffer7[6]={"00009"};   // track 7 index
char buffer8[6]={"00010"};   // track 8 index
char buffer9[6]={"00011"};   // track 9 index
char buffer10[6]={"00012"};  // track 10 index
char buffer14[6]={"00013"};  // track 14 index


Open in new window

How can I access these mp3files via filename not index
Is there a tool to calculate line checksum of motorola S3 Record ?

For example, following is line of motorola S3 Record:


To calculate checksum manually, one byte of size, four bytes of address, and all data bytes are summed.  Extract least significant byte
from the sum, take it's one's complement and that's the checksum.

Is there a checksum calculator or tool that will calculate the checksum ?
We will install a visual studio version, probably 2015 or 2017 so that we can be ready for the present someday in the future. But for now we have to deliver our source code to the customer who only knows about Iso c++03.

This means that if a developer inserts some newer c++11/14 constructs into our code base, then I want the computer to issue fatal errors forcing the developer to have to conform to c++03.

I found this link that does not appear to go back far enough in time.

If you have an answer, please provide a relevant link that supports your response so that I can show my manager. Thanks.

Using Windows 10.
I use : to create  a new HWND

But requires the strike code for the window HWND chance his size

bool HWND (chance size)
x = windowX
y= windowY


BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,

   if (!hWnd)
      return FALSE;

   ShowWindow(hWnd, nCmdShow);

   return TRUE;

Open in new window

i use,
hwndEdit = CreateWindowExW(WS_EX_CLIENTEDGE, TEXT("Edit"), NULL, WS_CHILD, 10, 10, 200, 150, hWnd, (HMENU) NULL,NULL,NULL );
ShowWindow(hwndEdit, SW_SHOW);

Open in new window

to add a text box of one line , now i want to add a multi line field.

after solving some ugly other problems with make, I run now into the problem about the CXXFLAGS. It looks like make do not use this FLAGS.  My makefile looks like:

CXX = g++
CXXFLAGS = -g -std=c++11 -Wall -pedantic

root := /usr/share/doc/xsd/examples

include $(root)/build/cxx/rules.make
include $(root)/build/xsd/tree-rules.make

$(CXX) $(CXXFLAGS) -c 05_bxf2.cxx

	$(CXX) $(CXXFLAGS) -c XSDValidator.cpp

	$(CXX) $(LDFLAGS) -o XSDValidator.o 05_bxf2.o

	rm -f *.o

Open in new window

The repsone I got in termional after calling make

g++ -W -Wall -O3 -c 05_bxf2.cxx

Open in new window

This is not what I added to the makefile. Any idea why make do not use the Flags?

When i, wane add a new EDIT child window which the user can type text from the keyboard.
a normal text box works, but when I challenge  CreateWindowExW( EDIT ..)

and  BUILD and run the program from my compute noting happens.

Do i miss the paint code or something.

//  Add a new TEXT imput box
//CreateWindow(TEXT("EDIT"),TEXT ("VALEU"), WS_VISIBLE | WS_CHILD | WS_BORDER ,10,10 ,200,25,hWnd, (HMENU) NULL,NULL,NULL );

// Add a new TEXT edit window

CreateWindowExW(WS_EX_CLIENTEDGE, TEXT("Edit"), NULL, WS_CHILD, 10, 10, 200, 25, hWnd, (HMENU) NULL,NULL,NULL );

Open in new window

I have really problems to understand makefile and its rules.
I created a makefile that works perfect. Now I want to remove objects before compile but it do not work with rm -f *.o
I get always the message "Missing seperator. stop"

# Build
# /opt/rh/devtoolset-4/root/user/bin/
    rm -f *.o

root := /usr/share/doc/xsd/examples

include $(root)/build/cxx/rules.make
include $(root)/build/xsd/tree-rules.make

XSDValidator: XSDValidator.o 05_bxf2.o
05_bxf2.o: 05_bxf2.cxx 05_bxf2.hxx
XSDValidator.o: XSDValidator.cpp 05_bxf2.hxx

Open in new window

Any Idea what I do wrong? Without "clean: rm-f *.o" it works well. I also tried to use a tab before "rm"
But nothing helps. It looks like "rm" do not work in makefile?
Hello All, I need help. Badly!

We have a Mercurial repo that keeps out source code for the last year. Yesterday, and error popped up when compiling one of the solutions (see compile_error.jpg). I then ran other projects from that same solution that did compile, and I get the runtime error seen in the file runtime_error.jpg. I then went back to a repo from September 2016, and I get the exact same compile time and runtime errors.

I have tried this on 4 systems. All four systems are Windows Pro 64 bit. I'm using VS2013 C++.

I don't suspect the code itself nor the repository. I'm thinking a Windows 7 update, or a VS update, or ???

Please help. I need ideas.

Thanks, Brian
Free Tool: ZipGrep
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

I compiled my first app on Linux and I get an error:
./XSDValidator: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./XSDValidator)

Open in new window

I made a check:
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3.4.1

Open in new window

And yes, it is not present. But how this error comes? I use gcc 5.1.0 is this the problem?

The software I compile use xerces-c as depency but this was installed with yum on my machine so I think it will not install things that link against a wrong libstdc++, right?

How to avoid this linking to an wrong libstdc++ ?
Hi, i wish if everyone is having a good day.
However i have an problem in mysql i would like to get the count of ids column in my table and plus 1 to the number how ever when i do like that it types +1 as string for example the result of counting was 3 it will add 3 to 1 like this 31 not 3+1=4 so i don't know how to solve this here's my code :

		String^ constring = L"datasource=...;port=...;username=...;password=..."; // Giving informations to the server
		MySqlConnection^ conDataBase = gcnew MySqlConnection(constring);
		MySqlCommand ^GetCount = gcnew MySqlCommand("Select Count(ID) from newdatabase.my_table;", conDataBase);
		MySqlDataReader^ myReader;
		MySqlCommand ^cmdDataBase;

		try {
			myReader = GetCount->ExecuteReader();
			while (myReader->Read()) {
				int Got = myReader->GetInt32(0);
				cmdDataBase = gcnew MySqlCommand("Insert into newdatabase.my_table (ID) Values ('" + Got+1 + "');", conDataBase);//queries
			myReader = cmdDataBase->ExecuteReader();
		catch (Exception ^Ex) {

Open in new window

Hi i was having some problems in finding the screen width and height how ever i am working on an project and i finally found

Open in new window

but every time i use this function in CLR i am getting this problem :
1>Width.obj : error LNK2028: unresolved token (0A00002E) "extern "C" int __stdcall GetSystemMetrics(int)" (?GetSystemMetrics@@$$J14YGHH@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
1>Width.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall GetSystemMetrics(int)" (?GetSystemMetrics@@$$J14YGHH@Z) referenced in function "int __clrcall main(cli::array<class System::String ^ >^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)

Open in new window

Isn't it supported in Clr ? if yes what i can use instead.
Hello everyone.

I've seen that what I'm trying to do which is monitoring the file IO require the use of Window File System Filter driver and I've also looked into it but was a bit hard to understands especially as I'm not a C++ developer. What I want to achieve is to be able to trap file copy, creation, as well as file sources and destinations, lets say I'm copying a file within my computer I want to get the source path of the file as well as destination path of the file and also the file name as well and if possible with the application that is sending the file.

I saw that this can also inform you if there is file access(opening of file, reading of file) this is very much important to me to also get it if possible while the request of file open is created. I wan to trap this and if the file is one of my file then I want to first work on the requested file first (decrypt).

Thank you.
Hi, Iam new to Linux and I have some problems compiling C++ code there.
A default "Hello World" software works fine. Compile and run well.

But now I want to add another code for XML and it looks like that I do something wrong in my makefile.

I use in my code:
# Build
root := /usr/share/doc/xsd/exmaples

include $(root)/build/cxx/rules.make
include $(root)/build/xsd/tree-rules.make

Open in new window

Bu the make/compiler give me the message that rules.make and other files cannot be found.
Can anyone help and explain what I did wrong?
We just moved from WinINET to WinHTTP. The latter does not have an equivalent InternetCanonicalizeUrl function.

The WinHTTP docs say that WinHTTPOpenRequest does this automatically but there is nothing there that specifically addresses this.

According to this reference you can use WinHTTPCreateURL which uses a URL_COMPONENTS structure to define the various URL parts. In the latter the lpszExtraInfo property is where you put the ?param=xyz& ... part.

Here is my problem - one of the parameters in the paramter string needs to be canonicalized as it could contain non-URL friendly characters (Example &).

With the WinINET version we used InternetCanonicalizeUrl on the specific URL parts which were then appended to the URL string.

If we have a URL now that looks like this
mydomain.com?param='Name & Surname','Description'

Open in new window

And we pass that to WinHTTPOpenRequest - it does not know that the & in Name & Surname is data and not a parameter separator.

How do we canonicalize individual parameters in the URL with WinHTTP
Hi Experts,

         I have a alpha numeric text of length (4096 to 8192)Bytes. I need a compression algorithm to compress and decompress text length upto (128 to 256)Bytes.

I have already tried some compression methods but not able to compress text upto (128 to 256)Bytes .
(eg: Zip.)

To perform this job we need only compression method not hash value.

Thanks In advance
language : c++
(tools : visual studio , acrobat reader)
thanks a lot
I have installed 2 different IDM Ultrium-TD3 tape drives and in the 2nd case, I have ALSO installed the lin_tape and lin_taped (daemon).  I also have sg3_utils 1.42, built from source - all this are on x86_64 bit computers.

Many of the commands work, including sg_read_buffer for reading the cartridge memory.

The problem is, commands such as sg_read_attr/sg_write_attr (ioctl 0x8D, 0x8C) whether from a normal C program or from the sg approach, do not ever allow reading or writing the attributes - instead, it leads to an error, such as:

SG_WRITE_ATT_0803 command error: Host_status=0x05 [DID_ABORT]
Error : Write failed (try verbose opt)

I can try either generic /dev devices or /dev/IBM types of devices.  Each gives an error.  In one case, I have an idea for how to try to fix it, but I'm just wondering, is the firmware (mine is 6B20) just not implementing it?  I doubt that's the problem.  I can upload the firmware as hex code but I would like to see the source.

Also, I don't know whether or not running lintape/lintaped matters and whether or not the IBM-generic/IBM-specific/sg-generic drivers are the issue.  I'm trying to pin down what approach to go on next.  There are literally three sets of drivers.  And I don't know whether or not I should install Tivoli.

Given all the variables, I just want to know how to proceed to get to a working sg_read_attr/sg_write_attr command.  I even tried to start with the lowest numbered attribute.

I have also tried external …
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

I am writing a REST client application using Embarcadero C++ builder Xe10.1 Berlin.
I need to have the REST server IP address configurable.
I have initially set the TRESTClient component BaseURL property to a known server IP address in the IDE. The BaseURL property value is and the application works just fine.
If I add code to change the BaseURL property however, the application doesn't respond and times out ?
Even if I use the value that works when set in the IDE, after the following code is run the application stops working ?

RESTClient1->BaseURL = u"";

Open in new window

Any ideas please ?
	 sql.Format("SELECT * INTO Sicherung_Thomas.dbo.LogBuch_%s FROM OMSDaten.dbo.LogBuch WHERE Zeitstempel>='%s' AND Zeitstempel<='%s'ORDER BY Zeitstempel ASC",str_tmp,str_loeschen_von,str_loeschen_bis);
	 _bstr_t bstrQuery(sql);
  	//Open the recordset object Tabelle 
    m_ptrRs->Open(_variant_t(bstrQuery),(LPCTSTR)m_strConnection, adOpenDynamic, adLockOptimistic, adCmdUnknown);
    //Get a pointer to the record-binding interface Coils
	if(FAILED(m_ptrRs->QueryInterface(__uuidof(IADORecordBinding),(LPVOID *)&m_piAdoRecordBinding)))     _com_issue_error(E_NOINTERFACE);

	   //---------- Any erros? -------------
    	catch (_com_error &e)
			//Display the error
        	GenerateError(e.Error(), e.Description());


	// Do we have a valid pointer to the record binding?
	if(m_piAdoRecordBinding) m_piAdoRecordBinding->Release();       
	//Set the recordset pointer to NULL
	m_ptrRs = NULL;     
	//Shut down the COM environment

void  CDatenbank_Anzeigen_Loeschen_Dialog::GenerateError(HRESULT hr, PWSTR pwszDescription)
	CString strError;
	//Format and display Error Message

Open in new window

Hi :)
This is my first post here and i hope to get an help :)
Anyway let's start with asking my question
my problem was that i only get 1 section name when using getprivateprofilesectionnames function
so i have searched a lot for an solution and i already found an solution but i don't actually understand how that works so could some one explain what's happening in the loop please ?

int main()
	char buffer[4096];
	GetPrivateProfileSectionNames(buffer, 4096, ".//SectionO.ini");

	char* Get = (char*)buffer;
	size_t length = 0;
	int nCnt = 0;
	while (*Get)
		length = strlen(Get);
		cout << nCnt << Get << endl;
		Get += length;
    return 0;

Open in new window

^ this is the code i have found can some one please explain what's happening in the loop ?
thanks guys.
MFC CComboBox won't display wide characters.
I'm using VS 2008, UNICODE is defined in the build and all of the prompts and other strings in the app are coming out fine.
The first try I just added the strings like any combobox and the display and dropdown showed a black line for each
character like the font was wrong.

I tried to SetFont to no avail.

I went to an owner-drawn combo box with no change.
The string shows correctly in the debugger (both in the watch and in the hover box).
the string is "Активна" and, copied from the debugger window,  shows up fine in WordPad.

In DrawItem I did:

      CString fontName;
      CDC dc;

//fontName is "MS Sans Serif" which is is expected and what I am using in the rest of my app and is reported to support Cyrillic.
//The rest is :

      CString thisString;
      GetLBText(lpDrawItemStruct->itemID, thisString);      

//note that at this point,  thisString shows to have the correct string in the debugger

      dc.TextOut(rc.left+iOffsetX, rc.top + iPosY,thisString);      

And I get " ||||||| "  in the combo box (both edit box and dropdown).

      dc.TextOut(rc.left+iOffsetX, rc.top + iPosY,L"TESTSTRING");
works fine.

Any ideas would be helpful...I've been working this way too long.
HOW TO CONVERT * char to string (linha):

const unsigned char
*menino1 = (const unsigned char *)0;

menino1 = p - 17;

string linha = menino[1]+menino[2]+menino[3]+menino[4]+menino[5];
I had this question after viewing C++ COM Method with Optional Arguments.

I am trying to produce a COM object in Visual C++, where one of the methods accepts optional arguments. Below are the interface declaration, the class implementing the interface, and the implementation of the method taking an optional argument. As it stands, it compiles. But when I try to call the function from an ASP page using VBS with the supposedly optional parameter missing, I get the following error

Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: comObject.ShowFinalSql

Following code in IDL
interface IWPharma : IDispatch{
   [id(2), helpstring("method ShowFinalSql")] HRESULT ShowFinalSql([in] BSTR query, [in] BSTR cleanup);

in C++:
    STDMETHOD(ShowFinalSql)(BSTR query, BSTR cleanup) override

in VB with error:
SET comObject = CreateObject("WPharma.Main")

REM Тест #1
comObject.ShowFinalSql "CHECK_SIGNATURES 01/01/2017", ""






C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.