Need help with desktop app Entitlement API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I think I am missing something simple, but I am having trouble getting the Entitlement API to work. I have read the relevant Mod the Machine articles, but it is still not working for me.
My app is a desktop app in C# for Inventor 2020.
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.
[DllImport("AdWebServices", EntryPoint = "GetUserId", CharSet = CharSet.Unicode)] private static extern int AdGetUserId(StringBuilder userid, int buffersize);
Alternatively, Mod the Machine 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.
CWebServicesManager mgr = new CWebServicesManager(); bool isInitialize = mgr.Initialize(); // crashes here. // ...
Does anyone know the correct approach for desktop apps? Is it different from add-ins?
Thanks!