Results 1 to 17 of 17

Thread: Please fill in the blanks (only 2)

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Alan777's Avatar
    Join Date
    Jan 2001
    Location
    New Zealand
    Posts
    303

    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;
    }
    Last edited by Alan777; Mar 29th, 2002 at 03:53 AM.
    "Today's mighty oak is just yesterday's nut,
    that held its ground."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width