49,761 Topics
| |
Hi Dw. I have a question of how can one detect a program attempting execute/run and also most importantly how to allow/deny programs to execute/run. I'm sure we all have came across with UAC where it ask you to allow or deny that program from running, normally this for elevating … | |
[Linux] When using gcc and or g++ is there a way I can have two output files, one with and one without debugging symbols in one gcc/++ command? I don't want to have to write `g++ --Wall program.cpp -o program`, then have to immediately run `g++ --Wall -g program.cpp -o … | |
i know get the windows taskbar HWND: HWND GetDesktopToolBar() { return FindWindow("Shell_Traywnd", ""); } now i can do: 1 - add controls on left side(close to Start Button)... but the click messages isn't working. maybe because use the form messages procedure. can anyone correct me?; 2 - enable\visible it. but, … | |
Hi ! I am trying to do a game for children to test their attention. So I have two images and they have to find out the differences between the images. How can I open the image on c++? I also have a specie of questionair to see how many … | |
i'm changind the standard messagebox for add more options. using the hook procedure, i can center to it's parent and the text too. and i added a checkbox(without a window procedure). my question: how can i get the checkbox state? i use SetWindowsHookEx() with WH_CBT flag. can i use with … | |
heres my function for convert to client using RECT: void ScreenToClient(HWND WindowDestination, RECT *WindowRectangle) { POINT a={WindowRectangle->right, WindowRectangle->bottom}; WindowRectangle->left=0; WindowRectangle->top=0; ::ScreenToClient(WindowDestination,&a); WindowRectangle->right=a.x; WindowRectangle->bottom=a.y; } maybe have some errors too :( void Center() { RECT frm,frmparent; GetWindowRect(GetParent(hwnd), &frmparent); ScreenToClient(GetParent(hwnd),&frmparent); GetWindowRect(hwnd, &frm); ScreenToClient(hwnd,&frm); LONG x=frmparent.right/2 - (frm.right-frm.left)/2; LONG y=100; SetWindowPos(hwnd,0,x,y,0,0, SWP_NOSIZE | … | |
I am trying to calculate the angle between two vectors. Here is my relevant code: cout << "\n\nPoint1 "; Point1.dump(); cout << "Point2 "; Point2.dump(); cout << "\nanswer: " << Point1.dot(Point2) << endl; cout << "\nacos: " << acos(-1)<< endl; cout << "Problem: " << acos(Point1.dot(Point2)) << endl; cout << … | |
I am a computer hardware technician. And I want to create some programs to use in job. I think it would be more efficient in time. I can use C++ programming language but not perfectly. So I need some helps from you. I want to write some programs with C++ … | |
I recently came accross this code: Mat3D R_z(double RotAngle) { const double S = sin (RotAngle); const double C = cos (RotAngle); Mat3D U; U.m_Mat[0][0] = +C; U.m_Mat[0][1] = +S; U.m_Mat[0][2] = 0.0; U.m_Mat[1][0] = -S; U.m_Mat[1][1] = +C; U.m_Mat[1][2] = 0.0; U.m_Mat[2][0] = 0.0; U.m_Mat[2][1] = 0.0; U.m_Mat[2][2] = … | |
I'm working on exception handling. Here is my code, I need some help.. Requirements: => If the user push a value to stack when stack is full,it must throw an exception of type "cInvalidPush". => If the user pop a value from stack when stack is empty , it must … | |
Write a C++ program to help a cashier person when returning change to the customer. Your program should read two real numbers: the amount of required money and the amount of paid money. The program outputs the change that should be returned to the customer. Your program should display appropriate … | |
Hi All, I am trying some experiments with pthread scheduling policies. I have a couple of apps and within all these apps, I set the thread policy to SCHED_RR and I set the priority to MAX - 1. Now, I see that the CPU utilization as reported by top for … | |
Hi all! Whenever I am working with my code in my main.cpp file, I can call character-handling functions like * isdigit * isalpha * isspace * toupper without importing the `cctype` library. However, my C++ How to Program Book shows that the cctype library must be imported before the functions … | |
#include<iostream.h> #include<conio.h> int main(void) { void hello() { cout<<"HI"; } getch(); return 0; } I am getting an error at line 6 stating that declarartion syntax error. What do I do? | |
Okay so let me start by saying I have a pretty decent c++ base and very advanced logic skills. So whatever help you will have to provide will probably be minimal. So here's my problem: I've been trying to figure out the best way to organize all my Magic: The … | |
Hello all! I am trying to take a string that has mixed uppercase and lowercase chars and then convert it to lowercase. I am doing the following line of C++ code: transform(theReadMessage.begin(),theReadMessage.end(),theReadMessage.begin(),theReadMessage.end(),::tolower); //theReadMessage is a string to convert to lowercase and my C++ xCode debugger gives me this message `Too … | |
Hi! I don't know how to assign my unique_ptr a new value. std::unique_ptr<int> intPtr; void changePointer(int* ptr) { // I want intPtr to point to ptr // intPtr = ptr; } What should I do? Thanks. | |
Hi I have encountered a problem where I cannot think of a solution. I'm attempting to work with event tracing but the problem is that a handle is not released even when the program exit, and the API appears such that once it is opened or started, it is closed … | |
Hi I am trying to do a game to children so they can notice the difference between to images and study how their memory atention etc are. I want to open the image, and make a questionair where I say if the child was able to find one two three … | |
I have a large piece of code : string num_to_text[] = { "", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" }; string tens_to_text[] = { "", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" }; string power_to_text[] … | |
#include <iostream> #include <stdlib.h> #include <cstring> #include <stack> using namespace std; #define MAX_CHARS 100 int main(int argc, char* argv[]) { char input_str[MAX_CHARS + 1], *p; stack<double> num_stack; int c; double a, b, n; cout << "Enter RPN string: "; cin.getline(input_str, MAX_CHARS); p = strtok(input_str, " "); while(p) { c = … | |
I have four files in c++ 1. BankAccount.h 2. BankDatabase.h 3. Main.cpp BankAccount.h #include <string> class BankAccount { public: BankAccount(int accNumber,const std::string& accName); void setAccNumber(const int accNumber); int getAccNumber() const; void setAccName(const std::string& clientName); std::string getAccName() const ; protected: int mAccNumber; std::string mAccName; }; BankAccount::BankAccount(const int accNumber, const std::string& accName):mAccNumber(accNumber),mAccName(accName){} … | |
I have four files in c++ 1. BankAccount.h 2. BankDatabase.h 3. Main.cpp //BankAccount.h #include <string> class BankAccount { public: BankAccount(int accNumber,const std::string& accName); void setAccNumber(const int accNumber); int getAccNumber() const; void setAccName(const std::string& clientName); std::string getAccName() const ; protected: int mAccNumber; std::string mAccName; }; BankAccount::BankAccount(const int accNumber, const std::string& accName):mAccNumber(accNumber),mAccName(accName){} … | |
Hi All, In below code snippet i am getting segmentation fault. Could you let me know what can be cause. usually we will face segmentation fault if auto_ptr is used due to ownershpt issue (Assignee pointer becomes NULL) but why i am facing the same issue with unique_ptr move semantics. … | |
I'm tring to develope newcamd virtual server i have read the newcamd protocol documentation there is some missed Points the newcamd protocol uses 3des encryption 112bit CBC Mode point one : what is the padding mode?? point two : what is the vector key?? another thing for example i spyed … | |
Declare a class (i.e., a type) called CArea and an object (i.e., a variable) of this class called obj. This class contains four members: two data members of type int (member x and member y) with private access and two member functions with public access: set_values() and area(). Calculate the … | |
Hi, I am trying to create a vector of a class which contains ofstream object as one of its member. The problem I am facing is that when I add single element to the vector, it work fine. As soon as I add another element to the vector, it changes … | |
The heating system in a school should be switched on if the average temperature is less than 17 degrees Celsius. The average temperature is found from the temperatures in the art English and music departments. You are required to write a C++ program that allows the user to input 3 … | |
Given a collection of towns in Borneo, Your task is to design a program using C++ programming language to find a way to visit all the towns and return to the starting point by minimising the distance travelled. Please note that each town can be visited only once, except for … |
The End.