|
Hi
How can I change the position of the dialog box which is created from CFileDialog? This is not work;
TCHAR strFilter[] = { TEXT("Files (*.*)|*.*||") };<br />
CFileDialog dlg(TRUE, TEXT(".*"), NULL, 0, strFilter,this);<br />
dlg.SetWindowPos(&wndTop,0,0,20,30,SWP_SHOWWINDOW);
Thanks
|
|
|
|
|
iayd wrote: This is not work;
Because, you are using API, on uninitialized window.
Try to create it modelles. If you want it modal, then derive a class from CFileDialog and use SetWindowPos or MoveWindow in OnInitDialog .
Prasad
MS MVP - VC++
|
|
|
|
|
But still I cannot change the width of dialog box.I want a narrower diialog box.I used SetwindowPos in OnInitDialog.Is there a solution for this problem.
|
|
|
|
|
As told earlier, MoveWindow or API mentioned by you can be used. Make sure, you are using these API's after initialization of window handle.
Prasad
MS MVP - VC++
|
|
|
|
|
Modeless or modal, this will not work. You'll need to provide a hook (OFN_ENABLEHOOK ). In that hook procedure, respond to the WM_INITDIALOG message, and call SetWindowPos() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hoe will I do waht you said?Can you write a sample code?
Thanks
|
|
|
|
|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm pretty sure MFC hooks the dialog for you. Why not just derive a class from CFileDialog and
call MoveWindow() in a WM_INITDIALOG handler?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I want to know how to see the Intermediate code after Preprocessing and before Compilation. i.e, when we use macros, is there a way to see the exact code after the macro is expanded.
Thanks & Regards,
Dhana
|
|
|
|
|
Hi. I can tell u. But first respond to this.
Come online at:-
jubinc@skype
|
|
|
|
|
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.
|
|
|
|
|
Visual Studio 6:
choose the menu item Project->Settings, then add the option /E to the Project Options textbox, finally Compile the relevant source file, you will see the preprocessing result in the IDE build window.
For detailed info about /E compiler option, see http://msdn2.microsoft.com/en-us/library/3xkfswhy(VS.80).aspx[^].
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.
|
|
|
|
|
Hi,
This may be the odd question, but still i putting that, can string from string table can be assigned to a control's caption such as button or label at design time.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
CString cDlgItemTxt;
cDlgItemTxt.LoadString( IDS_STRINGTABLEID );
GetDlgItem( ID_DLGITEM )->SetWindowText( cDlgItemTxt );
|
|
|
|
|
koos slager wrote: CString cDlgItemTxt;
cDlgItemTxt.LoadString( IDS_STRINGTABLEID );
GetDlgItem( ID_DLGITEM )->SetWindowText( cDlgItemTxt );
the value is assigned to a control's caption at run time, but i am talking about at design time.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
I’m sorry didn’t read your question very well.
As far as I know it is impossible.
Here you can read the Parameters you can pass to a control http://msdn2.microsoft.com/en-us/library/aa380902.aspx created in the resource.
I tried to manually insert a string table Id, after reordering the resource (putting the string table before the dialog’s definition, but it didn’t work.
|
|
|
|
|
Can't you go to the string table, select the string you want, control+c, and then control+v in the caption of your static?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Wow! How did you accomplished all that at design time?
-- modified at 4:47 Tuesday 31st July, 2007
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.
|
|
|
|
|
Trying to make a small notification window in vc++ , like you might know from Firefox (download finished) or Thunderbird (new emails). My problem is that when I show it and the main
form(Parent window) is also poped with nitification window.... How to prevent this
Pls help me.............
|
|
|
|
|
I'm not sure but I think this is because when you intercepthe message you use to show the dialog box it gives automatically the focus to your application and your CFormView is shown as consequence. Maybe you can made something like ParentView.SetFocus (FALSE) or ParentWidnow.ShowWindow (FALSE) at the beggining of your code, and the opposite when you re-need it.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
have a look
http://www.codeguru.com/Cpp/controls/statusbar/article.php/c5937/
Ashish K
|
|
|
|
|
As per my understanding you might have been using a popup window/dialog. If so give the parent window as desktop. Use GetDesktopWindow API
- NS -
|
|
|
|
|
Parasing website data : intermitten rubbish characters retrived
hi, i am making a program to parse data from website, to do that i need to download the file
Step1: download file
CString Data;<br />
DeleteUrlCacheEntry(url);
<br />
HINTERNET IntOpen = ::InternetOpen("Sample", LOCAL_INTERNET_ACCESS, NULL, 0, 0);<br />
HINTERNET handle = ::InternetOpenUrl(IntOpen, url, NULL, NULL, NULL, NULL);<br />
HANDLE hFile = ::CreateFile("c:\\index.txt", GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br />
<br />
char Buffer[1024];<br />
DWORD dwRead =0;<br />
while(::InternetReadFile(handle, Buffer, sizeof(Buffer), &dwRead) == TRUE)<br />
{<br />
if ( dwRead == 0) <br />
break;<br />
DWORD dwWrite = 0;<br />
::WriteFile(hFile, Buffer, dwRead, &dwWrite, NULL);<br />
Data+=Buffer;<br />
}<br />
<br />
::CloseHandle(hFile);<br />
::InternetCloseHandle(handle);<br />
the Cstring "Data" contains the website in a plain text
step2 : parse the data using brackets
because a lot of data in within <> brackets, this can be used to reference the desired data
<br />
CString Mydialog::Parse_Backets(CString file_string, CString item, int bracket_distance)<br />
{<br />
file_string.ReleaseBuffer();<br />
<br />
int start_index;<br />
int end_index;<br />
start_index = file_string.Find(item);<br />
if(start_index == -1)<br />
{<br />
CString error_string = "Error";<br />
error_flag = 1;<br />
return error_string;<br />
}<br />
for(int i =0; i <bracket_distance; i++)<br />
{<br />
start_index = file_string.Find(">",start_index)+1;<br />
}<br />
end_index = file_string.Find("<",start_index) - 1;<br />
file_string=file_string.Mid(start_index, end_index-start_index+1 );<br />
return file_string;<br />
}
now the problem is once in a while i get rubbish characters. Like the actual value when i browse to the website, should be 0.55 , i get 0.aj5m5, or even 0.1595
the website is http://stquote.sgx.com/live/st/STStock.asp?stk=G
does anyone knows how to solve this problem?
using:
- mfc
- VC6.0
|
|
|
|
|
There is no indication in the documentation for InternetReadFile that the buffer will be null terminated on return, therefore your line Data+=Buffer; will inevitably add extra rubbish characters to Data.
|
|
|
|
|
yes, how do i solve this problem? it doesnt put any null character
|
|
|
|