Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Change hard-coded variables from Outside

Change hard-coded variables from Outside

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RedDragon2k
    wrote on last edited by
    #1

    Hello, How can I change a hard-coded variable from another program with my program ? For example: Program A has this definition: CString strTmp = "This is a Test"; somewhere in it's code. And now I want with my program to change this variable to "This is another Test". How could I realize this ? With best regards, Benedikt

    D J 2 Replies Last reply
    0
    • R RedDragon2k

      Hello, How can I change a hard-coded variable from another program with my program ? For example: Program A has this definition: CString strTmp = "This is a Test"; somewhere in it's code. And now I want with my program to change this variable to "This is another Test". How could I realize this ? With best regards, Benedikt

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      You can open the file (as binary) with Visual Studio and search for the string literal. You can't, however, make it any longer.


      "The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli

      1 Reply Last reply
      0
      • R RedDragon2k

        Hello, How can I change a hard-coded variable from another program with my program ? For example: Program A has this definition: CString strTmp = "This is a Test"; somewhere in it's code. And now I want with my program to change this variable to "This is another Test". How could I realize this ? With best regards, Benedikt

        J Offline
        J Offline
        jc0dex
        wrote on last edited by
        #3

        Hello, First off one quick question ... with the simplicity of scripts why go thru all the trouble to change hard coded varibles? A simple text file and a text parser is like magic sometimes :) But as for changing hard coded variables, maybe putting the variable on its own thread and using a mutex would work. Or alternatively you could make one program take key input then use Shell Extensions to run that program inside another program and give it input from the second program. Just a couple of random, probably nonsensical ideas, hope that helps :) Jay

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups