|
Hi Prasad
thanks for your replay.
But i donnot know how to use comandline
Can you tell me a little briefly.
Thanks
nkb
|
|
|
|
|
aaaan wrote: But i donnot know how to use comandline
Use GetCommandLine , for getting commnad line parameters.
When running and exe, they are eimmediately followed by exe name.
We can use while running an exe.
c:\\MyExe.exe "prasad"
In example above "prasad" will be passed as parameter to exe. Which can be obtained using GetcommandLine from application.
See description of GetcommandLine for better understanding.
|
|
|
|
|
Well i have been waiting for your replay for the solution for
<br />
ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);<br />
i had my previous thread i asked you about the following.
i repeat it again.
the follwing is working but for the fetching ListView_GetItemText is not working. please let check our last discussion.
<br />
LRESULT iCount=ListView_GetItemCount(hwndListview); <br />
then i iterate the loop.
<br />
if(iCount > 0)<br />
{<br />
for(int i=0;i<iCount;i++)<br />
{<br />
WCHAR szInputFile[MAX_PATH];<br />
char buff[500];<br />
<br />
<br />
ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);<br />
std::string buff_input(buff);<br />
<br />
<br />
<br />
<br />
<br />
{<br />
<br />
<br />
if(buff_input == uploadedFile) <br />
{<br />
valid = false;<br />
MessageBox(hDlg,_T("This item is already added to the list."),_T("Encode"),MB_ICONINFORMATION);<br />
break;<br />
}<br />
} <br />
} <br />
}
i have tried to fetch the list view's first o colum strings in so many way
1) i have used string but no result gives ,error
2) using WHAR but when tring to convert it into string. it gives question mark
3)i have used char array but it gives me the result but when i am trying to convert it only convert first char and terminate.
i have checked everything with did debugging.
give me some idea or guid line to avoid the duplication in the list view control.
amit
|
|
|
|
|
amitmistry_petlad wrote: Question is for prasad_som
Should not ask specific person for answer on public forum. Here all good guys are to help you out.
amitmistry_petlad wrote: Well i have been waiting for your replay for the solution for
I've answered your previous post few minutes[^] back.
|
|
|
|
|
What happens when you run ListView_GetItemText and when you want to post your code before post your code use of Preview button
|
|
|
|
|
sorry for the subject name.
Dear whitesky,
i have put but why it takes entire red ?!! i dont know
ok ,
i am working in the existing project the old employee is doing the mix datatype (UNI & ANSI)
and coding and i have some changes in this current.now he had take string
and my output is in wstring. there is comparsion between this two
wstring == string
so i am trying the string into wstring in the following way.
<br />
TCHAR buff[MAX_PATH]={0}; ListView_GetItemText(hwndListview,i,0,(LPWSTR)&buff,MAX_PATH);<br />
std::wstring buff_input(buff);<br />
wchar_t tempupload[MAX_PATH]={0}; wsprintf(tempupload,L"%s",uploadedFile);
std::wstring wstr_upload(tempupload);<br />
if(buff_input.compare(tempupload)!=0)<br />
{<br />
valid = false; MessageBox(hDlg,_T("This item is already added to the list."),_T("Encode"),MB_ICONINFORMATION);<br />
break;<br />
}<br />
is it ok ? when i am debug it tempupload is null
then i have direct put in the following way.
std::wstring tempupload(uploadedFile);
but no fruitful result.
how can i make both compatible type so i can compare both string.
amit
|
|
|
|
|
amitmistry_petlad wrote: wsprintf(tempupload,L"%s",uploadedFile); //this uploadedFile is string
How uploadedFile is declared ? And initialized ?
|
|
|
|
|
i have done it with following code and its now working.
<br />
TCHAR buff[MAX_PATH]={0}; ListView_GetItemText(hwndListbox,i,0,(LPWSTR)&buff,MAX_PATH); std::wstring buff_input(buff); <br />
std::wstring wstr_upload(uploadedFile.begin(),uploadedFile.end()); int k=buff_input.compare(wstr_upload);<br />
thank you for replay me.
can u solve one more?
how can i set default value in combobox?
amit
|
|
|
|
|
amitmistry_petlad wrote: how can i set default value in combobox?
Can you explain in detail, what you want to do ?
|
|
|
|
|
i want to display the combo with selected value(index 0) at time of dialog intialize.
callback EncodeProc call, when user click on button
<br />
LRESULT CALLBACK EncodeProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)<br />
{<br />
string FileCombo[] = { "Please select files to add", "Add files", "Add folders"}; <br />
string QuiltityCombo[]={ "Best", "Middle", "Low"}; <br />
.<br />
. <br />
.<br />
.<br />
. <br />
<br />
switch(message) <br />
<br />
{<br />
<br />
case WM_INITDIALOG:<br />
hWndComboBox=GetDlgItem(hDlg,IDC_FILECOMBO); <br />
if( !hWndComboBox )<br />
{<br />
return FALSE;<br />
}<br />
<br />
for(int i=0;i<3;i++)<br />
{<br />
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,ComboBoxItems[i].c_str() ,(int)(ComboBoxItems[i].length() + 1),w_combolist,MAX_PATH);<br />
SendMessage(hWndComboBox,CB_ADDSTRING,0,(LPARAM)w_combolist);<br />
}<br />
SendMessage(hWndComboBox, LB_SETCURSEL,0, 0L ); <br />
<br />
hWndQulatiComboBox=GetDlgItem(hDlg,IDC_QULALITY_COMBO); <br />
if(!hWndQulatiComboBox)<br />
{<br />
return FALSE;<br />
} <br />
for(i=0;i<3;i++)<br />
{<br />
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,QuiltityComboBoxItems[i].c_str() ,(int)(QuiltityComboBoxItems[i].length() + 1),w_combolist,MAX_PATH);<br />
SendMessage(hWndQulatiComboBox,CB_ADDSTRING,0,(LPARAM)w_combolist); <br />
}<br />
SendMessage(hWndComboBox, LB_SETCURSEL,0, 0L ); <br />
<br />
break;<br />
<br />
1)
so when user click on button ,index zero is intialzed in combo with value
"Please select files to add" in first combobox
and
second "Best" in other combobox
2) parent/child combo box
third combo is parent, filled with some values come from external source
that i also want to intialze index 0 and on the base of this parent combo
there is one child combo fill by this parent which has also filled by external
source.
for the (2) I have total coding how the code come from external source.
amit
|
|
|
|
|
Then whats the problem ? You are using LB_SETCURSEL , which seems to be correct to me. Use CB_SETCURSEL .
-- modified at 5:18 Thursday 28th December, 2006
|
|
|
|
|
Then why its not dispaly the first zero index value in the combobox?
|
|
|
|
|
You have used LB_SETCURSEL instead of CB_SETCURSEL in SendMessage . Correct that.
|
|
|
|
|
Marvelous!!!!
Genius!!!!!
Your my Master!!!!
Thank you.
|
|
|
|
|
hi, i am indonesian, poor in english (*.*; )
how to adding image/icon on bar menu (command bar) for windows mobile using MFC ??
thanks before V(^ ^)
death by chocolate ^ ^
|
|
|
|
|
eantaru wrote: death by chocolate ^ ^
Good one
"I'd like to help but I don't feel like Googling it for you."
|
|
|
|
|
hehehehe, i like chocolate
|
|
|
|
|
Hi, I'm invoking ShellExecuteEx to launch another exe from my console application - the problem is, the call returns before the executing process is completed. Is there any way to get around this?
<br />
::ZeroMemory(&shellInfo, sizeof(shellInfo));<br />
<br />
shellInfo.cbSize = sizeof(shellInfo);<br />
shellInfo.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;<br />
shellInfo.lpFile = csCommand;<br />
shellInfo.lpParameters = csArgument;<br />
shellInfo.nShow = SW_HIDE;<br />
shellInfo.hMonitor = <br />
<br />
if (ShellExecuteEx(&shellInfo))<br />
{<br />
if (shellInfo.hProcess)<br />
{<br />
hProcess = shellInfo.hProcess;<br />
<br />
bSuccess = TRUE;<br />
}<br />
else<br />
{<br />
bSuccess = FALSE;<br />
}<br />
}<br />
else<br />
{<br />
bSuccess = FALSE;<br />
}
Thanks.
Norman Fung
|
|
|
|
|
Try searching for:
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
This should wait until it finishes.
Roy
|
|
|
|
|
if (shellInfo.hProcess)
{
hProcess = shellInfo.hProcess;
::WaitForSingleObject(hProcess, INFINITE);
*EDIT* Sorry baloneyman! I missed it by a minute
|
|
|
|
|
check the _cwait() function in msdn ... it includes an example
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
Solution here
<br />
BOOL bSuccess = TRUE;<br />
<br />
STARTUPINFO si = { sizeof(si) };<br />
PROCESS_INFORMATION pi;<br />
<br />
CString csCommand;<br />
CString csArgument;<br />
<br />
csCommand = strIsqlPath;<br />
<br />
csArgument = csCommand;<br />
csArgument += L" -U ";<br />
csArgument += strDBUsername;<br />
<br />
if(!strDBPassword.IsEmpty()) {<br />
csArgument += L" -P ";<br />
csArgument += strDBPassword;<br />
}<br />
<br />
csArgument += L" -S ";<br />
csArgument += strSourceServer;<br />
<br />
csArgument += L" -s, -w2500";<br />
<br />
csArgument += L" -i \"";<br />
csArgument += strSQLCmdPath;<br />
csArgument += L"\"";<br />
<br />
csArgument += L" -o \"";<br />
csArgument += strTradeExtractFilePath;<br />
csArgument += L"\"";<br />
<br />
try {<br />
<br />
if(<br />
CreateProcess(<br />
NULL,<br />
csArgument.GetBuffer(csArgument.GetLength()),<br />
NULL,<br />
NULL,<br />
NULL,<br />
NULL,<br />
NULL,<br />
NULL,<br />
&si,<br />
&pi<br />
)<br />
) {<br />
WaitForSingleObject(pi.hProcess, INFINITE);<br />
<br />
CloseHandle(pi.hProcess);<br />
CloseHandle(pi.hThread);<br />
}<br />
<br />
<br />
} catch(CException ex) {<br />
bSuccess = FALSE;<br />
ex.GetErrorMessage(errMsg, 0, NULL);<br />
}<br />
<br />
return bSuccess;<br />
-- modified at 20:36 Wednesday 27th December, 2006
Norman Fung
|
|
|
|
|
Hello everyone,
I want to write a program that gets input from the microphone. The volume of the input from the microphone will be used in a program. Based on the volume of the input, I want to increase the size of another variable.
Can anyone help with me this? where do I start from?
Thanks a million in advance.
Commickey
|
|
|
|
|
Commickey wrote: where do I start from?
Have you already decided to go with the Windows waveform audio system (waveIn, waveOut)?
If not, I would recommend examining the pros and cons of the different audio options:
For MCI and waveform audio there's
Windows Multimedia[^]
For DirectX (DirectSound) there's
DirectX SDK[^]
|
|
|
|
|
Thanks alot... I will consider ur suggestions...
Greetings,
Commickey
|
|
|
|
|