|
Okay, I'm very sorry if this is a newbie question and I think I may have even found this solution on here somewhere however that was a while back and I can't seem to locate it now. The question is this,
How does one programmically call an .exe from another application. I'm sure this is basic stuff but the solution escapes me.
Thanks for your patience.
|
|
|
|
|
|
Thanks! You guys are quick!
|
|
|
|
|
Use ::ShellExecute or ::CreateProcess. ShellExecute is much simpler, but CreateProcess gives you more control.
E.g.,
::ShellExecute(NULL, _T("open"), _T("YourProgram.exe"), _T("YourParameters"), NULL, SW_SHOW);
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Thanks again. Say it is possible to pass messages between both processes? If this something covered in MFC or is this something I have to perform using this command?
Thanks!
|
|
|
|
|
When starting, you can send command-line parameters from one to the other. Once both programs are up and running, you'll need to use IPC. Examples of that are DDE, pipes, data copy, RPC, to name a few.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Check out the IPC section on CodeProject - lots of good articles. There are several ways of communicating between processes, depending on what you need to do.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
i think the system() function can call the exe from the oter program. is there any comment
|
|
|
|
|
I have been trying to build my first DLL but keep getting the following error and have no idea what it means. The Help not very useful either.
WHL_DLL fatal error LNK1104: cannot open file 'c:\Program.obj'
I do not use the file Program.obj and it does not exist.
|
|
|
|
|
sweep123 wrote:
I do not use the file Program.obj
Have you verified that no references to this file exist in the project's .dsp file?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
One of the library files seems to have referenced this file. I have removed it as I dont seem to ned it at present.
However I now get the error when the DLL is loaded:-
no 'initialize' entry found in the TEST_DLL
I have been trying to write a DLL for the CSL scripting
http://csl.sourceforge.net/
The documentation is a bit light for this sharewear product.
|
|
|
|
|
I would welcome some help on this problem (Win32, MFC)...
I wish to ensure some text processing code always executes in the English locale. I have bracketed the code with setlocale() calls as follows:
:
// Native locale code
:
_tsetlocale(LC_ALL, _T("English"));
:
// text processing code, sprintf()s etc.
:
_tsetlocale(LC_ALL, _T("C"));
:
// Native locale code
:
Debugging through this code always shows the setlocale() calls succeeding (returning the selected locale string). However, the first time through, sprintf() floats are incorrectly output in the Native locale format, while the subsequent iterations through this code correctly produce English formatted numbers.
The text processing code exists in a static library written in plain C, while the surrounding code shown above is a C++ DLL linking to the static library.
Any ideas what might be causing this problem and how to solve it?
BlueShirt
|
|
|
|
|
Look up MSDN on setlocale - you will need to pass in something other than "Enlgish". On Windows, it is usually something screwy like Windows_English_CP1252 or whatever. I can never remember the exact strings.
You can also call setlocale with the empty string as a locale, and it will load whatever locale is your system default.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Hi !
I've a C++ question regarding the copy constructor.
Here is my example :
Let's say I've a class which contains a list of pointer on Polygons, called PolygonList.
In the copy constructor of my class PolygonList, I want to fully duplicate the polygons which are stored, so that each PolygonList classes have their own polygon list.
class PolygonList
{
public:
...
std::list< Polygon*> m_PolygonList;
...
};
The problem is that the Polygon class is a base class :
class Polygon
{
...
};
class Rectangle : public Polygon
{
...
};
class Triangle : public Polygon
{
...
};
etc...
In the copy constructor of the class PolygonList, how can I make sure to instanciate a new object of the good derived class, as I only have pointers on the base class and don't know (and don't want to know) about which dervied class of Polygon exists ?
I hope I made myself clear and that you'll be able to help me !
Thanks !
Jerome
|
|
|
|
|
|
I'm writing an application that read data from a Access 2000 database using ADO.
When I read a string field and I save it into a _variant_t variable I can see the right value, but that I want to pass this value to a CString variable and then I get always the first letter of the original value.
I have write:
<br />
CStrin Data;<br />
<br />
Data = (char*)(_bstr_t)Rs->GetFields()->GetItem("string_field")->value;<br />
<br />
When I debug the program I can see that Data holds only the first character of the string.
What I doing wrong?.
Thank you.
|
|
|
|
|
Roger H. Art wrote:
When I debug the program I can see that Data holds only the first character of the string.
What I doing wrong?.
How are you looking at the data? In the Watch window, you might need to use the su symbol. Also, look at Data.m_pchData[1] , Data.m_pchData[2] , Data.m_pchData[3] , etc to verify that the CString object contains.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi!
Yes I'm looking in the Watch window and I expand the Data, (Data is the CString variable) three, (clicking in the + simbol) and I only see m_pchData, (without subindex and there are not others members), with the value in Ascii of the first character in the string, example: I have de the string "188510015B" and I get "1", so in Data._pchData I see 49.
What is the su symbol?.
Thank you.
|
|
|
|
|
Roger H Art wrote:
I have de the string "188510015B" and I get "1", so in Data._pchData I see 49.
Like I indicated, you need to look at Data._pchData[0], Data._pchData[1], Data._pchData[2], Data._pchData[3], etc.
Roger H Art wrote:
What is the su symbol?.
It's for viewing Unicode text. By default, the s symbol is used.
http://www.devx.com/tips/Tip/14941
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcug98/html/_asug_symbols_for_watch_variables.asp
http://www.marin.clara.net/tips/unicode_tips.htm
http://support.microsoft.com/default.aspx?scid=kb;EN-US;123465
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi All
I am using CHtmlView to view some static HTML pages. The problem is these pages are not on the local disk, ie we download these pages from our central server into a Temp Location on the local machine, but obviously any resources will also exists in the central storage. So I was hoping to somehow trap the call to get the resource ie http://www.website.co.uk/image.gif or as it is more likely to be MYTAG:///Pictures/image.gif to route to my own download function and update the tag, just like IE does with TempInternet Files.
We are already intercepting hyperlink clicks using the OnBeforeNavigate2 method.
I may be using the wrong Control.
Cheers
Jay.
|
|
|
|
|
Hi,
I have a server app that uses CreateNamedPipe using a NULL DACL so that everyone has permission to read/write to it.
I then have a client that uses CreateFile to read and write to the pipe. In XP this works on remote machines no problem, the server can be running on one machine and the client on another and the CreateFile returns a valid handle.
On 98 CreateFile returns access denied, which eludes me because the pipe is created with a NULL DACL.
Can anybody shed some light on the issue.
Thanks
|
|
|
|
|
Hi everyone,
Can someone recommend a good XML parsing library that I can use with Visual Studio C++ 6.0, preferable something that is free and is easy to use.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
|
Hi,
I did not know about the existence of MSXML. Is it a seperate download?
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Why, Xerces[^] of course! Fast, free and open source! And it leaves MSXML in in the dust.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|