|
Dear All,
I want to stop user interaction with dialogs.
How can i do this ?
Thanks.
bye.
|
|
|
|
|
What do you want to achieve ,exactly ?
|
|
|
|
|
Hi.,
I am doing a remotly managable program. There I want to manage a dialog application that is at client side. Client application having some buttons, menu and all.
I want to disable application window interaction from user so as to user can not modify any changes on that application dialog.
But it shows the status or some stable text. thats it.
Bye.
|
|
|
|
|
Sakthiu wrote: I want to disable application window interaction from user so as to user can not modify any changes on that application dialog.
But it shows the status or some stable text. thats it.
Whats problem then ? If you are showing information as text.
If you are worried about buttons to be clicked( I'm not sure, if they are there), you can always handle them.
|
|
|
|
|
i have two questions.
1)I need to count the items in the list view.
in my project i opened the file dialog and that selected file is display in the
listview if the same file is selected it gives message of duplication of file.
2)i want to set the default value in combo box.
i am using win32 in .net enviorment.
thanks with
amit
|
|
|
|
|
amitmistry_petlad wrote: 1)I need to count the items in the list view.
Use ,
SendMessage( (HWND) hWnd, LB_GETCOUNT, 0,0);
amitmistry_petlad wrote: 2)i want to set the default value in combo box.
I'm not sure, what you want to do ?
|
|
|
|
|
thank you ,gives the count value zero when i debug it.
will it work for listview?
i am not sure but i think it is for listbox not for listview control.
because the listview has some columns so i think we have to find the column number first and then we have to count the items.is it?
do you have any artical on the base of list view count items ? or link?
amit
|
|
|
|
|
amitmistry_petlad wrote: am not sure but i think it is for listbox not for listview control
Yes it is.
For list view , you can use,
SendMessage(hView,LVM_GETITEMCOUNT ,0,0);
|
|
|
|
|
still gives the zero value, after adding files in the listview
here is the code
case CBN_SELCHANGE :
int iCheck = (int)SendMessage((HWND)GetDlgItem(hDlg , IDC_COMBO1 ), CB_GETCURSEL, (WPARAM)0, (LPARAM)0);
if(iCheck !=0)
{
if(iCheck != 2)
{
uploadedFile = util.GetFile(NULL);
}
else
{
uploadedFile = util.BrowserDirectory();
if(uploadedFile != "")
uploadedFile += "\\";
}
if(uploadedFile != "")
{
//Check if the item is already added or not
HWND hwndListbox = GetDlgItem(hDlg,IDC_LIST4);
LRESULT iCount = SendMessage(hwndListbox,LVM_GETCOLUMN,0,0);
bool valid = true;
if(iCount > 0)
{
for(int i=0;i<iCount;i++)
{
WCHAR szInputFile[MAX_PATH];
SendMessage(hwndListbox,LB_GETTEXT,i,(LPARAM)szInputFile);
if(wcslen(szInputFile) > 0)
{
string sIn = util.ConvertWCHARToString(szInputFile);
if(sIn == uploadedFile)
{
valid = false;
MessageBox(hDlg,_T("This item is already added to the list."),_T("Encode"),MB_ICONINFORMATION);
break;
}
}
}
}
amit
|
|
|
|
|
amitmistry_petlad wrote: //Check if the item is already added or not
HWND hwndListbox = GetDlgItem(hDlg,IDC_LIST4);
LRESULT iCount = SendMessage(hwndListbox,LVM_GETCOLUMN,0,0);
It is lisbox , I guess. Then you need to use, LB_GETCOUNT wioth SendMessage .
Does list box contains some item ?
|
|
|
|
|
no,no
please dont guess list box it is list view
dont go on the varibal names and MESSAGE
e.g
hwndListbox,LB_GETTEXT
it is listview dear.
amit
|
|
|
|
|
amitmistry_petlad wrote: hwndListbox
Its really bad coding convention.Thats why I assumed it as list box.
I dont see any reason why ListView_GetItemCount should not work with list view, if it contains items.
|
|
|
|
|
Dear prasad,
well i am new comer in the win32 programming so sorry for asking some stupid
questions.
ListView_GetItemCount(hwndListview);
is working but now there is problem with the fetching out string from the
listview's first 0 column.
1) for string it is not supported,
2)it might support for WCHAR but when i convert it into string its not convert into string it gives ? mark at debugging time.
code :
<br />
string Utility::ConvertWCHARToString(LPCWSTR source)<br />
{<br />
try<br />
{<br />
size_t len = wcslen(source) * sizeof(LPCWSTR);<br />
char* tempOutFile = new char[len];<br />
WideCharToMultiByte(CP_ACP,0,source,-1,tempOutFile,(int)len,NULL,NULL);<br />
@ the time of debugging<br />
string s = tempOutFile;<br />
if(tempOutFile)<br />
{<br />
delete[] tempOutFile;<br />
}<br />
return s;<br />
}<br />
catch(exception ex)<br />
{<br />
throw ex;<br />
}<br />
}<br />
<br />
3)so i have taken char buff[500],
for that it works fine, but when it convert into string(buff_input) it gives first char and terminate .
i also knew the reason for that i have remark when i had debug the code
in char buffer it show me the null(0) value after every character.
like e.g buff[0] | a
buff[1] | 0
buff[2] | b
buff[3] | 0
buff[4] | c
means @ all the odd position it gives me the null so the string will terminate
immidate after buff[1] so it shows first character only when convert into string
ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);
std::string buff_input(buff);
which one is suitable (1),(2),(3)? give me the guide line master
-- modified at 9:19 Wednesday 27th December, 2006
|
|
|
|
|
amitmistry_petlad wrote: means @ all the odd position it gives me the null so the string will terminate
immidate after buff[1] so it shows first character only when convert into string
It is because, you are using UNICODE configuration.
amitmistry_petlad wrote: ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);
std::string buff_input(buff);
Modify this to,
THCAR buff[MAX_PATH]={0};
ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);
std::wstring buff_input(buff);
Remember, TCHAR becomes wchar_t for UNICODE and char for ANSI . And std::wstring you need to use for wide char string(which is case in UNICODE ), in ANSI you need to use std::string .
|
|
|
|
|
Hell All
I want some information about VC++.net that can we use all API in VC++6.0 in VC++.net. Is there any API which can not used in VC++.net but in VC++ 6.0.
Thanks and Regards
Atool
Atool
|
|
|
|
|
never say die
|
|
|
|
|
Refer this[^] link.
With higher version, their is support for new functionality.
M. Atul wrote: Is there any API which can not used in VC++.net but in VC++ 6.0.
Provided link should satisfy your query. There are some functions you use, but marked as depreceted.
|
|
|
|
|
|
I have send mail programitally using smtp...
But now i want to enhance my application
What i want to do is i want to provide authentication to smtp server...
How to do it???
|
|
|
|
|
use smtpclient class
never say die
|
|
|
|
|
hi every one
please tell me where do delete "achdata pointer" in this code ?
char* achData=new char[100];
strcpy(achData,"Hello");
<br />
for(;;)<br />
{<br />
char *ch=new char[100];<br />
<br />
strcat(ch,achData);<br />
<br />
if(ch)<br />
{<br />
delete[] ch;<br />
ch=NULL;<br />
}<br />
}<br />
<br />
if(achData)
{<br />
delete[] achData;<br />
achData=NULL;<br />
}
|
|
|
|
|
I assume this is a joke, because of the smiley face marking the problem line.
You will never get to the code that deletes "achdata" because of the infinite "for" loop.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John R. Shaw wrote: I assume this is a joke, because of the smiley face marking the problem line.
The smiley face was unintentional - a result of for( ; ; ), with the spaces removed.
|
|
|
|
|
I should have thought of that.
Note to self: Do not answer questions before your mourning coffee.
|
|
|
|
|
John R. Shaw wrote: your mourning coffee.
There, there... dont take it to heart.
|
|
|
|