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

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?

Replies

  • greatcoder
    greatcoder
    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.
  • eemichael83
    eemichael83
    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.

You are reading an archived discussion.

Related Posts

All the Adobe employees will now have a reason to make their friends not working in Adobe jealous of them. The company says that it wants to abolish the age...
ELECTRONICS ENGINEERS: I NEED A PASSIVE ELECTRO-MAGNETOTELLURIC DETECTION (EMT) PLATFORM You must be an electronics engineer to work on my project. You must understand all theories and principles about this...
Can someone help me with ideas on design and fabrication of an Automated sheet metal rolling machine that can sense the length of a sheet metal.
Hi everybody, I would need some help on that one. A magneto-meter is connected via a serial port to matlab and actually everything works fine, EXCEPT that, if the data...
I've just started on this new line of action and thought it well to fill everyone in. Android is growing immensely and I must say, we need to be at...