49,761 Topics

Member Avatar for
Member Avatar for Legend32A

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 …

Member Avatar for WolfPack
0
504
Member Avatar for mjv89

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 …

Member Avatar for WolfPack
0
74
Member Avatar for DaniwebOS

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: …

Member Avatar for jonsca
0
124
Member Avatar for lelejau

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?

Member Avatar for lelejau
0
156
Member Avatar for MasterGberry

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 …

Member Avatar for MasterGberry
0
80
Member Avatar for boschow

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 …

Member Avatar for asa22
0
154
Member Avatar for chintan_1671

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 …

Member Avatar for chintan_1671
0
259
Member Avatar for daviddoria

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 …

Member Avatar for mike_2000_17
0
106
Member Avatar for daviddoria

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, …

Member Avatar for daviddoria
0
224
Member Avatar for VernonDozier

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 …

Member Avatar for Ancient Dragon
0
171
Member Avatar for caut_baia

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 …

Member Avatar for Labdabeta
0
646
Member Avatar for stompjrkz400

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 …

Member Avatar for Labdabeta
0
281
Member Avatar for wingmark

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

Member Avatar for Labdabeta
0
108
Member Avatar for Legend32A

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, …

Member Avatar for Legend32A
0
97
Member Avatar for thecoolman5

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?

Member Avatar for thecoolman5
0
432
Member Avatar for bkoper16

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 …

Member Avatar for jonsca
0
769
Member Avatar for wijithapaw

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

Member Avatar for sgollapu
0
1K
Member Avatar for Frostyyy

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 …

Member Avatar for jonsca
0
124
Member Avatar for atticusr5

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 …

Member Avatar for GDICommander
0
186
Member Avatar for kutuup

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 * …

Member Avatar for kutuup
0
121
Member Avatar for Zjarek

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 …

Member Avatar for mike_2000_17
0
203
Member Avatar for maikens

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 …

Member Avatar for pseudorandom21
0
235
Member Avatar for Alice1990

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] …

Member Avatar for Ancient Dragon
0
181
Member Avatar for kutuup

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 …

Member Avatar for kutuup
0
216
Member Avatar for FrancisLazo

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 …

Member Avatar for FrancisLazo
0
117
Member Avatar for jmcorpse

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 …

Member Avatar for triumphost
0
182
Member Avatar for ntrncx

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 …

0
82
Member Avatar for lochnessmonster

what would be the most efficient method in timing the execution speed of one of my functions?

Member Avatar for Narue
0
45
Member Avatar for zxzniczxz

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 …

Member Avatar for hag++
0
147
Member Avatar for lgonzo

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 …

Member Avatar for lgonzo
0
166

The End.