How do I create a BaaN interface in C#?

余生长醉 提交于 2020-01-25 00:15:26

问题


What is the best way to create an interface to the BaaN MRP system?

I'm looking for a way to use C# to create an interface to update the inventory at the ERP.


回答1:


You need to add a com reference to /baan/bin/bw.tlb
(Ole Automation Baan Type Library)




回答2:


object Baan = null ;
Type t;
t = Type.GetTypeFromProgID("Baan4.Application.someuser");
Baan = Activator.CreateInstance(t);
object[] Parameters = new Object[1];
Parameters[0] = 3600;

//Baan.Timeout = 3600;
Baan.GetType().InvokeMember("Timeout", 
                            BindingFlags.SetProperty, 
                            null, 
                            Baan, 
                            Parameters
);

Parameters = new Object[2];
Parameters[0] = "otccomdll...";
Parameters[1] = "function.name...";
Baan.GetType().InvokeMember("ParseExecFunction", 
                             BindingFlags.InvokeMethod, 
                             null, 
                             Baan, 
                             Parameters
);
//your code here    
//Baan.Quit();
Baan.GetType().InvokeMember("Quit", BindingFlags.InvokeMethod, null, Baan, null);


来源:https://stackoverflow.com/questions/4971056/how-do-i-create-a-baan-interface-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!