|
I'm just curious before I can give you an answer, why can you not just launch the second application with command lines already? Why the extra 'launcher' application?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
The end user has the requiremet like that. he want to launch the application with a icon click on desktop.....
birajendu
CyberG India
Delhi
India
|
|
|
|
|
why not create a shortcut for your customer?
|
|
|
|
|
You could do something like this:
#include <windows.h>
#include <tchar.h>
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPTSTR lpCmdLine, int nCmdShow)
{
<a href="http://msdn.microsoft.com/en-us/library/ms682512(VS.85).aspx">CreateProcess</a>[<a href="http://msdn.microsoft.com/en-us/library/ms682512(VS.85).aspx" target="_blank" title="New Window">^</a>]
return false;
} You might as well use ShellExecute or ShellExecuteEx , like Michael Schubert suggested.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
So why not just change the shortcut to include the necessary arguments?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Create a "Win32 Application" project. it won,t be having any GUI or console by default.
|
|
|
|
|
Something like this maybe:
#include <windows.h>
#include <shellapi.h>
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "program.exe";
ShExecInfo.lpParameters = "-switch1 -switch2";
ShExecInfo.lpDirectory = "c:\\yourpath";
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
return 0;
}
|
|
|
|
|
Thanks,
I tried this and also CreateProcess(), but my problem is i dont want the console window of the parent application. I am creating a win 32 project in visual studio 2005.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
The code I supplied (same for Rajesh's suggestion) doesn't create any window, neither console nor GUI.
|
|
|
|
|
I don't see how can you see a window when the code creates none... You have probably created a Win32 console application. You need to create a Win32 application instead.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I want to get the "Enter" Key down notification from a ClistCtrl. I have handled the LVN_KEYDOWN but the parent window is not notified when "Enter" Key is pressed and the Parent window is notifies when all other keys are down. How can i get notified when "Enter" key is pressed.
I tried using NM_ENTER but nothing happened.
thanks
Nitheesh
Jose Jo Martin
http://www.simpletools.co.in
|
|
|
|
|
why don't you use spy++ tool to get the notification
|
|
|
|
|
Hi ,
I want to handle the "Enter" key event on the parent window.
Do u have an idea.
Jose Jo Martin
http://www.simpletools.co.in
|
|
|
|
|
If your list is on a dialog box you can use this trick:
In the OnOK handler of the dialog check if the focus is on your list control or not, if it is, then the user pressed the ENTER key in your list. Don't know if this aproach has any drawbacks or glitches in it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
thanks for your reply. Unfortunately my Listview is in CFormView. So this trick is not going to work for me. Any other method other than subclassing the ClistCtrl?.
thanks
Nitheesh
Jose Jo Martin
http://www.simpletools.co.in
|
|
|
|
|
I'm having a problem using this function of the MFC List Control class
I've read the article : Example of CListCtrl::SortItems(...) in MSDN By Ivor S. Sargoytchev
Example of CListCtrl::SortItems(...) in MSDN[^]
And am trying out his example Callback funtion this way:
static int CALLBACK CompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, 0);
CString strItem2 = pListCtrl->GetItemText(lParam2, 0);
return _tcscmp(strItem1, strItem2);
}
Relevant Code:
LVCOLUMN lvColumn;
int nCol =0;
lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 120;
lvColumn.pszText = ColumnHeading[0];
nCol = m_MainList.InsertColumn(0, &lvColumn);
int NextIndex = nCol;
.
.
.
TCHAR Output[50]={0};
while (<Not EOF>)
{
<Read from file a string and copy into Output>
LVITEM lvItem;
lvItem.mask = LVIF_TEXT;
lvItem.iItem = NextIndex;
lvItem.iSubItem = 0;
lvItem.pszText = Output;
NextIndex = m_MainList.InsertItem(&lvItem);
}
m_MainList.SortItems(CompareProc, (LPARAM)&m_MainList);
m_MainList is the Control variable for a List Control box I placed on a dialog
I put a breakpoint inside the Sort Function CompareProc and found that lParam1 and lParam2 are always 0 constantly and never increasing.
I have been told it could be a pointer issue, but I don't get it. Can anyone help?
Thanks
|
|
|
|
|
JJeffrey wrote: I put a breakpoint inside the Sort Function CompareProc and found that lParam1 and lParam2 are always 0 constantly and never increasing.
When you use the SortItems() function, the lParam1 and lParam2 passed to the CompareProc are not item indexes, but Item data corrsponding to each item in the list control. I must says its bit difficult to sort if you use the SortItems() function. Sortitems() wrapper the message LVM_SORTITEMS . But there is another message called LVM_SORTITEMSEX , which will work as you expected.
So instead of m_MainList.SortItems(CompareProc, (LPARAM)&m_MainList); , call
ListView_SortItemsEx( m_MainList.m_hWnd, CompareProc, (LPARAM)&m_MainList );
|
|
|
|
|
Thank you. That solved it.
So it's mostly Microsoft's fault then? For coming up with that stupid function?
Really. Thanks. Was working on trying to make it work for a day now.
|
|
|
|
|
You are welcome.
JJeffrey wrote: So it's mostly Microsoft's fault then? For coming up with that stupid function?
During te sorting process, the list-view contents are unstable. So in the intial versions of common control, I guess they might have felt some difficulty is passing the item indexes to the compare function.
Later from the comctl32.dll version 5.80, they added the support for the LVM_SORTITEMSEX message. They might have found some work around later..
|
|
|
|
|
For future reference, when adding items to the control, you'll also need to call SetItemData() . This is because SortItems() internally calls GetItemData() (or an equivalent) before calling your comparison routine.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I need some help here from anyone on creating a program that simulates the call traffic distributed between call center workers. I don't have a clue on how to start this one. I also need it to estimate the hold and call time for callers based on specific conditions. So is there anyone who has any clue on doing one such as this program or done something like it. I'm all ears here and clueless
|
|
|
|
|
Start reading here [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There are too many parameters to consider before you could put this on the C++ forum.
1. What technology is being used? Actual telephone lines or VOIP lines? In either case, do you already have control over them? (A TAPI library module which tracks the calls and routings in case of the former and a VOIP library module operating/controlling the call flow in case of later, what kind of hardware is used in case of later, etc.,)
2. Are client modules written and running on the nodes to track the call status (idle/ringing/on hold/busy, etc.,)
3. Are the statistics being calculated already / halfway through / yet to begin.
4. Oh wait, you just want simulation? I can go on, but what the heck!
Seriously, come back only after you have specific questions, with relevance to C/C++/MFC. Nobody is going to write an entire application for you. If you are looking for ideas, find and go off to the general discussions/project discussions forum or something similar, where it would make sense.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
My 5 for taking so much of effort and typing in
|
|
|
|
|
I usually try and ignore such pointless questions, but sometimes I just have to vent it out.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|