Foxtable(狐表)用户栏目专家坐堂 → 请教 调用dll 具体得代码


  共有2935人关注过本帖树形打印复制链接

主题:请教 调用dll 具体得代码

帅哥哟,离线,有人找我吗?
xa139
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:282 积分:2835 威望:0 精华:0 注册:2019/4/23 11:17:00
请教 调用dll 具体得代码  发帖心情 Post By:2019/12/26 15:22:00 [显示全部帖子]

用matlab  生成的dll  文件名 fcs2txt.dll 已经复制到foxtable目录下.
matlab定义如下 
function [fcsdat, fcshdr, fcsdatcomp] = fcs2txt(filename)
请问 在foxtable 中 调用的具体步骤 帮助中 代码看不大明白
<dllImport("kernel32. dll", CharSet:=CharSet. Ansi, CallinConvention:=CallingConvention. Cdecl)
Public Function fcs2txt(ByVal InString As String) As Integer 
End Function
标红的这段不知道怎么改


 回到顶部
帅哥哟,离线,有人找我吗?
xa139
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:282 积分:2835 威望:0 精华:0 注册:2019/4/23 11:17:00
  发帖心情 Post By:2019/12/26 15:47:00 [显示全部帖子]

Dim iRetUSB As Integer
    
iRetUSB = fcs2txt("f:\r.fcs")
是这样调用吗?
执行提示
fcs2txt是一个命名空间,不能用作表达式。
错误代码:iRetUSB=fcs2txt("f:\r.fcs")
 

 回到顶部
帅哥哟,离线,有人找我吗?
xa139
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:282 积分:2835 威望:0 精华:0 注册:2019/4/23 11:17:00
  发帖心情 Post By:2019/12/26 16:10:00 [显示全部帖子]

以下是引用有点蓝在2019/12/26 16:04:00的发言:
调用说明文档发上来看看
fcs2txt MATLAB .NET Assembly (.NET Component)

1. Prerequisites for Deployment 

Verify that version 9.5 (R2018b) of the MATLAB Runtime is installed.   
If not, you can run the MATLAB Runtime installer.
To find its location, enter
  
    >>mcrinstaller
      
at the MATLAB prompt.
NOTE: You will need administrator rights to run the MATLAB Runtime installer. 

Alternatively, download and install the Windows version of the MATLAB Runtime for R2018b 
from the following link on the MathWorks website:

    http://www.mathworks.com/products/compiler/mcr/index.html
   
For more information about the MATLAB Runtime and the MATLAB Runtime installer, see 
"Distribute Applications" in the MATLAB Compiler SDK documentation  
in the MathWorks Documentation Center.

2. Files to Deploy and Package

-fcs2txt.dll
   -contains the generated component using MWArray API. 
-fcs2txtNative.dll
   -contains the generated component using native API.
-This readme file
    Note: if end users are unable to download the MATLAB Runtime using the
    instructions in the previous section, include it when building your 
    component by clicking the "Runtime included in package" link in the
    Deployment Tool.


Auto-generated Documentation Templates:

MWArray.xml - This file contains the code comments for the MWArray data conversion 
              classes and their methods. This file can be found in either the component 
              distrib directory or in
              <mcr_root>*\toolbox\dotnetbuilder\bin\win64\v4.0

fcs2txt_overview.html - HTML overview documentation file for the generated component. It 
                        contains the requirements for accessing the component and for 
                        generating arguments using the MWArray class hierarchy.

fcs2txt.xml - This file contains the code comments for the fcs2txt component classes and 
                        methods. Using a third party documentation tool, this file can be 
                        combined with either or both of the previous files to generate 
                        online documentation for the fcs2txt component.


3. Resources

To learn more about:               See:
===================================================================
MWArray classes                    <matlab_root>*\help\toolbox\
                                   dotnetbuilder\MWArrayAPI\
                                   MWArrayAPI.chm  
Examples of .NET Web Applications  Web Deployment in the MATLAB   
                                   .NET Assembly documentation in the  
                                   MathWorks Documentation Center


4. Definitions

For information on deployment terminology, go to
http://www.mathworks.com/help and select MATLAB Compiler >
Getting Started > About Application Deployment >
Deployment Product Terms in the MathWorks Documentation
Center.

* NOTE: <mcr_root> is the directory where the MATLAB Runtime is installed on the target 
        machine.
        <matlab_root> is the directory where MATLAB is installed on the target machine.


 回到顶部
帅哥哟,离线,有人找我吗?
xa139
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:282 积分:2835 威望:0 精华:0 注册:2019/4/23 11:17:00
  发帖心情 Post By:2019/12/26 16:23:00 [显示全部帖子]

fcs2txt Assembly Description

 

This assembly was created using MATLAB .NET Assembly. The public class methods included in this assembly allow access to the MATLAB functions specified during compilation.

 

