Developers looking for developers

Answered

Dll References

I have this library which is a COM component because i need it in a legacy code project, I'm using the demo editor but anytime windows is loaded 

and  i try to use it throw an error of iink.dll and MyScript.Interactive.IInk  not found


how can i reference them in a static folder that i have to install?


Best Answer

OK! i figure it out, when the DLL is called it change its working directory and set it equal to the calling program thus invalidating the path to the other ink dll, just used a Directory.SetCurrentDirectory() to the right path  and it was able to find it


I shuld add to clarify that the window creation work just fine inside the project develop, but fail when the dll its called from an outside source

Dear Armach,


Thank you for your question. 


We are not sure to fully understand your issue. 

As far we understand you built your project from our Demo Windows project and are facing some integration issue.

Which graphical framework are you using: UWP? WPF?


What modifications did you bring?


Best regards,


Gwenaëlle

Yes it was built in Wpf, the only things i really did  was to integrate  the editor of the example inside a window in a DLL, wich have a method to show this window and  return the recognized text the DLL wich is registered as a COM really have 2 methods show the window and get the string but when i use this dll outside of its project in visualstudio the xaml fail to load cause some iink dll are missing  

file not found exception: could not load file or assembly 'MyScript.IInk.dll'

The problem here is i kinda don't know where it is searching for the DLL  i tried placing them in the same folder of mine dll in the same folder of the calling application and still can't find the dll

 this is the namespace i used in the xaml

xmlns:Uc="clr-namespace:MyScript.IInk.UIReferenceImplementation;assembly=MyScript.InteractiveInk.UIReferenceImplementation.Wpf"

 


Dear Armach_,


Currently, it seems like the MyScript.IInk.dll was not set as "Content" "Buikd Action".?


You can refer to some topics you will find on the internet: https://social.msdn.microsoft.com/Forums/en-US/1b1b316a-8648-4243-a651-84de51fd2508/reference-native-dll-from-managed-c-project?forum=vssmartdevicesvbcs


Best regards,


Olivier


1 person likes this

could be but i installed the nuget didn't reference directly the dll, ill try and let you know

The problem persists since the ink DLL is installed and copied by the NuGet installation, but when i use the Wrapper dll as a com object from vb it crashes unable to find the ink.dll

Dear Armach,


this more looks like a visual studio issue.


It is likely you will find more help on forums to properly settle your project.


Best regards,


Olivier

Answer

OK! i figure it out, when the DLL is called it change its working directory and set it equal to the calling program thus invalidating the path to the other ink dll, just used a Directory.SetCurrentDirectory() to the right path  and it was able to find it

Dear Armach,


thank you for the update, I am glad it is working.


Best regards,


Olivier


1 person likes this