Click here to Skip to main content
15,911,890 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionReg Database Pin
thangvel6-Oct-09 21:26
thangvel6-Oct-09 21:26 
QuestionCString + OPENFILENAME Pin
raviteja20206-Oct-09 21:18
raviteja20206-Oct-09 21:18 
AnswerRe: CString + OPENFILENAME Pin
CPallini6-Oct-09 21:25
mveCPallini6-Oct-09 21:25 
GeneralRe: CString + OPENFILENAME Pin
raviteja20206-Oct-09 22:46
raviteja20206-Oct-09 22:46 
QuestionRe: CString + OPENFILENAME Pin
CPallini6-Oct-09 22:51
mveCPallini6-Oct-09 22:51 
AnswerRe: CString + OPENFILENAME Pin
raviteja20206-Oct-09 23:03
raviteja20206-Oct-09 23:03 
GeneralRe: CString + OPENFILENAME Pin
Richard MacCutchan6-Oct-09 23:19
mveRichard MacCutchan6-Oct-09 23:19 
GeneralRe: CString + OPENFILENAME Pin
CPallini6-Oct-09 23:29
mveCPallini6-Oct-09 23:29 
void CSockDlg::OnFileSaveAs(HWND hWnd)
{
     OPENFILENAME ofn;
     TCHAR szPath[MAX_PATH];
     TCHAR szFile[MAX_PATH];
     ZeroMemory( &ofn, sizeof(ofn) );
     m_imgName.lStructSize = sizeof(ofn);

     szFile[0] = '\0';
     ofn.hwndOwner = hWnd;
     ofn.lpstrFile = szFile;
     ofn.nMaxFile = sizeof(szFile)/sizeof(szFile[0]);
     ofn.lpstrInitialDir = szPath;
     if ( GetSaveFileName( &ofn ) == TRUE )
     {
       // here set properly m_imgName
       // BTW: why don't you used CFileDialog instead of GetSaveFileName?
     }
     else
     {
     }
}



raviteja2020 wrote:
Here I've declared the variable again in th OnFileSaveAs() so that my project runs temporarily.
I'll have to remove the declaration from the dialog and have to declare a public variable.


Variable m_imgName doesn't need to be declared public (needs to be a class member, not a local variable), as it is used in its owner class code.
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

AnswerRe: CString + OPENFILENAME Pin
Stuart Dootson6-Oct-09 21:28
professionalStuart Dootson6-Oct-09 21:28 
AnswerRe: CString + OPENFILENAME Pin
KarstenK6-Oct-09 21:52
mveKarstenK6-Oct-09 21:52 
AnswerRe: CString + OPENFILENAME Pin
David Crow7-Oct-09 3:33
David Crow7-Oct-09 3:33 
QuestionUsage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
ratprita6-Oct-09 20:33
ratprita6-Oct-09 20:33 
AnswerRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
Michael Schubert6-Oct-09 20:41
Michael Schubert6-Oct-09 20:41 
AnswerRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
goonyangxiaofang6-Oct-09 20:41
goonyangxiaofang6-Oct-09 20:41 
GeneralRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
ratprita6-Oct-09 21:22
ratprita6-Oct-09 21:22 
GeneralRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
CPallini6-Oct-09 21:25
mveCPallini6-Oct-09 21:25 
GeneralRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
Richard MacCutchan6-Oct-09 23:22
mveRichard MacCutchan6-Oct-09 23:22 
AnswerRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
CPallini6-Oct-09 21:20
mveCPallini6-Oct-09 21:20 
AnswerRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
KarstenK6-Oct-09 21:55
mveKarstenK6-Oct-09 21:55 
AnswerRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
Rajesh R Subramanian6-Oct-09 22:03
professionalRajesh R Subramanian6-Oct-09 22:03 
AnswerRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
wangningyu6-Oct-09 22:34
wangningyu6-Oct-09 22:34 
GeneralRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
Michael Schubert6-Oct-09 22:44
Michael Schubert6-Oct-09 22:44 
JokeRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
Iain Clarke, Warrior Programmer6-Oct-09 23:03
Iain Clarke, Warrior Programmer6-Oct-09 23:03 
GeneralRe: Usage of Win32APIs CreateFile(),WriteFile() and ReadFile() Pin
CPallini6-Oct-09 23:44
mveCPallini6-Oct-09 23:44 
Questionincrement decrement in C++ Pin
hrishiS6-Oct-09 20:18
hrishiS6-Oct-09 20:18 

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.