matthieuvb Posted June 30, 2010 Share 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] Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 30, 2010 Share Posted June 30, 2010 What compiler are you using? Link to comment Share on other sites More sharing options...
matthieuvb Posted June 30, 2010 Author Share Posted June 30, 2010 (edited) 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] Link to comment Share on other sites More sharing options...
Bert Posted June 30, 2010 Share 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/ Link to comment Share on other sites More sharing options...
matthieuvb Posted June 30, 2010 Author Share Posted June 30, 2010 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] Link to comment Share on other sites More sharing options...
Kip Posted June 30, 2010 Share 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. Link to comment Share on other sites More sharing options...
matthieuvb Posted June 30, 2010 Author Share Posted June 30, 2010 (edited) 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?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.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] Link to comment Share on other sites More sharing options...
Kip Posted June 30, 2010 Share Posted June 30, 2010 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. Link to comment Share on other sites More sharing options...
matthieuvb Posted June 30, 2010 Author Share Posted June 30, 2010 (edited) 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] Link to comment Share on other sites More sharing options...
Authenticity Posted June 30, 2010 Share 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 Link to comment Share on other sites More sharing options...
matthieuvb Posted June 30, 2010 Author Share 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] Link to comment Share on other sites More sharing options...
wraithdu Posted June 30, 2010 Share 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. Link to comment Share on other sites More sharing options...
Bert Posted June 30, 2010 Share Posted June 30, 2010 I told him to read a book and he ignored it. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
E1M1 Posted July 1, 2010 Share 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 Link to comment Share on other sites More sharing options...
matthieuvb Posted July 1, 2010 Author Share Posted July 1, 2010 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] Link to comment Share on other sites More sharing options...
matthieuvb Posted July 1, 2010 Author Share Posted July 1, 2010 (edited) 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] Link to comment Share on other sites More sharing options...
taietel Posted July 1, 2010 Share 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: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
matthieuvb Posted July 1, 2010 Author Share Posted July 1, 2010 (edited) 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] Link to comment Share on other sites More sharing options...
E1M1 Posted July 1, 2010 Share 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 Link to comment Share on other sites More sharing options...
matthieuvb Posted July 1, 2010 Author Share 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.OK, thanks for the tip. [font=Helvetica, Arial, sans-serif][background=rgb(252, 252, 250)][/background][/font] Link to comment Share on other sites More sharing options...
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