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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Possible to link to different projects together?

Possible to link to different projects together?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
9 Posts 4 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
    rover_boy
    wrote on last edited by
    #1

    I'm new to Visual C++ and am creating a windows form application. I was wondering if it was possible to link a console application which is written in C but stored in C++ files to a windows form? So for example if I clicked a button in the Windows Form application then this would run the console application?

    I H 2 Replies Last reply
    0
    • R rover_boy

      I'm new to Visual C++ and am creating a windows form application. I was wondering if it was possible to link a console application which is written in C but stored in C++ files to a windows form? So for example if I clicked a button in the Windows Form application then this would run the console application?

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      Didn't you ask this question an hour or so ago? If so, this time it makes more sense. In your onclick event handler, you can use CreateProcess or ShellExecute to run the console program. Iain.

      R 1 Reply Last reply
      0
      • R rover_boy

        I'm new to Visual C++ and am creating a windows form application. I was wondering if it was possible to link a console application which is written in C but stored in C++ files to a windows form? So for example if I clicked a button in the Windows Form application then this would run the console application?

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        It seems that you need to ShellExecute for run other applications of your program.(anyway you didnt answer to my reply on your previous question ;) ).

        R 1 Reply Last reply
        0
        • H Hamid Taebi

          It seems that you need to ShellExecute for run other applications of your program.(anyway you didnt answer to my reply on your previous question ;) ).

          R Offline
          R Offline
          rover_boy
          wrote on last edited by
          #4

          Thanks for the help I might not need to do that if I can solve the error LNK1152

          H 1 Reply Last reply
          0
          • I Iain Clarke Warrior Programmer

            Didn't you ask this question an hour or so ago? If so, this time it makes more sense. In your onclick event handler, you can use CreateProcess or ShellExecute to run the console program. Iain.

            R Offline
            R Offline
            rover_boy
            wrote on last edited by
            #5

            Thanks for the reply before you replied I just got the error LNK1152 so not sure if I should try to solve this or use the ShellExecute

            D 1 Reply Last reply
            0
            • R rover_boy

              Thanks for the reply before you replied I just got the error LNK1152 so not sure if I should try to solve this or use the ShellExecute

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

              rover_boy wrote:

              ...I just got the error LNK1152...

              Please explain.

              "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              R 1 Reply Last reply
              0
              • D David Crow

                rover_boy wrote:

                ...I just got the error LNK1152...

                Please explain.

                "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                R Offline
                R Offline
                rover_boy
                wrote on last edited by
                #7

                I have client class written in C saved into C++ files. This class is to connect to a server. I want to use this code which connects to the server in my GUI which is created using windows forms. I have added Additional Dependencies to the windows form project. The problem is when I include these .cpp code files to the windows form project I get the error LNK1152. I also get warning messages: "This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use CRT_SECURE_NO_WARNINGS" I'm looking into ShellExecute to solve my problem

                D 1 Reply Last reply
                0
                • R rover_boy

                  I have client class written in C saved into C++ files. This class is to connect to a server. I want to use this code which connects to the server in my GUI which is created using windows forms. I have added Additional Dependencies to the windows form project. The problem is when I include these .cpp code files to the windows form project I get the error LNK1152. I also get warning messages: "This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use CRT_SECURE_NO_WARNINGS" I'm looking into ShellExecute to solve my problem

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

                  rover_boy wrote:

                  I get the error LNK1152.

                  Again, be specific. We're not mind readers.

                  rover_boy wrote:

                  I'm looking into ShellExecute to solve my problem

                  Then you will likely need to remove the aforementioned code as it would no longer be needed.

                  "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  1 Reply Last reply
                  0
                  • R rover_boy

                    Thanks for the help I might not need to do that if I can solve the error LNK1152

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    Did you get this error when you used of ShellExecute?

                    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