on 07-11-2018 4:59 AM
Hi Experts:
I have question about the DIAPI Installation.
If we need to use x64 bit DIAPI in our .net solution, do we need to install the x86 DIAPI into the machine as well?
We always get this exception when we run the x64 solution on the machine which only install the x64 DIAPI.
Unhandled Exception: System.InvalidCastExcetion: Unable to cast COM object of type 'System.__Comobject' to interface type 'SAPbobsCOM.Company'.
The problem will disappear when we install the x86 DIAPI.
Does that mean we need to install x86 DIAPI no matter the CPU type we selected?
I will attach our testing code. I have build the program as x64 and referenced x64 bit DIAPI
class Program
{
static void Main(string[] args)
{
SAPbobsCOM.Company company = new SAPbobsCOM.Company();
company.UserName = "manager";
company.Password = "manager";
company.CompanyDB = "SBODEMOUS";
company.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_HANADB;
company.SLDServer = "10.179.1.41:40000";
company.Server = "10.179.1.41:30015";
int lRetCode = company.Connect();
if (lRetCode != 0) // if the connection failed
Console.WriteLine(company.GetLastErrorDescription());
else
Console.WriteLine("Connection opened");
Console.Read();
}
}
// Error occurred when program started.
Thanks
Jeanne
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.