|
I think I get your question now. Have you set the tab order in design time?
Layout menu->Tab Order
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Yes.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Is the edit control too included in the tab order list?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
In my Dialog I have 8 textbox all are in tab order.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
How you are invoking that dialog bat ? Just test by using ctrl + T in resource editor(that will invoke dialog bar). And then use tab.
I just made a simple(Hello world) win32 application using VS2005. And insert dialog bar as resource, added two edit boxes, with tab stop property set to true. And tested that using Ctrl + T . It works fine for me.
|
|
|
|
|
Wonder!!
Its happening with me only
prasad_som wrote: I just made a simple(Hello world) win32 application using VS2005
Can you please provide me your link ?
If possible , please Resource is very important.
I am working in vs2005 same but
One thing I want to ask you which one is you have used when you insert your dialog.
There are two option after right click.
1)Add resource
2)Insert Dialog
I had use first one then click on "+" sign and use first "IDD_DIALOGBAR".
I had stretch it make it propersize remove "TODO:layout dialog bar" put 8 edit box controls setting tab order 1 to 8 and set property true when run the application and hit Tab key the "Beep" come.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
How you are creating this dialog bar in application ?
Have you used ctrl + T to test it from resource editor only ?
|
|
|
|
|
ya when i use CTRL + T it workign but when in the running mode it gives the "beep" and no any cursor
movement in edit control.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
You have not answered other question. How you have created it?
|
|
|
|
|
as child window.
following way.
There is one callback navigatepro which contain static hyperlink and few child widnow one fo them is
hwndTagEditorDlg = CreateDialog(hInst,MAKEINTRESOURCE(IDD_TAGEDITOR),hWndStatic,(DLGPROC)agEditorProc);
it can open two ways
1) when user click on tageditor
2) when user click on listview's one file item it show below the listview control
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Now I understand your problem. And I dont have solutino to it.
But, I wonder , why you are using dialog bar , in first place ?
|
|
|
|
|
I missed my last train !!!
prasad_som wrote: But, I wonder , why you are using dialog bar , in first place ?
Then , What should I used ?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Why you are using dialog bar, when same can be achieved using dialog box ?
|
|
|
|
|
but there is one problem of title bar and frame, becoz I am using menu nevigation for each window.
except the about dialog all are IDD_DIALOGBAR, and I have set the postion(x,y) of all dialogs.
if is there any suggestion? ever welcome.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
i am working an application that uses a file for some purpose. i am creating that file by using CreateFile() function. Now, i want to make sure that no other application uses that File till me application closes. i.e, i want no other application to access the file (not even for reading) as long as my application is running. how can i do this?
Regards,
Srinivas
|
|
|
|
|
Use dwShareMode as NULL while using CreateFile API.
|
|
|
|
|
No, it is not working for me. i don't know what mistake i am doing. here is the sample code of what i have written
<br />
<br />
hFile = CreateFile ( strFileName,GENERIC_WRITE ,NULL,NULL,CREATE_ALWAYS ,FILE_ATTRIBUTE_NORMAL,NULL);<br />
<br />
after creation of the file, i write the data to that file. now i dont want any other application to access that File till i close my application. how can i do this? thanks..
Regards,
Srinivas
|
|
|
|
|
vasu_sri wrote: No, it is not working for me.
How you are verifying this.
vasu_sri wrote: now i dont want any other application to access that File till i close my application.
Yes, by above code, no other application could access the file, till handle is closed.
vasu_sri wrote: how can i do this?
Its already shown.
|
|
|
|
|
In addition to what Prasad said:
if you're using MFC and CFile , you should use the CFile::shareExclusive flag when opening the file.
Read more here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
HANDLE hFile = CreateFile(
psFile,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
DWORD dwErr = GetLastError();
...
CloseHandle(hFile);
|
|
|
|
|
If I call AddString() to add a string to a listbox,how can I get it in the structure lpDrawItemStruct in DrawItem?Is the string saved in lpDrawItemStruct->itemData?
And what is difference between calling AddString and SetItemData?
Thanks~
|
|
|
|
|
IT_DOER wrote: Is the string saved in lpDrawItemStruct->itemData?
Yes.
IT_DOER wrote: And what is difference between calling AddString and SetItemData?
Doesn't MSDN satisfy your query ?
|
|
|
|
|
I am refering to a example about ListBox,and it creates a function AddItem like this:
void CListBoxEx::AddItem(UINT IconID, LPCTSTR lpszText)
{
//Adds a string ans assigns nIndex the index of the current item
int nIndex=AddString(lpszText);
//If no error, associates the index with the bitmap ID
if (nIndex!=LB_ERR && nIndex!=LB_ERRSPACE)
SetItemData(nIndex, IconID);
}
It calls AddString and after it calls SetItemData,whether the data of string and the bitmap both are save in lpDrawItemStruct->itemData?I am puzzled~
And I call the AddString("1");
and get the string and in DrawItem like this:
CString* pt_str=(CString*)lpDrawItemStruct->itemData;
dc.TextOut(lpDrawItemStruct->rcItem.left+4,lpDrawItemStruct->rcItem.top+2,
*pt_str);
is it correct?
|
|
|
|
|
IT_DOER wrote: Is the string saved in lpDrawItemStruct->itemData
Yes, it is passed as lpDrawItemStruct->itemData in DrawItem , see the folowing excerpt from MSDN:
...
void CMyListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
ASSERT(lpDrawItemStruct->CtlType == ODT_LISTBOX);
LPCTSTR lpszText = (LPCTSTR) lpDrawItemStruct->itemData;
...
IT_DOER wrote: And what is difference between calling AddString and SetItemData?
with SetItemData , you can associate e 32-bit integer to each item of the list (it is a value completely independent from the item text ). Again, see the following sample from MSDN:
extern CListBox* pmyListBox;
for (int i=0;i < pmyListBox->GetCount();i++)
{
pmyListBox->SetItemData(i, i);
}
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.
|
|
|
|
|
I am refering to a example about ListBox,and it creates a function AddItem like this:
void CListBoxEx::AddItem(UINT IconID, LPCTSTR lpszText)
{
//Adds a string ans assigns nIndex the index of the current item
int nIndex=AddString(lpszText);
//If no error, associates the index with the bitmap ID
if (nIndex!=LB_ERR && nIndex!=LB_ERRSPACE)
SetItemData(nIndex, IconID);
}
It calls AddString and after it calls SetItemData,whether the data of string and the bitmap both are save in lpDrawItemStruct->itemData?I am puzzled~
|
|
|
|