| Hello, I am trying to get the run program subroutine
running using Visual Basic version 4, I have not been
able to get the software to compile, I have defined
the following types and the declare function, but when
I compile the app I get a type ByRef argument type
mismatch on the third argument in this line of the sub
routine:
r& = CreateProcess(0&, cmdline$, 0&, 0&, 1&,
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
Please note that using the alias CreateProcessA the compiler
said that the function didnt exist. Am I missing something that
would allow the compiler to use the allias. Any examples of how
you have done this would be appreciated. this is a function that
looks to be something that everyone needs, its hard to believe it
is not a function that is defined in VB.
Thanks Joe
The following was added to the general object in the declarations
section.
Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Boolean
End Type
Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA"
(ByVal lpApplicationName As String, ByVal lpCommandLine As String,
lpProcessAttributes As SECURITY_ATTRIBUTES,
lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long,
ByVal dwCreationFlags As Long, lpEnvironment As Any,
ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO,
lpProcessInformation As PROCESS_INFORMATION) As Long
|