In order to invoke in the plug-in. NET control, or through. NET Library to develop plug-ins, I need the interface description file (Interface Description file), which describes the file. NET program, we can call the interface in this DLL through the IDF (interface description file) in C + +.
The C + + plug-in recognizes such an interface description file and can see all the interface description information in the Plugins manager. For example, there are the following interface description file contents in BTradePrice.DLL:
<?xml version= "1.0" encoding= "GB2312"?>
<methods >
<method name=tradeprice.custprice.showpricedialog (int ntradecustomerid description= This is the function that displays the price/>
<method name=tradeprice.custprice.showcustomerinfo (int nbtradecustomerid) description= This is a function to display customer information/>
</Methods>
In C + + plug-ins, the interface function CString GETIDF () can be used to obtain the content of interface description file, and the interface function bool Executenetmethod (CString Smethod) is implemented. NET interface is called.
use bool Isclrplugin () to determine if the plug-in is a CLR type.
This requires adding three functions to the plug-in base class, and in the base class you can determine whether the plug-in's corresponding XML configuration exists, and if so, whether it is defined. NET Plug-in library.
<?xml version= "1.0" encoding= "GB2312"?>
<Setting>
<ClrPlugin>BTradePrice.DLL</ClrPlugin>
</Setting>
If there is a BTradePrice.DLL, you need to call a function from the Btradeprice BTradePrice.NDKPlugin.IsNDKPlugin () function to determine whether it is a plug-in, Returns an IDF string (XML format) via BTradePrice.NDKPlugin.GetIDF ()
In this way, through. NET development plug-ins just create a DLL and add the following two functions to it:
Ndkplugin.isndkplugin ()
NDKPLUGIN.GETIDF ()
You can implement functions in the. NET library that are called in C + +. However, how do Windows messages in C + + pass to the. NET plug-in? This requires that window messages be forwarded to the. NET plug-in in the base class of the C + + plug-in.
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.