Click here to Skip to main content
15,887,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: get the window's rect Pin
Richard MacCutchan17-Nov-09 5:39
mveRichard MacCutchan17-Nov-09 5:39 
JokeRe: get the window's rect Pin
CPallini17-Nov-09 5:47
mveCPallini17-Nov-09 5:47 
QuestionExamples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 2:07
Nicola Curran17-Nov-09 2:07 
QuestionRe: Examples of SaveAs in winapi / c++ Pin
CPallini17-Nov-09 2:21
mveCPallini17-Nov-09 2:21 
AnswerRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 2:38
Nicola Curran17-Nov-09 2:38 
AnswerRe: Examples of SaveAs in winapi / c++ Pin
CPallini17-Nov-09 2:46
mveCPallini17-Nov-09 2:46 
GeneralRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 3:10
Nicola Curran17-Nov-09 3:10 
GeneralRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 3:13
Nicola Curran17-Nov-09 3:13 
No wait, maybe it was something else....Here is the working code for any searching people:


char buffer[256]={""};
char tmp[256]={""};
tmp[0] = '\0';
GetEnvironmentVariable("USERPROFILE", buffer, sizeof(buffer));

OPENFILENAME _openfile;
ZeroMemory(&_openfile, sizeof(OPENFILENAME));
_openfile.lStructSize = sizeof(OPENFILENAME);
_openfile.hwndOwner = GetFocus();
_openfile.lpstrFilter = "Extensible Markup Language (*.xml)";
_openfile.lpstrFile = tmp;
_openfile.nMaxFile = sizeof(tmp)/sizeof(*tmp);
_openfile.lpstrFileTitle = "Save As ...";
_openfile.lCustData = (DWORD)NULL;
_openfile.lpstrInitialDir = strcat(buffer, "\\Desktop\\"); /*virtalis_diagnostic_info.xml");*/
_openfile.lpstrDefExt = "xml";


bool success = false;
success = GetSaveFileName(&_openfile);
DWORD error = CommDlgExtendedError();

HANDLE file = CreateFile((LPTSTR)_openfile.lpstrFile,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL,
NULL);

I hope this helps some idot n00b like myself!
GeneralRe: Examples of SaveAs in winapi / c++ Pin
Nicola Curran17-Nov-09 3:13
Nicola Curran17-Nov-09 3:13 
QuestionDont send error message occured only once Pin
thippipriya17-Nov-09 2:02
thippipriya17-Nov-09 2:02 
QuestionRe: Dont send error message occured only once Pin
David Crow17-Nov-09 3:37
David Crow17-Nov-09 3:37 
AnswerRe: Dont send error message occured only once [modified] Pin
thippipriya17-Nov-09 16:25
thippipriya17-Nov-09 16:25 
QuestionCalling dll function Pin
Le@rner17-Nov-09 1:05
Le@rner17-Nov-09 1:05 
AnswerRe: Calling dll function Pin
SandipG 17-Nov-09 1:29
SandipG 17-Nov-09 1:29 
AnswerRe: Calling dll function Pin
Kushagra Tiwari17-Nov-09 2:46
Kushagra Tiwari17-Nov-09 2:46 
QuestionHow to create a vector? Pin
deadlyabbas17-Nov-09 0:58
deadlyabbas17-Nov-09 0:58 
AnswerRe: How to create a vector? Pin
Jijo.Raj17-Nov-09 1:30
Jijo.Raj17-Nov-09 1:30 
GeneralRe: How to create a vector? Pin
deadlyabbas17-Nov-09 3:50
deadlyabbas17-Nov-09 3:50 
GeneralRe: How to create a vector? Pin
«_Superman_»17-Nov-09 7:17
professional«_Superman_»17-Nov-09 7:17 
Questiondde problem Pin
trioum17-Nov-09 0:24
trioum17-Nov-09 0:24 
QuestionFind out Build Configuration from exe Pin
Maya_16-Nov-09 23:21
Maya_16-Nov-09 23:21 
AnswerRe: Find out Build Configuration from exe Pin
Randor 17-Nov-09 2:13
professional Randor 17-Nov-09 2:13 
QuestionRe: Find out Build Configuration from exe Pin
David Crow17-Nov-09 3:43
David Crow17-Nov-09 3:43 
AnswerRe: Find out Build Configuration from exe Pin
Randor 17-Nov-09 11:21
professional Randor 17-Nov-09 11:21 
GeneralRe: Find out Build Configuration from exe Pin
Maya_17-Nov-09 5:22
Maya_17-Nov-09 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.