|
so how do I use the information returned from the dialog to save the file?
|
|
|
|
|
If ShowDialog() returns DialogResult.OK , use saveFileDialog1->FileName to open file file and write the contents.
|
|
|
|
|
mmagill0 wrote: so how do I use the information returned from the dialog to save the file?
The only information you have from the dialog is the file name and destination directory. From this you create the file and write your data to it, the dialog has no further influence on this process.
It's time for a new signature.
|
|
|
|
|
In addition to what's already been suggested, you might receive more help by posting to the correct forum.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
if i'm using winforms with C++, do I post in winforms or C++??
|
|
|
|
|
I think you are fine here; although your program uses Winforms (Managed C++/CLI) your question relates to C++ and Windows API.
It's time for a new signature.
|
|
|
|
|
I'm using Visual C++ 6 on Windows XP. My program uses COlePropertyPage property pages. One of them has a List Control. When the user clicks a certain part of my List Control, a dialog box appears, and when the user is done with it, it disappears. However, if the dialog box is moved over part of my List Control, when the box is closed that part is erased and set to gray, the color of the underlying COlePropertyPage. I want the List Control to refresh itself when the dialog box disappears. The control will refresh itself if another window is placed on top and then removed. Of course, I don't want the user to have to do that! The List Control should refresh immediately when the dialog disappears.
I'm trying Invalidate(), UpdateWindow() and RedrawItems() one at a time and all three at once. It makes no difference. Actually, I note that my DrawItem function is called even without calling those repaint functions. Calling them just repeats the DrawItem function being called. However, the DrawItem call has no effect. Also I've tried setting the control to dirty with COlePropertyPage::SetControlStatus(). Nothing works.
Thanks for any help..
|
|
|
|
|
Hi Member
How can i add File Icon in list control?
m_LIST.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP);
m_LIST.InsertColumn(1, _T("File Name"), LVCFMT_LEFT, 80);
m_LIST.InsertItem(0, "file.doc");
m_LIST.InsertItem(0, "file.pdf");
i want to add word icon,pdf icon(Microsoft defoult icon).
|
|
|
|
|
Try the SetImageList() method.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
i try to use this code.
SHFILEINFO fi;
BOOL bReturn = FALSE;
HIMAGELIST himl = NULL;
ZeroMemory (&fi, sizeof (fi));
himl = (HIMAGELIST)SHGetFileInfo (filename, 0, &fi, sizeof (fi), SHGFI_ATTRIBUTES | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
bReturn = m_ImageListSmall.Attach (himl);
m_LIST.SetImageList (&m_ImageListSmall, LVSIL_SMALL);
I have found only same image showing in all column(what ever file is .doc or .pdf).
Can you guide me for this problem.
|
|
|
|
|
How many images are in the image list? When you add items to the list control, what index are you using for the image?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I want to know how to declare three dimensional arrays in C/C++ and how they work. Examples will do. Please help.
|
|
|
|
|
Maybe this link[^] will help get you started.
|
|
|
|
|
I have been to that site but it only talks about it without examples. I know it can for instance be declared as follows:
int rates[10][4][3];
The declaration is what has been shown on the site. But I want to know how to initialise the array when it is declared, and know how the indexing will refer to a particular value in the initialising list.
|
|
|
|
|
OK, how about this[^] site.
|
|
|
|
|
Try the information here[^]. Although this only covers 2D arrays, you can think of the third dimension as a number of 2D arrays one on top of the other, the index increasing as you go further down the planes.
It's time for a new signature.
|
|
|
|
|
Dan_K wrote: But I want to know how to initialise the array when it is declared...
Like:
int Array3D[2][4][6] =
{
{
{ 1,2,3,4,5,6 },
{ 7,8,9,10,11,12 },
{ 13,14,15,16,17,18 },
{ 19,20,21,22,23,24 }
},
{
{ 77,78,79,80,81,82 },
{ 83,84,85,86,87,88 },
{ 89,90,91,92,93,94 },
{ 95,96,97,98,99,100 }
}
};
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
A sample;
int array[3][4][5] = {
{
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 }
},
{
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 }
},
{
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 },
{ 1, 2, 3, 4, 5 }
}
};
|
|
|
|
|
In fact Ive called ShellExecute() to execute another application when clicking on the button on the dialog. And I want to suspend the current dialog until the app executed by ShellExecute() finishes its tasks. But I dont know how to do it. Can anyone help? Thanx in advance.
PS: I dont know whether WaitForSingleObject() will work.
|
|
|
|
|
If you WaitForSingleObject on the handle of the spawned process the thread doing the waiting will stop until the spawned app completes.
To get the process handle it might be an idea to use ShellExecuteEx as you can find out the handle of the spawned process a bit easier.
Cheers,
Ash
|
|
|
|
|
|
int RunAppAndWait(char *cmd)
{
PROCESS_INFORMATION ProcInfo;
STARTUPINFO StartInfo;
int exit_status = 0;
memset(&StartInfo, 0, sizeof(StartInfo));
StartInfo.cb = sizeof(StartInfo);
if (CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &StartInfo, &ProcInfo))
{
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
GetExitCodeProcess(ProcInfo.hProcess, (unsigned long *)&exit_status);
CloseHandle(ProcInfo.hProcess);
CloseHandle(ProcInfo.hThread);
return exit_status;
}
return 1;
}
|
|
|
|
|
|
Hi, I have some data in char *szBuffer. I need to read the data fom the buffer nad put them into respected variable.
Suppose szBuffer returns "15,30\r\n CMD OK \r\n" , then I need to keep 15 in one variable,30 in other and CMD OK in other variable.
Can anyone help me how to do this. Any sample code will be good help for me.
Thanks..
|
|
|
|
|