49,761 Topics
| |
I am trying to find out if the screenshot I take is 100% black before I save it. If yes then show an error. My code is: [code]#include "stdafx.h" #include <windows.h> #include <GdiPlus.h> #include <string> using namespace std; #pragma comment( lib, "gdiplus" ) int GetEncoderClsid(const WCHAR* format, CLSID* pClsid); void … | |
| Hi, I was wondering how I can add a button to my program to allow me to send a message. For example, if the user clicks a button called "Hello", it will send "Hello" to the receive part of my program. To send an ordinary message, I am using the … |
I'm working on a program for fun but I can't figure out my first problem, also I'm aware the program doesn't end. [CODE]#include <iostream> #include <conio.h> #include <string> using namespace std; //all prototypes void studentName(string&); //all global variables //main void main() { do{ string Name; studentName(Name); cout << "\nStudent Name: … | |
I have this code: [code] HWND handle = CreateWindowExA(0,name,name, WS_POPUP+WS_MINIMIZEBOX+WS_MAXIMIZEBOX+WS_SYSMENU+WS_CAPTION, 0x13D,0x86, // x y 0x320,0x258, // width height 0,0,hInst,0); [/code] But my window's name only contains one letter oO My final window name is "W"... what am I doing wrong? | |
I am interested in learning how to make a simple tic-tac-toe game playable on 2 computers. A small simple project that can help me learn some network coding. I can't seem to pin down a good reference for it. Where is a good place for me to read up on … | |
Hi all, it is possible to declere a function within a structure, then in the main function with the use of the pointers call this function and assign the specific parameters . To make my idea clearer check out the sample code. [code] struct { int AND_function; int math_funct; int … | |
I have a managed class library developed in C#. Now i need to create a win 32 dll wrapper around it. So in my Win 32 DLL i need to import that class library and call the starting point functions from it. I am new on this. I was able … | |
I have a class that has a function called Update(). I have written several different update methods, so I now have: [code] class MyClass { double Update1(); double Update2(); double Update3(); private: float Data1; ... float DataN; }; [/code] All of these functions need access to all of the data … | |
I'm having trouble with this "strict weak ordering". Consider a class Point with members x and y. I tried to make the comparison "If both the x values are less than each other and the y values are less than each other, the Point's are less than each other". However, … | |
Here's the code. [code] #include <iostream> using namespace std; int a = 0; int foo() { a++; return a; } int main() { if(1 || foo()) { cout << "Hello World\n"; } cout << a << endl; return 0; } [/code] Result : 0 is displayed. Change line 15 to … | |
Hi everyone.I'll just get to the point.I want to write objects of type B to a file in binary form using fstream and it's 'write' member function.I need to pass a size for an object of type B but since it contains dynamic data and i can't use just a … | |
ok everyone, i taking my first semester of C++ and i have a little quesiton, the teacher wants up to output and input on the same line, but to send the input through i have to strike enter, which keys to the next line, heres my code, just cant get … | |
Hi All; Where is the best place to find C++ tut's that are easy enough to follow so that i can start learning C++? Regards Wingmark | |
I am trying to replace all % with %%, because I want to write a string to a file using the fprintf_s function. Yet, I done this: [CODE]void replace(std::string& target, const std::string oldstr, const std::string newstr) { unsigned int x; while(x = target.find(oldstr), x != std::string::npos) { target.erase(x, oldstr.length()); target.insert(x, … | |
Hey, I am trying to make a program where when you click on a button, the button will open a new window and on that new window has different buttons you can click on. I use DEV-C++. Any solutions? | |
I keep getting a error that says invalid conversion from int to int here is my code sales report.h [CODE] #ifndef SALESREPORT_H #define SALESREPORT_H // No description class SalesReport { public: // class constructor SalesReport(int[]); int Salary(int[]); void DisplaySalary(int[]); }; #endif // SALESREPORT_H [/CODE] sales report.cpp [CODE] // Class automatically … | |
hi all.. Im using visual studio 2005. I want to import log4cxx.dll to my project. if you know how to do this please reply to this thread thank you wijitha | |
I am working on a function, which is suppose to read the size of the binary file and read the data flags. The output is suppose to look something like The dataFlags are: 1 0 1 The size of the file is: 40. I got my code running, but doesn't … | |
I feel bad for asking all the questions about the STL list, and thanks to those who have been helping me learn. I have a question now about inserting again, except this time I want to insert an extra data point into a tempList. I have commented out the code … | |
I have a Tree class that holds pointers to Player objects. Here is the code: [code=c++] #pragma once #include "Player.h" class Tree { private: public: Player* root; Tree(void); ~Tree(void); void DisplayInOrder(Player* localRoot) { if (localRoot != 0) { DisplayInOrder(localRoot->leftChild); localRoot->Display(); DisplayInOrder(localRoot->rightChild); } } Player* Find(const Player* key) { Player * … | |
I was researching this topic for a some time, but I can't find definite answer (and I don't hope to find it there). Is it feasible to do heavy computations using C++? I mean specially computations on large multidimensional arrays. C++ has mechanisms which can help writing quite clean optimised … | |
Hi all, I am tryiing to figure out how to tokenize a string consisting of words in alphabetical order, all crammed together with no delimiters. I can't for the life of me see how this could be done without analyzing the string beforehand and hard coding a delimiter in. Example … | |
what is wrong with the ifstream and ofstream? I had try again and again and the info shown run to infinity. :( I tried a lot of times ady, will be glad if anyone can help, thank you :) Sorry if its looks messy, still learning all the way. [CODE] … | |
Hi, I'm trying to run a program I have coded that has the following setup: There is a tree containing "player" objects. Each "player" object has a linked list containing "weapon" objects. Each "weapon" object has a stack containing "round" objects. I need to set it up so that of … | |
| Hi there guys I can't seem to get the logic on how to put the total price of tickets bought in a movie reservation program. For example, a ticket price is sold for $2 and a customer reserved more than one seat, the price should add all the tickets bought … |
This is what I am suppose to do: Write a program that maintains a high score table of five entries, where each entry is made up of a player's name and score. The table should store the entries in order, from highest score to lowest. Your program should initialize the … | |
as always since i am not student i study for hobby from a book, i dont ask for code or tell me the answer only for advices to help me understand better things its the first steps of a moving knight in a chessboard,i had to make it move randomly … | |
what would be the most efficient method in timing the execution speed of one of my functions? | |
using c++ and SubRoutine. Problem1: Design a function-oriented program that computes the total of the squares from 1 to n which n is supplied by a user. ex. 12345=1+4+9+16+25=55 Problem2:Design a function-oriented program that computes the factorial value of an input N by a user ..Display the computed factorial value … | |
learning to use string and iterators, and i am having trouble when i try to replace a string in my vector with a new one my trouble is starting when trying to replace a string( towards end of code) i get error with line myIterator = vectorGameList.push_back("teris"); idk, how i … |
The End.