CrazyEngineers
  • how to integrate C or C++ program in Visual basic?

    Updated: Oct 26, 2024
    Views: 1.2K
    How can we integrate some .c or .cpp file in UI made using VB.
    for example i made an identical UI using VB of 'minesweeper' the in-famous game!
    now i want to use my C program to generate 10 random mines and numbers according to mines in UI of minesweeper i made
    say 1st block of my minesweeper UI is array[0][0] according to my C program and if my C program assigns '2' array[0][0] then that mine on clicking must give '2'

    how do i integrate my C program and UI build from VB?
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • greatcoder

    MemberMar 26, 2012

    surbhi bakshi
    How can we integrate some .c or .cpp file in UI made using VB.
    for example i made an identical UI using VB of 'minesweeper' the in-famous game!
    now i want to use my C program to generate 10 random mines and numbers according to mines in UI of minesweeper i made
    say 1st block of my minesweeper UI is array[0][0] according to my C program and if my C program assigns '2' array[0][0] then that mine on clicking must give '2'

    how do i integrate my C program and UI build from VB?
    You may look into Application Programmability Component (APC)
    The APC, a set of APIs on top of the core Visual Basic for Applications API, simplifies the process of integrating Visual Basic for Applications into your application. It is the preferred method of integration. MFC and C++ helper class templates also are included to ease integration in MFC and C++ applications.
    #-Link-Snipped-#

    All the best.
    Are you sure? This action cannot be undone.
    Cancel
  • eemichael83

    MemberMar 29, 2012

    One thing you could try is compiling your c/c++ code into a dll. You can then add a reference to the DLL in your VB project and use the DLLImport statement from the System.Runtime.InteropServices namespace to import the methods/functions into your VB project.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register