<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need help with desktop app Entitlement API in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/8964505#M72522</link>
    <description>&lt;P&gt;I think I am missing something simple, but I am having trouble getting the Entitlement API to work. I have read the relevant &lt;STRONG&gt;Mod the Machine&lt;/STRONG&gt; articles, but it is still not working for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My app is a desktop app in C# for Inventor 2020.&lt;/P&gt;&lt;P&gt;The "Autodesk App Store: Entitlement API for desktop Apps" pdf from the ADN has the following code for Inventor to get the user ID. This code fails to find the "AdWebservices" dll.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; [DllImport("AdWebServices", EntryPoint = "GetUserId", CharSet = CharSet.Unicode)]
 private static extern int AdGetUserId(StringBuilder userid, int buffersize);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, &lt;STRONG&gt;Mod the Machine&lt;/STRONG&gt; shows that you should import "AddinNETFramework.AdWebServicesWrapper.dll" and use the following code to get the user ID. This code just crashes without a meaningful error ("External component has thrown an exception"). And I believe that this is tailored for add-ins given that the dll has Addin in the name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CWebServicesManager mgr = new CWebServicesManager();
bool isInitialize = mgr.Initialize(); // crashes here.
// ...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know the correct approach for desktop apps? Is it different from add-ins?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 13 Aug 2019 23:36:50 GMT</pubDate>
    <dc:creator>ianteneth</dc:creator>
    <dc:date>2019-08-13T23:36:50Z</dc:date>
    <item>
      <title>Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/8964505#M72522</link>
      <description>&lt;P&gt;I think I am missing something simple, but I am having trouble getting the Entitlement API to work. I have read the relevant &lt;STRONG&gt;Mod the Machine&lt;/STRONG&gt; articles, but it is still not working for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My app is a desktop app in C# for Inventor 2020.&lt;/P&gt;&lt;P&gt;The "Autodesk App Store: Entitlement API for desktop Apps" pdf from the ADN has the following code for Inventor to get the user ID. This code fails to find the "AdWebservices" dll.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; [DllImport("AdWebServices", EntryPoint = "GetUserId", CharSet = CharSet.Unicode)]
 private static extern int AdGetUserId(StringBuilder userid, int buffersize);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, &lt;STRONG&gt;Mod the Machine&lt;/STRONG&gt; shows that you should import "AddinNETFramework.AdWebServicesWrapper.dll" and use the following code to get the user ID. This code just crashes without a meaningful error ("External component has thrown an exception"). And I believe that this is tailored for add-ins given that the dll has Addin in the name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CWebServicesManager mgr = new CWebServicesManager();
bool isInitialize = mgr.Initialize(); // crashes here.
// ...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know the correct approach for desktop apps? Is it different from add-ins?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 23:36:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/8964505#M72522</guid>
      <dc:creator>ianteneth</dc:creator>
      <dc:date>2019-08-13T23:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/8964884#M72523</link>
      <description>&lt;P&gt;In Inventor 2020 the Entitlement API has a change so the adWebService does not work as before, but you can refer to below post to find a workaround(i.e. calling &lt;STRONG&gt;Inventor.Application.Login)&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/inventor-2020-regression-with-entitlement-api/m-p/8748706#M96821" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/inventor-2020-regression-with-entitlement-api/m-p/8748706#M96821&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 06:11:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/8964884#M72523</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2019-08-14T06:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/8966834#M72524</link>
      <description>&lt;P&gt;Thanks for the reply. I have looked at the post you mentioned. Below is the code I am working with. It is a direct copy from the relevant Mod the Machine articles. It is still crashing. I have attached a portion of the exception for someone to review.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And am I really supposed to use the &lt;SPAN style="font-family: Arial; font-size: medium;"&gt;"AddinNETFramework.AdWebServicesWrapper.dll". This isn't for use in Add-ins, which the original poster in the post you mentioned is developing? Is this the same workflow for desktop apps? &lt;/SPAN&gt;&lt;SPAN style="font-family: Arial; font-size: medium;"&gt;I am not impressed with the documentation in this area. Especially since the method you are encouraging me to use is completely different from the ADN method; which is also not working for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; bool isLoggedIn = Inventor.Application.Login(); // No effect on crash error.
                    
 CWebServicesManager mgr = new CWebServicesManager();

 bool isInitialize = mgr.Initialize(); // Still crashes here.

 if (isInitialize == true) {

    string userId = "";

    mgr.GetUserId(ref userId);

    string username = "";

    mgr.GetLoginUserName(ref username);

 }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 22:05:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/8966834#M72524</guid>
      <dc:creator>ianteneth</dc:creator>
      <dc:date>2019-08-14T22:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9057812#M72525</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7060800"&gt;@ianteneth&lt;/a&gt;&amp;nbsp;same exact issue I'm having. Waiting for the support ticket to be picked up.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 19:02:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9057812#M72525</guid>
      <dc:creator>ThomasRambach</dc:creator>
      <dc:date>2019-09-30T19:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9096699#M72526</link>
      <description>&lt;P&gt;Still waiting on a solution to this. To reiterate, I am creating a desktop application and none of the proposed Autodesk or Mod the Machine solutions have worked. Below is the Autodesk code used in your proposed solution where the error occurs as well as my attempt to figure out what is causing this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code fails when calling the Initialize() method in the CWebServicesManager class. Seen below, this method appears to just call another method in the WebServicesManager class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Assembly location: C:\Program Files\Autodesk\Inventor 2020\Bin\AddinNETFramework.AdWebServicesWrapper.dll&lt;BR /&gt;// Autodesk.WebServices.CWebServicesManager&lt;BR /&gt;[return: MarshalAs(UnmanagedType.U1)]
