   Need help with GetOpenFileName and spinner control...
  Hi guys, I have some problem with the following:1. I need to open a file using fopen function under windows. I proceed as follows: I create an OPENFILENAME struct, I "zero" and initialize it, then I get the name of the using GetOpenFileName API. I obtain the correct file path inside the OpenFileName.lpstrFile field, but when I try to "fopen" the file I have a NULL FILE pointer. If I try to use fopen("C:\\path\\file", "wb") everything is ok. I think it''s a problem regarding the string format (fopen uses a LPCSTR and lpstrFile is a LPTSTR, I always do a lot of confusion with this damned string format). How can I solve this?2. I created a textfield (edit) in my dialog and I buddied it with a spinner. How can I increase the numeric value of the textfield by 0.01 instead of 1?Thanks for your help. Bye! 
  For the string format, I usually have an array sized to MAX_PATH, then I setup the OPENFILENAME deal and whatnot. This way works for me: char FileName[MAX_PATH];  // MAX_PATH is declared in <stdlib.h>OPENFILENAME ofn;// initialize the OPENFILENAME structofn.lpstrFile = FileName;ofn.nMaxFile = MAX_PATH;ofn.lpstrFilter = "File Extension (*.ext)\0*.ext";ofn.lpstrDefExt = "*.ext";ofn.lStructSize = sizeof(OPENFILENAME);ofn.lpstrInitialDir = "data\\files";// have the user select a fileif(GetOpenFileName(&ofn)){// pointer to the fileFILE *OpenFile;// if it fails to open, quitif((OpenFile = fopen(FileName, "rt")) == NULL){// return(0), break, or quit, whatever you wanna do}// read file information}I''ve had plenty of troubles myself with LPSTR string formats, so I''ve just learned to avoid them. CString should also work, but I haven''t personally tried it.As for the second problem, not sure. You''ll have to wait for others to post, sorry. ;  1. Omega147''s solution looks good.2. Spin Button Controls only support integers. You may need to set the range *= 100, handle UDN_DELTAPOS yourself and update the edit value to display float/doubles. ;  The first problem is solved!!! Thanks!!! I addedFileName[0] = ''\0'';to make it work correctly on Windows XP.Thanks a lot, now I''m gonna work to the second.See u soon! ;  Another question:The UDN_DELTAPOS is catchable from the Dialog procedure?Should I add something like this:switch (msg){  case UDN_DELTAPOS:......}in this case how can I obtain the id of the control that sent the message?I''ve tried using WM_NOTIFY but I can''t get a pointer to a NM_UPDOWN struct... how should I handle it? ;  Everything''s solved. Thank you guys! 