Hi everyone,
I am trying to call SAP Gui from a VS2010 C# Windows Forms Application. Below follows my C# source code describing the way i am trying to do it :
...
using SAPFEWSELib;
...
static classProgram
{
///<summary>
/// The main entry point for the application.
///</summary>
[STAThread]
staticvoid Main()
{
//
// Create the GuiApplication object
//
try
{
SAPActive.SapGuiApp = new GuiApplication(); // <--- But at this point, i get the error message!
}
catch (Exception ex) // Here i trap the error and display the message.
{
}
}
}
Visual Studio Error Message : Retrieving the COM class factory for component with CLSID {B90F32AD-859E-4EDD-BFAE-C9216849520C} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
The setup of my programming environment is as follows :
> Windows 7, 64 bit Operating System
> Visual Studio 2010
> .NET 4.0
> SAP Gui Client 7.2
As i have searched extensively in many blogs and red a banch of opinions, none of these solved the problem.
Here is a list of checkings which i have already tried, but still with no success to solve the problem.
1. I have checked the Windows Registry. All SAP keys seem to be in place. Especially the key (Class) B90F32AD-859E-4EDD-BFAE-C9216849520C
is registered.
2. I have checked the Project Settings in VS 2010 for this project. They are all properly set for an x86 bit machine.
3. The only one .ocx file which I am currently using in my (VS Project) References is sapfewse.ocx. I have found and added this file as a Reference in my project from the directory C:\program files(x86)\sap\frontend\sapgui\sapfewse.ocx.
Does anyone have an idea what might be the cause of the problem or give me a clue what to search? Is this a problem with the version of the Active X Control which i am using (i.e x86/x64)? Am i missing a file as a reference in the using section of the project or is it a matter of access rights?
Many thanks in advance.