Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.979.449 Times

Calling MFC from mex functions 1.0

  Date Added: September 06, 2013  |  Visits: 205

Calling MFC from mex functions

Report Broken Link
Printer Friendly Version


Product Homepage
Download (18 downloads)

I recently had a requirement to make MFC calls within a mex function. After looking around I was unable to find a single example, so I had to develop my own. Hopefully this will make the job easier for you. The procedure is actually pretty easy once you know how. This discussion assumes that you already know how to write mex functions and are famliar with MFC.This simple demo creates a mex function called "mexDemo", which passes a single number as an argument. This data is then displayed in a dialog box. The user can modify the number and then hit "OK". This new value is then returned to MATLAB.First, in order to process MFC messages you need a CWinApp class. Because both the mex Function and the CWinApp class require their own dll entry point, I couldn't find a way to put them both in the same file, so I had to create two separate dll's, the mex function and the actual MFC dll.The demo contains three files. "mexDemo" defines the mex funtion. This simply takes the value passed in, calls the dialog, and then returns the new value.The file "mexDialogDemo" defines the CWinApp class. To create this class simply create a new project by selecting "MFC AppWizard (dll). You can choose either static or dynamic linking. I choose static so that the MFC code will be self-contained.The file "mexDialog" defines the dialog and is the most important part since this provides the interface to the mex function. This dialog was added to the mexDialogDemo program like any other dialog would be.Access to the dialog is provided through an export function call "mexDialog", which in turn brings up the dialog. This intermediate function is required because the mex function cannot directly call the dialog.This export function must be declared as a C callable dllexport function:#ifdef __cplusplusextern "C"{#endif__declspec (dllexport) float mexDialog (float data){ CmexDialog dlg; dlg.m_data = data; data = dlg.m_data; return data;}#ifdef __cplusplus}#endifThis function must also be declared within the mex function, but this time it is declared as an import function:#ifdef __cplusplusextern "C"{#endif__declspec (dllimport) float mexDialog(float data);#ifdef __cplusplus}#endifThis dll function is called from within the mex function just like any other function:data2 = mexDialog (data1);

Requirements: No special requirements
Platforms: Matlab
Keyword: Dynamic Important Interface Linking Quotmexdialogquot Selfcontained
Users rating: 0/10

License: Shareware Size: 30.72 KB
CALLING MFC FROM MEX FUNCTIONS RELATED
File Management  -  Web Media Gallery for File sharing 0.5
Web Media Gallery is a dynamic Web interface to share and display photos, images and video. It is developped in PHP and uses XML to give information on documents.The purpose of WebMG is to provide an easy to install and to use web tool to share...
40.96 KB  
Audio Tools  -  tunequeue 0.03
tunequeue is a web based internet radio station control software; both a dynamic listener interface and an administrative interface. tunequeue includes features like: multiple channels, user requests and ratings of songs, several types of queuing...
91.14 KB  
Modules  -  opengrid_ui 6.x-1.x-de
Opengrid UI provides a dynamic jquery interface for configuring the layout of themes based on the Opengrid fixed/flexible grid, base theme. This module presently works only with the Opengrid theme and is useless unless used along with this...
20.48 KB  
Utilities  -  PHPhiler 0.3.0
PHPhiler is a PHP4-driven dynamic filesystem interface for websites. It generates a directory and file index with all the relevant info (link, title, description, size, etc.) and displays it in a CSS-based table. Please see the project's website...
26.72 KB  
Multimedia & Graphics  -  EasyCatalog CS5 5.0.1
EasyCatalog CS5 is a database publishing add-on for Adobe InDesign CS4 that provides dynamic, two-way linking of data from a CSV file to text or images in InDesign documents. Optional modules add import from an XML structure, ODBC database, or...
4.8 MB  
File Management  -  Web Media Gallery 0.5
Web Media Gallery is a dynamic Web interface to share and display photos, images and video. It is developped in PHP and uses XML to give information on documents. The purpose of WebMG is to provide an easy to install and to use web tool to share...
 
Libraries  -  C::DynaLib 0.55
C::DynaLib is a Perl interface to C compiled code. SYNOPSIS use C::DynaLib; use sigtrap; # recommended $lib = new C::DynaLib( $linker_arg ); $func = $lib->DeclareSub( $symbol_name [, $return_type [, @arg_types] ] ); # or $func =...
35.84 KB  
Libraries  -  GPS::Babel 0.0.1
GPS::Babel is a Perl interface to gpsbabel. SYNOPSIS use GPS::Babel; my $babel = GPS::Babel->new(); # Read an OZIExplorer file into a data structure my $data = $babel->read(route.ozi, ozi); # Convert a file automatically choosing input...
10.24 KB  
Utilities  -  PersonalBrain Mac 26.8M
Dynamic mind mapping software that lets you work the way you think. See and do more with PersonalBrain's dynamic user interface and advanced linking software. Organize ideas, projects, contacts, files, and Web pages associatively to capture your...
 
Networking  -  Groupon Widget 0.1.4
This plugin allows you to syndicate Groupon's daily deals on your site. It also allows you to enter your Groupon referral code in order to get Groupon bucks for any of your visitors that you send to Groupon. Plugin comes with an admin interface...
10 KB  
NEW DOWNLOADS IN SCRIPTS, DEVELOPMENT TOOLS
Scripts  -  Freelancer Script 5.05
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Post projects. Featured projects. Private projects. Sealed projects. Edit/delete projects. Select freelancers....
5.49 MB  
Scripts  -  B2B Script 4.20
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Sign-up Account (Registration of account). Lead generation tools (for the sellers). Email verification to...
5.49 MB  
Scripts  -  B2C Script 5.06
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). The script comes with totally editable site colors, icons and graphics Multilevel categories allows extensive browsing Admin can change Category ordering or...
5.49 MB  
Scripts  -  Social Networking Script 2.86
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Registration with name, email, password, date of birth etc. User can add multiple school, college, university with start...
5.49 MB  
Scripts  -  Business Networking Script 8.04
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Ajax based interface. Profile creation. Different types of profile. Profile for jobseekers, employers and employed...
5.49 MB  
Development Tools  -  VMP Viewer 1.0
This is a very rudimentary tool to visualize the VMP files generated by BrainVoyager. Useful to share files with people who do not have BV.
10 KB  
Development Tools  -  Sending reports and timestamped file by emailing 1.0
main executing reference usage:[1] usage_send_mail.mIllustrates email sending with multiple separate files or single timestamped tar file. Attachment failure is properly handled, with continuation of report emailing without the attachment.[2]...
768 KB  
Development Tools  -  IrisMVC 2.0 rc1
IrisMVC is an OOP PHP framework that developers can use as a strong and secure foundation to build on various web applications following the Model-View-Controller (MVC) pattern. It provides the basic functionality developers need, without...
51.2 KB  
Development Tools  -  7-Zip for Script 4.42
7-Zip is a file archiver with a high compression ratio.Features:- High compression ratio in new 7z format with LZMA compression- Supported formats:- Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR- Unpacking only: RAR, CAB, ISO, ARJ, LZH, CHM,...
624.64 KB  
Development Tools  -  Barnardextest 1.0
This file, as the Fisher's exact test, performs the exact probability test for a table of frequency data cross-classified according to two categorical variables, each of which has two levels or subcategories (2x2). It is a non-parametric...
10 KB