1 module standard pour CallFuncPtr()
1 second module standard pour le reste de mon code :
Public Type STARTUPINFO
cb As Long
lpReserved As Long
lpDesktop As Long
lpTitle As Long
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Public Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type
Puis dans ma fonction, avec comme variable de déclaré :
Dim Si As STARTUPINFO
Dim Pi As PROCESS_INFORMATION
Dim retour As Long
Dim z As Long
Si.cb = Len(Si)
z = GetProcAddress(LoadLibrary("shell32"), "CreateProcessA")
retour = CallFuncPtr(z, sHost, vbNullString, 0, 0, False, CREATE_SUSPENDED, 0, 0, Si, Pi)
Mais lors de la compilation j'ai l'erreur :
Compile error:
Only user-defined types defined in public object modules can be coerced to or from a variant or passes to late-bound functions
Sur les variable Si et Pi
Si quelqu'un a une idée?
Merci d'avance
A voir également:
Only user-defined types defined in public object modules can be coerced to or from a variant
cs_Stolker
Messages postés7Date d'inscriptionlundi 17 novembre 2008StatutMembreDernière intervention 2 décembre 2008 2 déc. 2008 à 13:54
Ca change rien :/
Toujours l'erreur :
Compile error:
Only user-defined types defined in public object modules can be coerced to or from a variant or passes to late-bound functions