Please fill in the blanks (only 2)
New to C++. Please help me fill in the blanks which I have commented in the code below. I don't understand how to directly access char array arguments in a function.
(This is a Dll Export function to be called from VB)
The third parameter is a string which will be changed by the function. That is what I don't know how to do.
Apart from that, this code already works - I have tested it.
Code:
int _stdcall ShowOpenDlgAjP(HWND hOwner, char Filter[],/* this is where I need a buffer for the return path */ )
{
OPENFILENAME ofn;
int result;
memset(&ofn,0,sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hOwner;
ofn.lpstrFilter = Filter;
ofn.nFilterIndex = 1;
ofn.lpstrFile = "";
ofn.nMaxFile = 256;
ofn.Flags = OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
result = GetOpenFileName(&ofn);
//this is where I want to assign ofn.lpstrFile to the return buffer
return result;
}