IMPORTANT: What you need to use this assembly successfully:

 

MATLAB Runtime

 

MATLAB Runtime is a collection of native libraries that are required to execute the MATLAB functions. Consequently, the MATLAB Runtime must be installed on any machine that runs a MATLAB .NET Assembly generated component. If you install MATLAB, MATLAB Compiler or MATLAB .NET Assembly, you have access to the MATLAB Runtime automatically.  Otherwise, you must install the MATLAB Runtime by running the MCRInstaller executable.  Note: This assembly is only compatible with version 9.5 of the MATLAB Runtime.

 

Please contact the provider of this assembly for specific details about the MATLAB Runtime.

 

 

MWArray.dll

 

This assembly, which can be found in <mcr_root>\toolbox\dotnetbuilder\bin\win64\v4.0, provides classes that act as the bridge between your application and the MATLAB Runtime.  Note: The fcs2txt assembly, generated by MATLAB .NET Assembly, will only work with an MWArray assembly that was built against the same version of the MATLAB Runtime.

 

The MWArray class hierarchy provides methods to create and access the MATLAB data types used by the MATLAB Runtime.  All of the classes derive from the abstract MWArray class and each of the derived classes, with the exception of MWIndexArray which is also abstract, maps to a MATLAB data type.  The data conversion class hierarchy includes;  MWNumericArrayMWLogicalArrayMWCharArrayMWStructArray, and MWCellArray.   Each class has properties and methods that can be used to query various attributes of the class such as the number of dimensions, dimension size, element size, field names etc.  

 

These classes can be explicitly instantiated and used as arguments to the MATLAB .NET Assembly generated class methods.  Where applicable, a native .NET primitive or array type can also be used as an input parameter that will be implicitly converted to the appropriate MWArray type.


 回到顶部
帅哥哟,离线,有人找我吗?
xa139
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:282 积分:2835 威望:0 精华:0 注册:2019/4/23 11:17:00
  发帖心情 Post By:2019/12/26 16:23:00 [显示全部帖子]

fcs2txt MATLAB .NET Assembly (.NET Component)

1. Prerequisites for Deployment 

Verify that version 9.5 (R2018b) of the MATLAB Runtime is installed.   
If not, you can run the MATLAB Runtime installer.
To find its location, enter
  
    >>mcrinstaller
      
at the MATLAB prompt.
NOTE: You will need administrator rights to run the MATLAB Runtime installer. 

Alternatively, download and install the Windows version of the MATLAB Runtime for R2018b 
from the following link on the MathWorks website:

    http://www.mathworks.com/products/compiler/mcr/index.html
   
For more information about the MATLAB Runtime and the MATLAB Runtime installer, see 
"Distribute Applications" in the MATLAB Compiler SDK documentation  
in the MathWorks Documentation Center.

2. Files to Deploy and Package

-fcs2txt.dll
   -contains the generated component using MWArray API. 
-fcs2txtNative.dll
   -contains the generated component using native API.
-This readme file
    Note: if end users are unable to download the MATLAB Runtime using the
    instructions in the previous section, include it when building your 
    component by clicking the "Runtime included in package" link in the
    Deployment Tool.


Auto-generated Documentation Templates:

MWArray.xml - This file contains the code comments for the MWArray data conversion 
              classes and their methods. This file can be found in either the component 
              distrib directory or in
              <mcr_root>*\toolbox\dotnetbuilder\bin\win64\v4.0

fcs2txt_overview.html - HTML overview documentation file for the generated component. It 
                        contains the requirements for accessing the component and for 
                        generating arguments using the MWArray class hierarchy.

fcs2txt.xml - This file contains the code comments for the fcs2txt component classes and 
                        methods. Using a third party documentation tool, this file can be 
                        combined with either or both of the previous files to generate 
                        online documentation for the fcs2txt component.


3. Resources

To learn more about:               See:
===================================================================
MWArray classes                    <matlab_root>*\help\toolbox\
                                   dotnetbuilder\MWArrayAPI\
                                   MWArrayAPI.chm  
Examples of .NET Web Applications  Web Deployment in the MATLAB   
                                   .NET Assembly documentation in the  
                                   MathWorks Documentation Center


4. Definitions

For information on deployment terminology, go to
http://www.mathworks.com/help and select MATLAB Compiler >
Getting Started > About Application Deployment >
Deployment Product Terms in the MathWorks Documentation
Center.

* NOTE: <mcr_root> is the directory where the MATLAB Runtime is installed on the target 
        machine.
        <matlab_root> is the directory where MATLAB is installed on the target machine.


 回到顶部
帅哥哟,离线,有人找我吗?
xa139
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:282 积分:2835 威望:0 精华:0 注册:2019/4/23 11:17:00
  发帖心情 Post By:2019/12/26 16:24:00 [显示全部帖子]

我英文不大好 ,看不太明白

 回到顶部