CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    1

    I need help compiling this code.

    I have never tried programming, and I'm suing Visual Studio 2010.

    I get these errors:



    This is the code:


    // feditspawn.cpp : Defines the entry point for the console application.
    //

    #include "stdafx.h"
    #include <process.h>

    #include "dinput.h"

    IDirectInput8 *id8;
    IDirectInputDevice8 *idid;
    LPDIRECTINPUTDEVICE did;
    LPUNKNOWN punkOuter=NULL;

    int main(int argc, char* argv[])
    {
    //id8=new IDirectInput8;
    // did=(LPDIRECTINPUTDEVICE) new BYTE[32768] /*DIRECTINPUTDEVICE */;
    // did=(LPDIRECTINPUTDEVICE)idid;

    CoInitializeEx(NULL,COINIT_MULTITHREADED);
    CoCreateInstance(CLSID_DirectInput8, punkOuter, CLSCTX_INPROC_SERVER, IID_IDirectInput8W, (void**)&idid);

    // id8->Initialize(,DIRECTINPUT_VERSION);

    id8->CreateDevice(GUID_SysKeyboard,&idid,NULL);

    idid->SetCooperativeLevel(NULL,DISCL_FOREGROUND /*DISCL_BACKGROUND*/ | DISCL_EXCLUSIVE);

    printf("swapwning FEDIT\n");
    _spawnl( _P_WAIT, "FEDIT.EXE", "FEDIT.EXE", "", "", NULL );
    return 0;
    }


    If it's not too much trouble could someone please compile it quickly and upload the exe? Otherwise can you help me do it?

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: I need help compiling this code.

    Quote Originally Posted by Griduser64 View Post
    I have never tried programming
    Yet the code you posted contains lines commented out. Who commented out those lines? If you never tried programming, why would there be any lines commented out? Only a person who has tried programming would make edits to the code like that.
    If it's not too much trouble could someone please compile it quickly and upload the exe? Otherwise can you help me do it?
    And if this program doesn't work, then what?

    Programming is much more than just compiling and getting an EXE. If the program doesn't work, who is going to debug it?

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured