Thread: make my program start on startup.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Pawn, Pascal and C++
    Join Date
    Sep 2005
    Posts
    90
    Alright why I get errors here?
    I did exactly as it said.

    Code:
    #include <cstdlib>
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    int main()
    {
        char x;
        
        cout << "A) Add this program to startup";
        cout << "B) Exit \n\n";
        
        cin >> x;
        
        if(x == 'a')
        {
            extern "C" BOOL xAddSelfAsStartupShortcut(LPCTSTR szLinkTitle, LPCTSTR szDescription, LPCTSTR szArguments, int IconResourceID);
            xAddSelfAsStartupShortcut(TEXT("My Program"), TEXT("My description"), NULL, -1);
    
            return 0;
        }
        
        if(x == 'b')
        {
             return 0;
        }
        
        else
        {
            cout << "Wrong input! \n\n";
            main();
        }
        
        return 0;
    }
    Pictures:
    I got the startup code added to my project as a .c file
    I got the linker options added to the project
    The errors

    Whats wrong?
    I used anonytmouse's code from his link.
    Last edited by XunTric; 01-11-2006 at 07:51 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Make a program run at startup
    By cookie in forum Tech Board
    Replies: 2
    Last Post: 06-08-2007, 08:36 PM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. how to make my program run on windows start up
    By kantze in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 03-24-2007, 11:14 AM
  4. Programmer Cannot Make Any Program!
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 05-08-2002, 12:48 PM