Page 2 of 2 First 12
  • Jump to page:
    #16
  1. Cast down
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    321
    Rep Power
    12
    You have program A: when user runs it, the user can type in info like name/age/location.. etc, when user presses `ok`, program A opens up another program, lets say program B, and at the END of that program, it writes what the user put, like "john22california".

    Program B: when this program is ran, it will read the last X number of bytes, and then print out that info..

    problems with that:
    program B needs to know how many bytes to read.. one thing you can do is, reserve the last 6 bytes, to store the # of bytes written, so in the bottom of program B.. itll look like "john22california000016" program B will read the last 6 bytes, and get "000016".. and then it reads 16 bytes before the last 6 and that's the info.

    You can store program B inside a resource.
  2. #17
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    25
    Rep Power
    0
    ok. so how can i execute the program out from the resource?
  4. #18
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    16
    Rep Power
    0
    I'm done here.
  6. #19
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    25
    Rep Power
    0
    Anyone can help? By the way, how to write the program to disk from memory?
    Last edited by rickykoh1983; September 1st, 2003 at 09:43 PM.
  8. #20
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    25
    Rep Power
    0
    This is part of my code:

    HANDLE hExe;
    HRSRC hRes;
    HRSRC hResLoad;
    char *lpResLock;

    hExe = LoadLibrary("Locker.EXE");
    hRes = FindResource(hExe, "IDD_EXE1", RT_RCDATA);
    hResLoad = LoadResource(hExe, hRes);
    lpResLock = LockResource(hResLoad);

    HANDLE hFile = CreateFile(_T("C:\\Testing.EXE"),
    GENERIC_WRITE, FILE_SHARE_READ,
    NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

    CFile myFile(hFile);
    myFile.Write(lpResLock, lstrlen(lpResLock));
    myFile.Close();

    What is wrong with this code?
  10. #21
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    25
    Rep Power
    0
    Is it that no one wants to help?
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo