Visual Studio, Win8, and TM1Api woes

Post Reply
aking
Posts: 32
Joined: Mon Oct 18, 2010 8:45 pm
OLAP Product: Cognos TM1
Version: 10.2.2
Excel Version: 365

Visual Studio, Win8, and TM1Api woes

Post by aking »

Hey guys, I'm looking for a bit of help, but I think it might be a long shot,

I have a standalone windows program that interacts with TM1 that was inherited from a former co-worker. It was originally developed for Windows XP x86, and I'm now trying to get it to work on Win7 x64. When I copied the original executable files over, the program ran, but as soon as I tried to do something involving TM1, I got this error:

Unable to load the DLL 'tm1api.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).

Closed the program, reopened it as "Run as Administrator" and I got the same result. I didn't change anything from the original pull over, and the tm1api.dll file was in the root folder of the program. So I figure, it must be the x86 to x64 conversion, I go intt program files and grab the x64 tm1api.dll and copy it to the root folder. Same error.

So I go track down the old solution, bring it up in Visual Studio and try to swap out the file there. Still no luck. I've also tried adding the dll as a reference, though I'm lead to believe that this won't work because the tm1api isn't a COM application (not entirely certain what that means).

Can anyone else think of something for me to try. It was a very handy little tool that let you copy processes between servers without bouncing them or doing it manually.
User avatar
jim wood
Site Admin
Posts: 3958
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Visual Studio, Win8, and TM1Api woes

Post by jim wood »

If you're running against 10.1 then the dll moved. There are several posts on here about it if that's the case,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
lotsaram
MVP
Posts: 3702
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Visual Studio, Win8, and TM1Api woes

Post by lotsaram »

aking wrote:Can anyone else think of something for me to try. It was a very handy little tool that let you copy processes between servers without bouncing them or doing it manually.
You can try this tool http://www.tm1forum.com/viewtopic.php?f=21&t=7821
Or a commercial tool http://www.viziersoftware.com/
User avatar
Harvey
Community Contributor
Posts: 236
Joined: Mon Aug 04, 2008 4:43 am
OLAP Product: PA, TM1, CX, Palo
Version: TM1 8.3 onwards
Excel Version: 2003 onwards
Contact:

Re: Visual Studio, Win8, and TM1Api woes

Post by Harvey »

The error you are getting does not indicate a 32/64-bit problem. If that was the case, you'd get a "BadImageFormatException".

It's telling you the dll is not found at all, which means you're not loading it correctly. Putting it in the executable folder of the program might not be enough.

There are two methods for loading the dlls, one is to call the Windows API function LoadLibrary, and the other is to set the path for the program to search by calling the Windows API function "SetDllDirectory", the latter of which I have had the most success with

Both of them are discussed in my blog post here. I would suggest trying the API in that library first.

It's also worth throwing the Flow Model Packager in the hat, as it will do live promotion of objects for you without bringing down the server.
Take your TM1 experience to the next level - TM1Innovators.net
Craig Trevor
Posts: 7
Joined: Tue Jul 28, 2009 4:43 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 20010
Location: Brisbane, Australia

Re: Visual Studio, Win8, and TM1Api woes

Post by Craig Trevor »

The program is likely looking for the tm1api.dll in the old install location:

C:\Program FIles\Cognos\TM1\bin

Instead of the new location:

C:\Program Files\ibm\cognos\tm1_64\bin64

You can either update the program code to point to the new location, or as a quick hack copy the tm1api.dll to the old install location.
Post Reply