Page 1 of 1

Visual Studio, Win8, and TM1Api woes

Posted: Fri Jan 11, 2013 4:15 pm
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.

Re: Visual Studio, Win8, and TM1Api woes

Posted: Fri Jan 11, 2013 4:35 pm
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.

Re: Visual Studio, Win8, and TM1Api woes

Posted: Fri Jan 11, 2013 8:06 pm
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/

Re: Visual Studio, Win8, and TM1Api woes

Posted: Sat Jan 12, 2013 10:16 am
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.

Re: Visual Studio, Win8, and TM1Api woes

Posted: Sun Jan 13, 2013 11:33 pm
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.