Problems in mixed programming of MATLAB and Vc, Using IDL files

Source: Internet
Author: User
Sender: xxhn (Hunan), email area: mathtools

Title: Re: Problems in mixed programming of MATLAB and VC (called Using IDL or DLL)

Mailing site: BBS shuimu Tsinghua station (Tue Aug 19 15:08:50 2003)

Here we provide a method to call COM components through IDL or DLL (you do not need to generate *. h and *. c files)

In fact, this method is simpler than calling by generating the. h and. c files. The example of the essence zone is also used.

1. Use OLE/COM object to generate the IDL file, add this IDL file to the project, and click build-complie.

Comtest_00000.tlb to generate the TLB File

2. Open classwizard, click Add class-from a Type Library class on the right, and select the generated

Comtest_00000.tlb (should be in the debug \ directory). In fact, you can directly choose to use combuilder of Matlab.

The generated comtest_00000.dll (this saves the first step). Some dialog boxes for generating the class will appear later.

Prompt to do it. In this way, comtest_00000.h and comtest_00000.cpp are generated, and an isgltest is added.

Class :)

3. Test Code As follows:

In the header file, you only need to add:

# Include "comtest_00000.h"

Test code:

Isgltest st;

Afxoleinit ();

If (St. createdispatch (_ T ("comtest. sgltest ")))

{

St. im_test ();

Afxmessagebox ("Haha, succeeded ");

St. releasedispatch ();

}

Else

Afxmessagebox ("unsucceeded ");

For the specific meaning of the above Code, see msdn. I just found out :)

[mentioned in the masterpiece promise0608 (promise0608):]
: When I use the COM component, use the Microsoft Visual Studio tool Ole viewer to open the generated component. Find
: Find the DLL file generated by MATLAB com builder and save it as *. h and *. C. An error occurs!
: I use VC. net. I don't know why!
: Please help me!
: Thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.