921 Posted Topics
Re: Try this: [CODE] [COLOR="Red"]FORMNAME[/COLOR] ^myform = gcnew [COLOR="Red"]FORMNAME[/COLOR](); myform->ShowDialog(); [/CODE] | |
Re: Here is how I learn Win32 API, It is a very good tutorial: [URL="http://www.rohitab.com/discuss/index.php?act=Attach&type=post&id=698"]http://www.rohitab.com/discuss/index.php?act=Attach&type=post&id=698[/URL] | |
| |
Re: Have you tried adding [CODE=CPP]using namespace std;[/CODE] before defining the [B]Dot[/B] class ? | |
Re: Give form2 a topmost value so it always appears above other windows, or open it as a dialog (you wont be able to use form1 until form2 is closed). | |
| |
Re: I put togeather an example to show you how to read words and compare them with each other, mabey this can get you started. [CODE=CPP]#include<iostream> #include<sstream> using namespace std; int main() { stringstream str("word1 word2 word1 word word1 word2"); string match = "word2"; string word; int count = 0; while … | |
Re: Yep, there was a discussion on that not so long ago on the last few posts. [url]http://www.daniweb.com/forums/thread130222.html[/url] | |
Re: I personally think you would be able to start Win32 GUI programming. Its really not that hard to learn, it just takes time. A good place to start would be most common Win32 tutorial on the web.. :P [url]http://www.winprog.org/tutorial/start.html[/url] But just incase, the main things you need to know about … | |
Re: I say do your own dirty work, don't try and get other people involved in cheating.. :angry: | |
Re: The variable [B]fin[/B] is destructed before you use it. For this to work you would have to arrange it slightly differently. [CODE]switch( choose ) { case 1: // Constructor that opens the file ifstream fin("madlip1.txt"); // If statement to check if the file can be opened or not. if( !fin … | |
Re: I found this code on the web some time ago and saved it. It seems to do exactly what you want :) Heres a quick example of how to save the top left corner of the screen. [CODE=CPP]#include<iostream> #include<windows.h> using namespace std; inline int GetFilePointer(HANDLE FileHandle){ return SetFilePointer(FileHandle, 0, 0, … | |
Re: Communication with other applications isn't very difficult, the hardest part is just finding the window and the rest is easy. Here is an example which opens [B]notepad.exe[/B], gets its handle and sends the message [B]WM_KEYDOWN[/B] a few times. [CODE=CPP]#include<windows.h> HWND notepad = NULL; BOOL CALLBACK WindowEnumProc(HWND hwnd, LPARAM lParam) { … | |
Re: What about the datatype [B]__int8[/B], is that guaranteed to be 8-bit? Because it seems to act exactly as a char and would be abit misleading otherwise. | |
Re: First, you have to load the image using a function like [URL="http://msdn.microsoft.com/en-us/library/ms532309.aspx"]LoadBitmap[/URL] (may only work for [B].bmp[/B]) or [URL="http://msdn.microsoft.com/en-us/library/ms648045(VS.85).aspx"]LoadImage[/URL], and using some GDI functions like [B]GetPixel[/B] you can retrieve a pixel from its HDC. You will probably want to look at a tutorial on GDI before trying this. | |
Re: I think you need Visual Studio 2005 at least to do .NET applications. Download visual Studio 2008 express version here. [url]http://www.microsoft.com/express/download/#webInstall[/url] | |
Re: Its very simple to do. All you need is one function that converts an integer to a 3 bit binary number. If fact, its so simple I will give it to you :) [CODE=CPP] #include <iostream> #include <ctime> using namespace std; void toBin(int num, char *lpStr, int len) { lpStr[len] … | |
Re: Seems to be good :) Only problem I had was that I had to include <ctime> in order to compile it. | |
Re: that is because the function [B]atoi[/B] isn't for converting a [B]char[/B] to an [B]int[/B], it converts a string (char array) to an [B]int[/B]. If you want to convert a [B]char[/B] to an [B]int[/B] you need to type cast. for example: [CODE=CPP] char a = 'z'; int num = (int) a; … | |
Re: To be honest, I dont think he cares anymore.. His last activity was on Jun 5th, 2007. | |
Re: Well, you didn't really specify your problem, but this might solve your problem. :) [CODE] // function example #include <iostream> #include <string> using namespace std; int addition (int a, int b) { int r; r=a+b; return (r); } int main () { string mystring2; string mystr; int z; z = … | |
Re: [QUOTE=tesuji;632471]hey, you may try recursive function baseb: [code=c++] void baseb(int b, string fi, unsigned int nb, string &f){ int p = nb % b; nb = nb / b; if ( nb > 0) baseb(b, fi, nb, f); f=f+fi[p]; } int main(){ int b = 16, nb = 2008; string … | |
Re: The reason you got 46 twice there isn't because the random number happends to be the same, its because you are printing the same variable twice without modifying it. If you want to make it so each number can only come up once, you have to make an array for … | |
Re: It seems a bit pointless to have double the amount of cases than you actually need. [CODE] //when user inputs a char.. char classChoice; cin>> classChoice; switch([COLOR="Red"]tolower[/COLOR](classChoice)) { case 'w': cPtr = new Character(/*Warrior stats here*/); break; case 'm': cPtr = new Character(/*Mage stats here*/); break; default: cout << "Improper … | |
Re: Try this, I haven't read it yet.. but its supposed to be good. :icon_mrgreen: [url]http://beej.us/guide/bgnet/[/url] | |
Re: Im not sure why, but I had a go at making this and succeeded but im not going to give you the solution to it, so you can at least have a go at it yourself. But I will tell you how I managed it. [LIST=1] [*]I made two function, … | |
Re: [QUOTE]You're not very quick, are you?[/QUOTE] I see what you mean :D [QUOTE]So your telling me what is being displayed on my windows screen is the output of a C++ program?[/QUOTE] Most probably. | |
Re: Because a local object will destruct at the end of the code block / function and therefore you will be returning an invalid reference. | |
Re: You are missing the null terminator at the end, but that shoulden't explain why its outputting the address of [ICODE]t[/ICODE]. The correct way to do it would be like this: [CODE=CPP] char trig [10] = "cos(50)"; //declare and assign the char array "trig" char t [4]; //declare char array t … ![]() | |
Re: Isn't it just: [CODE=CPP]binaryImage->Save("binaryImage.bmp");[/CODE]??? | |
Re: This is what you do when your bored ?! I suggest you try learning the Win32 API to be able to make proper window applications, and then mabey move on to MFC when you get the hang of that. From there you should be able to make basic games / … | |
Re: I cant even see the quick reply box because you posted so much code... ![]() | |
Re: [QUOTE=Sky Diploma;627852]Yes , If you are using Windows As An OS. YOU CAN TRY [code] system(cls); [/code] To Clear the whole thing up and then a printer function added in.[/QUOTE] I guess you ment [CODE]system("cls")[/CODE] | |
Re: I suggest you get yourself a good book on C++ because it looks like you have no idea what your doing in some places :icon_neutral: You should also learn to format your code better, you have about 10 empty lines near the end and your indentation is messed up. I … | |
Re: In addition to what [B]niek_e[/B] sead, you could make things easier by using some windows macros. [CODE=CPP] #include<windows.h> #include<iostream> using namespace std; int main(){ /*max 65535 (= sizeof(unsigned int) /2) */ unsigned int i = 2222; unsigned int j = 1111; unsigned int combined = MAKELONG(i, j); cout << LOWORD(combined) … | |
Re: On line 11 and 19 you cannot compare a char string using the [B]==[/B] operator. Instead use [B]strcmp[/B] [url]http://www.cplusplus.com/reference/clibrary/cstring/strcmp.html[/url]. Line 11: [CODE]if((argv[i] == "-h" | argv[i] == "--help" ) && help != 1)[/CODE] Should be: [CODE]if ((strcmp(argv[i], "-h") == 0) | (strcmp(argv[i], "--help") == 0)&&help != 1)[/CODE] Do the same … | |
Re: It would have been much more practical if you had attached the many pages of code... But just a few mistakes / tips: [LIST=1] [*]Dont use [ICODE]system("pause")[/ICODE] : [url]http://www.gidnetwork.com/b-61.html[/url] [*]In your switch statement [ICODE]switch (move)[/ICODE] you have including double the amount of cases than you actually need, just define it … | |
Re: Please Use code tags, It makes reading it so much easier :) | |
Re: [QUOTE]Wow, I cant believe I couldnt find that online myself. Thanks its exactly what I needed.[/QUOTE] Yep, I dont even think [B]Ancient Dragon[/B] looked online for that site :icon_wink: But try this tutorial, I think it will help you. [url]http://winprog.org/tutorial/start.html[/url] | |
Re: You could also make it so you dont have to manually set the array size like this: (Assuming your not dynamically allocating the array) [CODE=CPP] int nums[] = {324, 5462, 2}; int average = 0; short arraySize = sizeof(nums) / sizeof(*nums); for (short i = 0; i < arraySize; i++) … | |
Re: Set yourself a challenge like making a function to determine wheather or not a number is a prime. If you get stuck, use google to figure out your problem. :icon_lol: | |
Re: Because you havent formatted your code very well, you missed out a curly bracket during your switch statement. I have formatted and made the following corrections for you: [CODE=CPP] /*------------------------------------------------------------------ * Assignment 7: FIRST LINKED LIST ASSIGNMENT. *Worth: 50 points *Made by: Samuel Georgeo (max11) create an in-memory SERIALLY linked-list … | |
Re: You have left alot of space between lines, and you shouldent use [B]system("pause")[/B] ([url]http://www.gidnetwork.com/b-61.html[/url]) | |
Re: [QUOTE]i dont know how to make array on a function...[/QUOTE] :icon_idea: Ever heard of google? | |
Re: You will have to create another bitmap and use [B]BitBlt[/B] to copy the data to it, more info here. [url]http://msdn.microsoft.com/en-us/library/aa930997.aspx[/url] | |
Re: This might not help with your exact problem, but don't use [B]void main()[/B] as [B]Salem[/B]'s avatar will clearly show you :) | |
Re: 3 Threads posting the same problem.. ? Doesn't anybody try to do their homework by themselves anymore ?? You could have all helped eachother with it and you would figured out the problem in no time. :P |
The End.