Hello everybody
I have a DLL (Autenticator.dll) that I created (Visual Studio C#) which has one class (named ValidateClass), and this class has one method:
public static String validate(String username, String password)
I have a UserPass dialog which puts the inserted username and password into $R0 and $R1.
All I wanna do is to call the function in my DLL with the $R0 and $R1 parameters and to get the function's result.
How should I do that?
First, where do I have to put the DLL file?
Second, what is the syntax of the call to the DLL in the function? Something like
System::Call 'Authenticator::ValidateClass.validate($R0, $R1)'? Where does the function's result go to?
Thanks for the help
How to call a DLL made by yourself?
8 posts
This is not going to work. C# (and VB.NET) DLL's are not standard extensions - they use .NET. If you write a DLL it's got to be C/C++ 6 or Delphi. It is possible to write these plugins under VS.NET but they can't contain any .NET code. Even then, the user may still need to have .NET installed. You wouldn't believe how many people still don't have .NET installed and never will.
The rest of my application will use .NET, so I'm going to use this verification:
If the user has a valid .NET version, the installer continues, otherwise it will stop.
So, I think the that .NET is not the problem.
Or is it simply impossible to user C#-made DLL's in NSIS?
So, is there any way to get the result of the function call?
If the user has a valid .NET version, the installer continues, otherwise it will stop.
So, I think the that .NET is not the problem.
Or is it simply impossible to user C#-made DLL's in NSIS?
So, is there any way to get the result of the function call?
You'd have to build it as a console application and capture its output with nsExec::ExecToStack.
-Stu
-Stu
You mean an .exe?
If so, where should the output go in order to be captured by nsExec?
If so, where should the output go in order to be captured by nsExec?
EXE = executive (executable)
It needs to be output like in any other console application which you run in command prompt.
-Stu
It needs to be output like in any other console application which you run in command prompt.
-Stu
Ok, so now I have my app in console mode. By passing the username and password as arguments in command line, it outputs a String.
So, how do I call the application with the right parameters? (please assume that the arguments are stored in $R0 and $R1
So, how do I call the application with the right parameters? (please assume that the arguments are stored in $R0 and $R1
nsExec::ExecToLog '"$PLUGINSDIR\myapp.exe" "param1" "param2"'
Pop $R0 #result
-Stu
Pop $R0 #result
-Stu