Connecting to TM1 via VB.net
Posted: Wed Nov 03, 2010 8:15 am
Hi Guys,
I am wanting to build an integration app using vb.net, however I am having trouble using the API. Is VB.NET supported by TM1? My code as attached is returning the following error: "Unable to load DLL 'tm1api.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)". I have included the tm1api.dll in both the directory of the project and also in the system32 directory. The code is as follows:
Any suggestions would be helpful.
Thanks,
Damien
I am wanting to build an integration app using vb.net, however I am having trouble using the API. Is VB.NET supported by TM1? My code as attached is returning the following error: "Unable to load DLL 'tm1api.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)". I have included the tm1api.dll in both the directory of the project and also in the system32 directory. The code is as follows:
Code: Select all
Partial Class _Default
Inherits System.Web.UI.Page
Declare Function TM1SystemOpen Lib "tm1api.dll" () As Integer
Declare Sub TM1APIInitialize Lib "tm1api.dll" ()
Declare Sub TM1APIFinalize Lib "tm1api.dll" ()
Declare Function TM1ValPoolCreate Lib "tm1api.dll" (ByVal hUser As Long) As Long
Declare Function TM1SystemServerConnect Lib "tm1api.dll" (ByVal hPool As Long, ByVal sServer As Long, ByVal sClient As Long, ByVal sPassword As Long) As Long
Declare Function TM1ValString Lib "tm1api.dll" (ByVal hPool As Long, ByVal InitString As String, ByVal MaxSize As Long) As Long
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hPool As Long
Dim hUser As Long
hPool = TM1ValPoolCreate(hUser)
End Sub
End Class
Thanks,
Damien