How call My DLL MFC from powershell with parameters

-1

voici mon code en Powershell:

<<

$Dll ="F:\Jay\test\Zpacq.dll"

$Signature = @" [DllImport(@"$Dll",CharSet = CharSet.Unicode, SetLastError = true)]public static extern bool Run(int Count, string arg1); "@ $ShowWindowAsync = Add-Type -memberDefinition $Signature -Name "Test" -PassThru -IgnoreWarnings

$ShowWindowAsync::Run(1,"-xxcc")

Ma DLL exporte une fonction avec ce profil elle est développée sous Visual studio 2019

BOOL Root::Run(int argc, LPCTSTR argw)

au runtime j'obtiens suivant

lors de l'appel de « Run » avec « 2 » argument(s) : « Tentative de chargement d’un programme de format incorrect. (Exception de HRESULT : 0x8007000B) » Au caractère Ligne:12 : 1

je ne comprends pas j'ai respecté ce que j'ai trouvé sur net

Token Here Two example

#

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/add-type?view=powershell-6

https://devblogs.microsoft.com/scripting/use-powershell-to-interact-with-the-windows-api-part-1/

#

Pouvez-vous m'aider

D'avance merci.

powershell
dll
parameters
mfc
call
asked on Stack Overflow Dec 18, 2019 by G3D

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0