matthieuvb Posted June 30, 2010 Posted June 30, 2010 I try to make a messagebox in c++, but it does not work!int main() { MessageBox(NULL, "hello", "this is a test", MB_OK); }And where can i find this libraries?#include <iostream> #include <windows.h>can someone help me to make a good script and learn c++?Tanks! [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
matthieuvb Posted June 30, 2010 Author Posted June 30, 2010 (edited) On 6/30/2010 at 10:01 AM, 'Richard Robertson said: What compiler are you using?No idea:)stupid!where can i find a good compiler? Edited June 30, 2010 by Matthieuautoitscripter [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
Bert Posted June 30, 2010 Posted June 30, 2010 You insult yourself....nice..... did you even bother to read the sticky in this forum concerning books? The Vollatran project My blog: http://www.vollysinterestingshit.com/
matthieuvb Posted June 30, 2010 Author Posted June 30, 2010 On 6/30/2010 at 11:12 AM, 'Volly said: You insult yourself....nice.....did you even bother to read the sticky in this forum concerning books?no.where can I find?i heave search for example scripts, for iostream and windows.h, and i try it again,but if i press F11 then i see this message:where can i find iostream and windows.h?and how I let my script work? [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
Kip Posted June 30, 2010 Posted June 30, 2010 Can you understand english? Because F11 is "Step Into", and you expect us to help you based on that screenshot. Do you even understand what that dialog says? MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
matthieuvb Posted June 30, 2010 Author Posted June 30, 2010 (edited) On 6/30/2010 at 12:36 PM, 'Kip said: Can you understand english?Because F11 is "Step Into", and you expect us to help you based on that screenshot. Do you even understand what that dialog says? On 6/30/2010 at 12:36 PM, 'Kip said: Do you even understand what that dialog says?yes, there are errors with compile and if you like it to run the latest compiled version. On 6/30/2010 at 12:36 PM, 'Kip said: Can you understand english?i am 12 years old, but i can a little bit english.do i something wrong? Edited June 30, 2010 by Matthieuautoitscripter [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
Kip Posted June 30, 2010 Posted June 30, 2010 On 6/30/2010 at 12:52 PM, 'Matthieuautoitscripter said: do i something wrong?Maybe hitting F5 from now on would be better.You could start with posting the actual errors. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
matthieuvb Posted June 30, 2010 Author Posted June 30, 2010 (edited) On 6/30/2010 at 12:57 PM, 'Kip said: Maybe hitting F5 from now on would be better. You could start with posting the actual errors. This are the errors: 1>------ Build started: Project: TestMessageBox, Configuration: Debug Win32 ------ 1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup 1>C:\Users\matthieu_2\documents\visual studio 2010\Projects\TestMessageBox\Debug\TestMessageBox.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== And if i press F5: same result Edited June 30, 2010 by Matthieuautoitscripter [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
Authenticity Posted June 30, 2010 Posted June 30, 2010 (edited) You've chose Win32 GUI project type so you need to use the Win32 GUI main procedure, or create a Win32 Console project.Win32 GUI main procedures should look like:int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { // Code return 0; }or:INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) { // Code return 0; }In Win32 Console project, the main procedure should look like:int main(int argc, char* argv[]) { // Code return 0; } Edited June 30, 2010 by Authenticity
matthieuvb Posted June 30, 2010 Author Posted June 30, 2010 (edited) Wait, it works in Dev-C++!And i heave the libraries now!With this code:#define _WIN32_DCOM #include <iostream> #include <windows.h> #include <stdio.h> using namespace std; int main(){ MessageBox(NULL, "hoi", "Test", 0); }but does not work in C++.Tanks all!PS: But how add an icon to the compiled version? Edited July 1, 2010 by Matthieuautoitscripter [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
wraithdu Posted June 30, 2010 Posted June 30, 2010 I'm sorry, do I really have to be the first one to tell this kid to go read a book? There's a thread with suggestions. Come back when you have some fundamental knowledge, cause right now you don't, and it's a waste of everyone's time.
Bert Posted June 30, 2010 Posted June 30, 2010 I told him to read a book and he ignored it. The Vollatran project My blog: http://www.vollysinterestingshit.com/
E1M1 Posted July 1, 2010 Posted July 1, 2010 (edited) Why don't you use AutoIt? it's easier than C++. If you start learning you should choose easy language to start like AutoIt. C and asm should not be your first languages. When I was 12 i started with Turbo Pascal then my next language was Rapid-Q and then there was 2 years pause until i found AutoIt. After all this I still find C++ bit hard because it doesn't have such good help like Autoit has. Edited July 1, 2010 by E1M1 edited
matthieuvb Posted July 1, 2010 Author Posted July 1, 2010 On 7/1/2010 at 6:41 AM, 'E1M1 said: Why don't you use AutoIt? it's easier than C++. If you start learning you should choose easy language to start like AutoIt. C and asm should not be your first languages.When I was 12 i started with Turbo Pascal then my next language was Rapid-Q and then there was 2 years pause until i found AutoIt.After all this I still find C++ bit hard because it doesn't have such good help like Autoit has.i use autoit too, its very easy! [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
matthieuvb Posted July 1, 2010 Author Posted July 1, 2010 (edited) On 6/30/2010 at 6:47 PM, 'Volly said: I told him to read a book and he ignored it. ???I don't have a book about C++! Edited July 1, 2010 by Matthieuautoitscripter [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
taietel Posted July 1, 2010 Posted July 1, 2010 Matthieu, here is a good place to start! Things you should know first...In the beginning there was only ONE! And zero... Progs: Reveal hidden contents Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text
matthieuvb Posted July 1, 2010 Author Posted July 1, 2010 (edited) On 7/1/2010 at 8:05 AM, 'taietel said: Matthieu, here is a good place to start! Thanks! i have a simple code with mesageboxes, and it works: #include <iostream> #include <windows.h> int main() { if (MessageBox(NULL, "Press a button.", "Test messagebox", MB_OKCANCEL) == IDOK) { MessageBox(NULL, "You pressed OK.", "Test messagebox", MB_OK); } else { MessageBox(NULL, "You pressed CANCEL.", "Test messagebox", MB_OK); } }Code in AutoIt: If MsgBox(1, "Press a button.", "Test messagebox") = 1 Then MsgBox(1, "You pressed OK.", "Test messagebox") Else MsgBox(1, "You pressed CANCEL.", "Test messagebox") EndIfI have only one question now: how compile your c++ script with an icon? Edited July 1, 2010 by Matthieuautoitscripter [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
E1M1 Posted July 1, 2010 Posted July 1, 2010 Never tried it. You gotta add ico as resource file. Notepad 2 is open source projec. you can learn from there. there are also hacks out there to add icons in already compiled exes but it might make your exes not work or piss off antivirus or what ever it might do. I have searched for this like year ago, and i didn't find how to add icon. edited
matthieuvb Posted July 1, 2010 Author Posted July 1, 2010 On 7/1/2010 at 10:23 AM, 'E1M1 said: Never tried it. You gotta add ico as resource file. Notepad 2 is open source projec. you can learn from there.there are also hacks out there to add icons in already compiled exes but it might make your exes not work or piss off antivirus or what ever it might do.I have searched for this like year ago, and i didn't find how to add icon.OK, thanks for the tip. [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now