When {0}
is used to initialize an object, what does it mean? I can\'t find any references to {0}
anywhere, and because of the curly braces Google s
In answer to why ShellExecuteEx()
is crashing: your SHELLEXECUTEINFO
"sexi" struct has many members and you're only initializing some of them.
For example, the member sexi.lpDirectory
could be pointing anywhere, but ShellExecuteEx()
will still try to use it, hence you'll get a memory access violation.
When you include the line:
SHELLEXECUTEINFO sexi = {0};
before the rest of your structure setup, you're telling the compiler to zero out all structure members before you initialize the specific ones you're interested in. ShellExecuteEx()
knows that if sexi.lpDirectory
is zero, it should ignore it.