|
To Call Exe File in VC ++ you have to use the Buildin Function
"Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long"
Hwnd as user Handle
lpOperation as operation i.e. "open","print"
lpFile as path of exe file
thanks,
Pavanbhai Pawar
Software Programmer,
Trans Tech Projects Pvt. Ltd.
Pune 411 004.
Mob: 9225527829
E-Mail Id:pawar@transtechprojects.com
Personal ID : pavanbhai_pawar@yahoo.com
|
|
|
|
|
you can use ShellExecute to call any exe from ur application
|
|
|
|
|
theer are numerous apis for achieving that like
<ul>
<li>ShellExecute/ShellExecuteEx
<li>WinExec
<li>CreateProcess
</ul>
|
|
|
|
|
HANDLE hProcess = NULL;
SHELLEXECUTEINFO shellInfo;
::ZeroMemory(&shellInfo, sizeof(shellInfo));
shellInfo.cbSize = sizeof(shellInfo);
shellInfo.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
shellInfo.lpFile = your app file;
shellInfo.lpParameters = NULL;
if(::ShellExecuteEx(&shellInfo))
{ /* success */
hProcess = shellInfo.hProcess;
if(hProcess != NULL){
::WaitForSingleObject(hProcess, INFINITE);
::CloseHandle(hProcess);
}
}
|
|
|
|
|
can i pass parameter exe to another exe..
pls tell me... again...
thank u so much..
|
|
|
|
|
yes. ...
ex: shellInfo.lpFile = _T("e_airyun.exe");
|
|
|
|
|
|
?
please contact:
max_xiayi@hotmail.com
|
|
|
|
|
|
Please let me know, I also want to know if anyone has got a solution ?
Thanks in advance.
Ana
|
|
|
|
|
My class uses mathematic operation (time critical) and i want the window with progress bar appear, but i couldn't create a dynamic window, i tried this:
CWnd * pWnd = new CWnd;
pWnd->Create("asdf","asdf");
pWnd->ShowWindow(SW_SHOW);
But it doesn't work.
And another question = how to create a dialog window dynamically without using the resources?
|
|
|
|
|
is there a particular reason why you don't want to use the resources ? I would make your life simpler ...
BTW, you can't create a dialog by just using CWnd.
you need to create a DLGTEMPLATE and call InitModalIndirect ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
like this:
::ShowWindow(::CreateWindow("Button","Button1",WS_CHILD|WS_VISIBLE,10,10,100,50,m_hWnd,NULL,AfxGetApp()->m_hInstance,NULL),SW_NORMAL);
|
|
|
|
|
I'm writing a (COM-based) toolbar for IE. At some point I found "new" returned NULL whenever the data size became larger than 300K.
Then I tried ::HeapCreate to create a heap of initial size 1M, but when I used ::HeapAlloc to allocate a chunk of 500K, it said "not enough quota". (It works when the size is 300K, though)
Then I used IMalloc::Alloc to allocate memory, and allocating 1M memory succeeded.
I'm totally puzzled why new and HeapCreate failed and IMalloc would succeeded. Is there some kind of limit on the memory size of a DLL(as my toolbar is compiled into a DLL which is loaded by IE)?
Anybody has any idea?
Thanks a lot.
|
|
|
|
|
I am trying to design an mp3 player similar to winamp but I want some ideas on how should I save the location of every name of mp3 or audio file in the list.
I mean how do you think winamp stores it's list with music. Is it making a temporary file with all the files exactly e=when they are added and then if you double click a certain item in the list it serches for the text in the file and then the next line is the path . . . Can you please give me some ideas on how can i save the paths for the mp3-s of the list after it is loaded because I don't want the mp3-s to be stred in the list full path becasue they look horible.
Thank you.
gabby
|
|
|
|
|
WinAmp saves its playlist like an XML file. Just open the winamp's playlist in Visual Studio and you will exactly see the format.
Hope this helps.
Still Alone in this beautiful world
My Articles
|
|
|
|
|
|
In 2003 last time i checked its called "use managed extensions" property.
As far as using MC++ I'm not sure what to say. MC++ is going to be outdated very soon because Microsoft is working on enhanced support for .net with C++/CLI. The syntax is very different. There are going to be a few tools to help migrate but you still need to do a code review to make sure everything is right. But of course if you really need .net support then go for MC++
|
|
|
|
|
thank you for you advises and I'll update my codes.
|
|
|
|
|
Howdy all-
I want to write a DLLHOST replacement -- an EXE that can be called by IIS to generate output...
I already have an ISAPI DLL that does this stuff, but I want to get out of that, and into a model I have more control of.
Do any of you out there know how to do this?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
I want to change mdi child frame window size, instead of default size. I know I could change it at PreCreateWindow(). but at that time it's not known what size it should be. the size depends on view. so I change the size at view::InitialUpdate(), but it won't work.
void CMdiView::OnInitialUpdate()
{
// TODO: Add your specialized code here and/or call the base class
CChildFrame* p = (CChildFrame*)GetParent();
p->OnSize( SIZE_RESTORED, 800, 800 );
CView::OnInitialUpdate();
}
Can anybody tell me why?
|
|
|
|
|
Hello,
I'm trying to get my app to start up at location (10,10) of the Windows Desktop every time. In my current implementation, the app starts up at the Windows default location and then jumps to (10, 10)---kinda kludgy and it doesn't look good.
Is there a way to start my app in the right location without having to move it after it starts?
thanks,
JennyP
|
|
|
|
|
Position the app window in CmyApp::InitInstance() after the CMainFrame has been created and before ShowWindow() is called.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Thanks for the reply.
Here's the relevant code in InitInstance()...
........<br />
AddDocTemplate(pDocTemplate);<br />
CCommandLineInfo cmdInfo;<br />
ParseCommandLine(cmdInfo);<br />
if (!ProcessShellCommand(cmdInfo))<br />
return FALSE;<br />
<br />
m_pMainWnd->SetWindowPos(0,50,50,840,860,SWP_NOZORDER);<br />
<br />
m_pMainWnd->ShowWindow(SW_SHOW);<br />
m_pMainWnd->UpdateWindow();
Using the debugger, I see that the window actually paints (in the wrong place) upon the execution of ProcessShellCommand(). Hmmm.... I cannot put SetWindowPos() above this because the window (as evidenced by the errors) hasn't been created yet. Should I be intercepting another message from a process that executes inside ProcessShellCommand()?
thanks,
JennyP
|
|
|
|
|
CCommandLineInfo::CCommandLineInfo() inits: m_nShellCommand =FileNew
This means ProcessShellCommand() will create an emtpy new document. This maybe causing the app window to display ealier than you want. Step through ProcessShellCommand() and see what it is doing. You may wnt to overide it and do your own thing or if you don't want an new document created add:
if ( cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew )
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
before calling: ProcessShellCommand().
Looking at the MFC source code in your editor is worthwhile.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|