Click here to Skip to main content
15,919,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MSFLXGRD problem in 64bit machine (MFC/C++) Pin
«_Superman_»28-Jan-09 22:32
professional«_Superman_»28-Jan-09 22:32 
GeneralRe: MSFLXGRD problem in 64bit machine (MFC/C++) Pin
raesa28-Jan-09 23:13
raesa28-Jan-09 23:13 
GeneralRe: MSFLXGRD problem in 64bit machine (MFC/C++) Pin
«_Superman_»28-Jan-09 23:50
professional«_Superman_»28-Jan-09 23:50 
GeneralRe: MSFLXGRD problem in 64bit machine (MFC/C++) Pin
raesa29-Jan-09 0:35
raesa29-Jan-09 0:35 
GeneralRe: MSFLXGRD problem in 64bit machine (MFC/C++) Pin
«_Superman_»29-Jan-09 1:28
professional«_Superman_»29-Jan-09 1:28 
GeneralRe: MSFLXGRD problem in 64bit machine (MFC/C++) Pin
raesa29-Jan-09 18:21
raesa29-Jan-09 18:21 
QuestionCalling a function from another program Pin
Tom Hubin28-Jan-09 21:17
Tom Hubin28-Jan-09 21:17 
AnswerRe: Calling a function from another program Pin
Stuart Dootson28-Jan-09 22:14
professionalStuart Dootson28-Jan-09 22:14 
Presuming you're using Visual C++...

You want to use __declspec(dllexport) to define functions that are exported from the DLL and are thus callable from any other program (including the camera program). The best way to use it is like this:

  1. Declare the DLL's exported functions in a header file (note - replace THIS_FILE_H with some text representing the headers actual filename - THIS_FILE_H represents 'ThisFile.h'):
    #ifndef __THIS_FILE_H__
    #define __THIS_FILE_H__
    
    #ifndef PLUGIN_API
    #define PLUGIN_API __declspec(dllimport)
    #endif
    
    PLUGIN_API int DoSomething(int aParameter);
    
    #endif // __THIS_FILE_H__

  2. Add a .cpp file to the plugin DLL project which defines the functions (DoSomething in this case) you've exported. You need the following two lines in that file, BEFORE you define any of the functions (note: replace 'ThisFile.h' with whatever you called the header file in the previous step):
    #define PLUGIN_API __declspec(dllexport)
    #include "ThisFile.h"
  3. In the camera program, #include the header in the .cpp file where you want to call the plugin's functions. You also need to link the plugin's export library (a .lib file) to the camera program.


This page[^] has several useful links.
GeneralRe: Calling a function from another program Pin
Tom Hubin29-Jan-09 19:06
Tom Hubin29-Jan-09 19:06 
GeneralRe: Calling a function from another program Pin
Tom Hubin29-Jan-09 19:25
Tom Hubin29-Jan-09 19:25 
GeneralRe: Calling a function from another program Pin
Stuart Dootson29-Jan-09 23:22
professionalStuart Dootson29-Jan-09 23:22 
GeneralRe: Calling a function from another program Pin
Tom Hubin30-Jan-09 11:18
Tom Hubin30-Jan-09 11:18 
GeneralRe: Calling a function from another program Pin
Stuart Dootson31-Jan-09 0:00
professionalStuart Dootson31-Jan-09 0:00 
AnswerRe: Calling a function from another program Pin
«_Superman_»28-Jan-09 22:14
professional«_Superman_»28-Jan-09 22:14 
QuestionHow can set UP and DOWN arrow in header of CListCtrl? [modified] Pin
Le@rner28-Jan-09 19:39
Le@rner28-Jan-09 19:39 
AnswerRe: How can set UP and DOWN arrow in sorted column in CListCtrl? Pin
SandipG 28-Jan-09 19:45
SandipG 28-Jan-09 19:45 
AnswerRe: How can set UP and DOWN arrow in header of CListCtrl? Pin
Stuart Dootson28-Jan-09 21:57
professionalStuart Dootson28-Jan-09 21:57 
Questionhow to force paint a view in MFC. Pin
VC++Maniac28-Jan-09 19:24
VC++Maniac28-Jan-09 19:24 
AnswerRe: how to force paint a view in MFC. Pin
SandipG 28-Jan-09 19:42
SandipG 28-Jan-09 19:42 
AnswerRe: how to force paint a view in MFC. Pin
CPallini28-Jan-09 21:08
mveCPallini28-Jan-09 21:08 
GeneralRe: how to force paint a view in MFC. Pin
nitin328-Jan-09 21:53
nitin328-Jan-09 21:53 
QuestionRe: how to force paint a view in MFC. Pin
Nishad S28-Jan-09 22:16
Nishad S28-Jan-09 22:16 
GeneralRe: how to force paint a view in MFC. Pin
Hamid_RT29-Jan-09 1:03
Hamid_RT29-Jan-09 1:03 
GeneralRe: how to force paint a view in MFC. Pin
CPallini29-Jan-09 2:15
mveCPallini29-Jan-09 2:15 
JokeRe: how to force paint a view in MFC. Pin
prasad_som28-Jan-09 23:25
prasad_som28-Jan-09 23:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.