|
ThatsMe. wrote: ...when i click on Tree ctrl the selected string is lost there is no string.
So are you deleting it from the list control?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no i don't want to delete it ,it is just bemomes NULL after click on tree view.
i want to perform any action like open any dialog according to selected string from list view.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: ...it is just bemomes NULL after click on tree view.
So are you adding a NULL item, or changing an existing item to NULL ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
No i want to use it same as selected from ListCtrl.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
i dont know how can selected string becomes NULL.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Assuming you are using MFC, you've likely got something like:
int nIndex = m_list.GetNextItem(-1, LVNI_SELECTED);
CString strItem = m_list.GetItemText(nIndex, 0); Now until you assign another value to strItem , it will retain its value indefinitely. Interacting with a tree control has nothing to do with it.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ThatsMe. wrote: ...i want to use it same as selected from ListCtrl.
This makes no sense. What are you trying to say?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I have created a MFC Activex Control using C++ and I am trying to use that control in C# Windows Application. During Build it shows error as:
EgActivexCtrl fatal error LNK1104: cannot open file 'Debug/EgActivexCtrl.ocx'
Please help me to sort out this error... Thanks
Palanivel
|
|
|
|
|
i was trying to get white color in my application.
my background is grey. when i try to bitblt my dc with paint dc in onpaint i am using SRCPAINT.
so white color is becoming grey.
|
|
|
|
|
if you want the background color of your application to white handle WM_ERASEBKGND and Fill with white color,
CWnd::OnEraseBkgnd(CDC *pDC)
{
pDC->PatBlt(..., WHITENESS) or pDC->FillRect()
}
|
|
|
|
|
|
Hi All,
I am developing an application in which I need to connect to a server and send some commands and retrieve the response. For this, I am using a third party console client application called Plink. Plink requires a console window to start and it cannot be opened by double clicking it. The entire process of login and sending commands and receiving response is automated in my application. Also plink has to be started with a initial command "plink <protocol> <server ip="">".
Code flow:
------------
m_Stdout = GetStdHandle(STD_OUTPUT_HANDLE);
m_StdIn = GetStdHandle(STD_INPUT_HANDLE);
SecureZeroMemory(&m_ProcInfo,sizeof(PROCESS_INFORMATION));
SecureZeroMemory(&m_StartInfo,sizeof(STARTUPINFO));
// Set up members of the STARTUPINFO structure.
m_StartInfo.cb = sizeof(STARTUPINFO);
m_StartInfo.hStdError = m_Stdout;
m_StartInfo.hStdOutput = m_Stdout;
m_StartInfo.hStdInput = m_StdIn;
m_StartInfo.dwFlags = STARTF_USESTDHANDLES;
// Create the child process.
wcscpy(m_Cmdline,_T("plink -telnet <server ip="">")); // server IP is not typed here for security purpose
m_RetVal = CreateProcess(0,
m_Cmdline, // command line
NULL, // process security attributes
NULL, // primary thread security attributes
TRUE, // handles are inherited
0, // creation flags
NULL, // use parent's environment
NULL, // use parent's current directory
&m_StartInfo, // STARTUPINFO pointer
&m_ProcInfo); // receives PROCESS_INFORMATION
memset(m_UserName,0,BUFSIZE);
wcscpy(m_UserName,_T("pdt2"));
wcscat(m_UserName,_T("\r\n"));
m_BytesToWrite = wcslen(m_UserName);
m_RetVal = WriteConsole(m_Stdout,m_UserName,m_BytesToWrite,&dwWritten,NULL);
if(m_RetVal)
{
fprintf(m_FilePtr,"Write to console succeeded\n");
ReadFromConsole();
}
else
{
m_ErrorCode = WSAGetLastError();
ErrorExit("Write To Console failed",m_ErrorCode);
}
-------------
This is where it fails. After writing the username string to the console, I should get back the password prompt in the console window which doesnt happen.The WriteConsole API succeeds and returns 1 but the application doesnt get back the password prompt as should be the case.In WriteConsole API I pass the standard output handle m_Stdout.
Can anyone say whats going wrong?
Thanks in advance for any kind of help.
Jyoti
|
|
|
|
|
Console expects "\n" as newline character rather then "\r\n".
-Saurabh
|
|
|
|
|
Hi Saurabh,
Thanks for replying.
I even tried with "\n" only but that too is not working.I suspect that WriteConsole is writing to the standard output but console is not able to send the username string to the server. Or may be we need to send the username to Plink somehow so that it sends the username to the server.
Thanks,
Jyoti
|
|
|
|
|
Member 4744683 wrote: m_RetVal = WriteConsole(m_Stdout,m_UserName,m_BytesToWrite,&dwWritten,NULL);
What is the value of dwWritten after this call?
Member 4744683 wrote: After writing the username string to the console...
Do you see it being written, or are you just assuming?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
Can anyone kindly show me some sample code how to execute Oracle stored procedure in Vc++?
|
|
|
|
|
I'm not an expert in DB related thing but still
You can use SQLExecute function[^] execute stored procedure
Please check ODBC API reference[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
|
|
My application is in system tray, how can I post a messsage to it.
I think first I have to obtained the HWND of window but I am unable to do it.
Yesterday I asked the same question but could not get any asnwer.
I have tried with FindWindow(),EnumWindow() but not succed to find the window handle that is in system tray.
Can anybody help me?
|
|
|
|
|
See yesterday also I told you FindWindow and FindWindowEx work fine for my application which minimized to system tray. So the problem you are facing must be due to the way you are minimizing to system tray. Can you share are are you doing that?
-Saurabh
|
|
|
|
|
Sure, My code is like
m_TrayIcon.MinimizeToTray(this);
m_TrayIcon.MaximizeFromTray(this);
I am using 3rd party class to minimize the application
|
|
|
|
|
Well then the question becomes, "How does the 3rd party library minimize the application?" Can you find the window before it's minimized?
Steve
|
|
|
|
|
Just from name of variable I cannot figure about how class is implemented. Can you tell more about implementation about the class?
-Saurabh
|
|
|
|
|
ok, Let me minimise the application with my own code then I will back to you.
Thanks .
|
|
|
|