I want to write my own function that shows an "OpenFile DialogBox" and when somebody selects a file, I want to return the filename at the end of my function

Here is the code:

VB Code:
  1. void  ShowOpenFile(HWND hwndowner)
  2. {
  3.     OPENFILENAME ofn;
  4.     char chosenfile[MAX_PATH];
  5.  
  6.     ZeroMemory(&ofn, sizeof(ofn));
  7.     chosenfile[0] = 0;
  8.  
  9.     ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST, OFN_HIDEREADONLY;
  10.     ofn.hInstance =     hinst;
  11.     ofn.hwndOwner =     hwndowner;
  12.     ofn.lpstrFilter =   "Web Page(*.html)\0*.html\0\0";
  13.     ofn.lpstrDefExt =   "html";
  14.     ofn.lStructSize = MAX_PATH;
  15.     ofn.lpstrFile = chosenfile;
  16.  
  17.     if(GetOpenFileName(&ofn))
  18.     {
  19.         return chosenfile[MAX_PATH];
  20.     }
  21.    
  22. }

That code does not work and I have tried lots of other things like making a char function instead of void function but it does not solve the problem.

So simply... How do return the name of the file at the end of my function?