Adding Interop.RAMDATAACCESSLib.dll to a native x64 process?

Hello,

I was wondering if anybody had experience adding this .COM dll into a native x64 process. I am trying to transfer information from our RAM model to another software that is native to x64.  Since the RAM .dll is a .COM 32bit based .dll, I am receiving this error: 

Retrieving the COM class factory for component with CLSID {831DA20F-FE64-4A33-B24F-25CEE81939DC} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

My target platform is locked on x64 in order to run the app, so I can't use x86 platform.  It is not a standalone application so I cannot enable 32 bit interop. I did not have any success registering for COM interop either. I have googled around and figured I would ask if anybody else had a solution to this.

Thanks,

Norm

  • Hello Norm,

    If it is a native x64 process (and not a .NET process) using the 64 bit RAMDataAccess.dll (installed and registered in directory "Program Files\Common Files\Bentley\Engineering\RAMDataAccess_2_0") itself through a CoCreateInstance() call should work. See the "RAM DataAccess Developers Guide" pdf file installed in the "Program Files\Bentley\Engineering\RAM Structural System\manuals" directory for examples. 

    C++ Syntax would be something like this: 

    IRamDataAccess1* m_pRDA;

    HRESULT hr = CoCreateInstance(CLSID_RamDataAccess1,NULL,CLSCTX_INPROC_SERVER,IID_IRamDataAccess1,(void**) &m_pRDA);

    Greg

  • Sorry for the misleading info, I am working on a .Net plugin on a 64 bit application, native in x86 (always get confused by that). My RAM SS files are located in Program Files(x86)\Common Files\Bentley\Engineering\RAMDataAccess_2_0.  Does this mean RAM is installed as 32 bit and I should reinstall as 64 bit?  I am coding in c# and the line that is causing the error is:

    RamDataAccess1 RAM = new RamDataAccess1();

    The following error is in the original message.  I reference the namespace (using RAMDATAACCESSLib;)

  • Yes, it sounds like you have an older 32 bit version. All recent versions are 64 bit only except for a subdirectory of 32 bit files used for converting old models. Once you install a 64 bit version (any of 15's or 16's) you will have the 64 bit dlls you need. You can then use the  interop.RAMDATAACESSlib.dll in the "Program Files\Bentley\Engineering\RAM Structural System\Prog" directory, or, maybe better, would be to directly add a reference to the RAMDataAccess dll to your .NET project (References - Add Reference - COM - Browse (directly to the RAMDataAccess.dll))