Page 1 of 1

run c# .dll(or .exe) to validate password

Posted: Thu Feb 08, 2007 7:11 am
by joao_bana
hi,
Could anyone tell me how can i use a c# dll that just validates the password inserted during installation?

i have seen another post mencioning just running an .exe to do this but i really cant understand how they send and receive the variables in the .exe

thanks

Posted: Thu Feb 08, 2007 1:39 pm
by MichaelNesmith
Just use Call DLL Function to call your DLL.

Some of the built-in sample projects make use of the Call DLL Function command with the Win32 API. Check them out.

As long as .NET is installed and your C# DLL can be called from regular Win32 apps, you will be set.

Re: export dll function

Posted: Fri Feb 09, 2007 7:14 am
by joao_bana
ok, I did like you suggested and used the Call dll function. It seams fine but unfortunately I getting the FUNCTIONNOTFOUND error.

a little research tells me that "C# DLLs cannot be exported due to the underlying nature of .NET". In fact, Installware's help says that "The function must be available under the specified function name and use the __stdcall calling convention." which c#'s functions, I think, do not.

Can you give some more help?
Thanks once again

Posted: Fri Feb 09, 2007 12:57 pm
by epohl
One way around this would be to put your validation procedure in a command-line .exe file, distribute it to SUPPORTDIR, and then call it via the Run Program command.

Eric

Posted: Fri Feb 09, 2007 1:36 pm
by MichaelNesmith
If you cannot support the required calling convention, Call DLL Function will not work for you. Sorry!