error 998:記憶體配置存取無效。
 The third parameter: LPVOID [in] Pointer to the buffer that contains data to be written into the address space of the specified process.
 you should pass a valid address to  this parameter, I don't know why you use a string variable.When you wanna pass a pointer of string ( type of lpcstr),you should use "byval" keyword.When we need a parameter act as a pointer to a buffer,we often use the following way:
dim bArray(n) as byte
functionName para1,..., bArray(0),.... The last parameter :  LPDWORD  [out] number of bytes written if you wanna pass a null value,you should use "byval 0",else,you can define a variable whose type is "Long",and use the varible as para,it cannot be a const pointer.