public bool Initialize()
{
  if (this.IsInitialized())
    return true;
  return &amp;lt;Module&amp;gt;.Autodesk.WebServices.WebServicesManager.Initialize();
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the entire WebServicesManager class. It contains no Initialize() method nor much of anything else. Is this correct? Is my reading of this code correct? Can someone please address this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Assembly location: C:\Program Files\Autodesk\Inventor 2020\Bin\AddinNETFramework.AdWebServicesWrapper.dll&lt;BR /&gt;// Autodesk.WebServices.WebServicesManager
namespace Autodesk.WebServices
{
  [NativeCppClass]
  [StructLayout(LayoutKind.Sequential, Size = 8)]
  internal struct WebServicesManager
  {
    private long &amp;lt;alignment member&amp;gt;;
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2019 21:19:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9096699#M72526</guid>
      <dc:creator>ianteneth</dc:creator>
      <dc:date>2019-10-19T21:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9098482#M72527</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7060800"&gt;@ianteneth&lt;/a&gt;Autodesk has marked this as a known issue through the support system. They told me it's with engineering to figure out a solution. I think we all have to collectively keep asking for a solution.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 12:49:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9098482#M72527</guid>
      <dc:creator>ThomasRambach</dc:creator>
      <dc:date>2019-10-21T12:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9350758#M72528</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/48931"&gt;@ThomasRambach&lt;/a&gt;Have you heard anything on this topic?&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 01:58:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9350758#M72528</guid>
      <dc:creator>ianteneth</dc:creator>
      <dc:date>2020-03-01T01:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9351213#M72529</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code works with Inventor 2020.&lt;/P&gt;&lt;P&gt;I've written in the blog about it and the blog contains sample code... but my blog is written in Japanese!&lt;/P&gt;&lt;P&gt;&lt;A href="https://qiita.com/yamarah/items/c7cd1ec7acc6e487d574" target="_blank" rel="noopener"&gt;Autodesk Inventor API Hacking (Entitlement API)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You must translate it by google translate or something, but I hope my blog helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 14:43:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9351213#M72529</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2020-03-01T14:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with desktop app Entitlement API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9352867#M72530</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/555733"&gt;@HideoYamada&lt;/a&gt;&amp;nbsp;I'll see if Google Translate can get me far enough on your post to decipher it. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7060800"&gt;@ianteneth&lt;/a&gt;&amp;nbsp;I have an alternate method I'm trying out now.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 15:13:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-desktop-app-entitlement-api/m-p/9352867#M72530</guid>
      <dc:creator>ThomasRambach</dc:creator>
      <dc:date>2020-03-02T15:13:18Z</dc:date>
    </item>
  </channel>
</rss>

