Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

trigger a n visual c++ mfc

good day! :WAVE:

I'm a new member of this forum and i'm wondering if you could help me with my problem.

i currently have two programs, one in VB and another in VC++. The first one is a motion detector program that saves a picture in bitmap file whenever a camera detects movement. The other one is an mfc application that decodes a bitmap file (a 2D barcode image) and outputs the data in the file. The idea is that whenever a barcode is inserted in front of a camera, the image is saved into a file. Then the mfc should be triggered to decode that predefined file and return the value to the VB program.

Right now, I manually operate ng mfc application to decode the image file and i want to automate this. Is there a way that VB could call this mfc decoder and accept and store a bit string of data from it? I'm thinking of a boolean in the motion detector VB program. A variable will have initial value of 0. When a card (with the barcode) is inserted and movement is detected the variable is set to 1 and the VB calls the VC++ mfc to decode the image. Then the mfc should return a data which the VB program will fetch. Then after the card is withdrawn (motion detected) the variable will reset to 0.

I hope you can help me with this.

thank you very much in advance. :)
[1335 byte] By [jounin101] at [2007-11-11 7:13:57]
# 1 Re: trigger a n visual c++ mfc
You can use the Shell statement to run the MFC app from the VB app, then use VB's file handling statements (Open, Input, etc.) to read the file produced by the MFC app. For more information on reading files in VB, you may find this page helpful: http://en.wikibooks.org/wiki/Programming:Visual_Basic_Classic/Files
Phil Weber at 2007-11-11 17:27:13 >