Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Casting NRTSession
neilm
WorkSite/DeskSite V8
I have some code (C#) which establishes an IManage.NRTSession and I want to add some IMANADMIN functionality (adding clients and matters). I have a problem in that I cannot cast from IManage.NRTSession to IMANADMIN.NRTSession. The snippet below illustrates what I'm trying to do, the exception is raised by the line marked "//Exception".
IManage.NRTDMS m_dms = new IManage.ManDMSClass();
IManage.NRTSession m_session = m_dms.Sessions.Add("server1");
m_session.TrustedLogin();
<SNIP>
IMANADMIN.NRTSession adminsess = (IMANADMIN.NRTSession) m_session; //Exception
IMANADMIN.INRTDatabase2 db = (IMANADMIN.INRTDatabase2) adminsess.Databases.Item(1);
db.InsertParentCustomField(IMANADMIN.AttributeID.nrCustom1, aliasTextBox.Text, descTextBox.Text, true);
Am I doing anything wrong or is there a workaround which doesn't require me to have two sessions - a user session and an admin session?
Note: If I use IMANADMIN throughout everything works fine.
Regards and thanks in advance
Neil
Find more posts tagged with
Comments
Migrateduser
Neil,
iManAdmin.dll and iManage.dll are two different DLLs with two different types of interfaces. There is no workaround as far as I know to avoid two different sessions