|
Hi all,
I have a GUI win32 application.
When one instance is running I cann't run another instance because the application is communicationg with external hardware.
Before to run another instance of this application I have to close the running application manually.
Now I want to run this application a number of times with different arguments using a batch file.
Now I wonder how I can give command in my batch so that it can close the running application before next instance of appliction starts.
Batch file may look like:
1. Test.exe arguments
kill Test.exe (1)
2. Test.exe arguments
kill Test.exe (2)
and
so on
Hope I have explain my problem.
Any help in this regard
will be appreciated
regards
/rsasalm
|
|
|
|
|
write a lil app (kill.exe) that accepts command line args of the name of the app to kill
in the kill.exe get the process id of the app to kill
send a wm_close message to it
make sure the app to kill will process those messages
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Hi Lauren,
Thanks for reply.
I would appreciate if you or someelse can give me a code example of killing another application B from one application A.
As least how to get the process id of an applicatin and then kill that.
Further, I guess the kill.exe you mentioned should be a Win32 application so that it can take wm_close message.
thanks again for your help
regards
/rsasalm
|
|
|
|
|
|
hi could not you suggest how to manage the following:
I have written a program which gets data from database (Access, SQL Server)
the data are shown in static.
I need these all to be send to print/print preview or to MS Word.
one more thing: how to make some statics bigger in size and some small?
thank you
if you can help send please to bek79@mail.ru
|
|
|
|
|
Take a look in the printing section here. There is an example of how to print a long CString across multiple pages in a view. You just need to get he text from the static into the string used, and the rest should work automaticlly. This assumes that the test in your static control is multi-line.
|
|
|
|
|
Hi , i'm trying to send an image from a Hebrew OS to other computer , and i always get a mirrored image.
I tried to use NOMIRRORBITMAP in the BitBlt method , but it doesn't seems to work.
Thanks.
|
|
|
|
|
i want to open a ODBC connection in my dialog based application can anybody tell me what is a simplest way to open database connection through dialogbased application
bye
chanda.com
|
|
|
|
|
|
Check out the articles at http://www.codeproject.com/database/
In particular, you will find http://www.codeproject.com/database/simpleado.asp useful.
Signature space for rent. Apply by email to....
|
|
|
|
|
Hi!
Is there any well-known way of storing application (GUI) states, so that next time when it starts, it gets all the states and show accordingly?
Please let me know of the ways of doing it.
Thank you
Shri Ram Soni
|
|
|
|
|
It really depends on what framework or tools that you are using to develop your application.
If you are using MFC, then you are in luck, you can simply set the registry key that your app will store all of its settings in, then call WriteProfileString and GetProfileString from your CWinApp object to manage your settings.
If you are using any other tools there are most likely methods to help ease the trouble of saving your settings. Depending if you want to save them in an ini file you can use WritePrivateProfileString. Of If you want to save your settings in the registry you will need to open a registry key and create new settings.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Does the following function work, if UNICODE is defined and when UNICODE is not defined?
I think that the line if (c != ' ') could be a problem!
Does this line works correct in both systems (UNICODE and non UNICODE)?
(This function should remove all spaces in a string!)
const CString CSerialize::WithoutSpaces(const CString str)
{
CString strTemp;
ASSERT(strTemp.IsEmpty());
for (int n = 0; n < str.GetLength(); n++)
{
TCHAR c = str.GetAt(n);
if (c != ' ')
{
strTemp += CString(c);
}
}
return strTemp;
}
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
the ' ' will translate to a char that contains a space or 0x20, which is 32 in decimal. In order for this to work properly in Unicode, you will need to cast your ' ' to a TCHAR, which will give you this 0x0020. Here is an example:
<br />
if (c != (TCHAR)' ')<br />
{<br />
...<br />
This will basically expand the single BYTE char to a double BYTE wchar_t which is what the TCHAR is declared as when the UNICODE macro is set.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
My first guess would be to change (c != ' ') to (c != _T(' ')) so the space is treated as a wchar_t in Unicode builds.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
You probably have a paradox where the DLL depends on the executables lib file to link properly, however the executables lib file has not yet been created because it depends on teh DLL being compiled first. If this is the problem, then I would remove the DLLs reference to the EXE until it compiles, with the exported lib file, then add the references back in and recompile the DLL.
Another thing that you could do is change your code in the DLL to call GetProcAddress for your executable and create a function pointer to the MyFunc procedure. They you would not have to worry about the linking at all.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Read in the MSDN.
I use than a def file, it helps to export "undecorated names".
|
|
|
|
|
Hi !!!
I have to display, in the 'help' menu of my App, a PDF document. I did a quick search on the Web and at www.adobe.com, hoping to find an ActiveX which would do that, but I didn't find it !
Does anyone know if the ActiveX I'm hoping to find exists ? Or if there is another way to display PDF documents ?
Thank you for your help !
Jerome
|
|
|
|
|
As I understand it, the PDF viewer is ActiveX, but only Internet Explorer can use it. I overcame this problem by using the IE ActiveX in the app and then loading the PDF file using IE.
|
|
|
|
|
|
hi friend
this kind of task solved by my collegue. please send your problem to him. his mail id is gopi@emazines.com
|
|
|
|
|
I have a CString member and want to save this member as ASCII in a file.
The problem is, that under my WinCE system the CString member is UNICODE and so each character in the member are 2 byte long.
So, how can I convert the CString member into a ASCII member (char*) and write this with the WriteFile API to a file?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
If CE has _bstr_t , then use that to convert:
_bstr_t bstr = (LPCTSTR) your_CString;<br />
LPCSTR psz = (LPCSTR) bstr;
Or if you don't have that class, use WideCharToMultiByte() .
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi Michael! Thanks for your answer!
Can I also use the ATL macro T2CA ???
I don't like to use the WideCharToMultiByte() API, because when I compile the file under a NON UNICODE system I have to remove the API function.
So I would prefer a function (macro) that works on both systems (UNICODE and non UNICODE).
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Daniel S. wrote:
Can I also use the ATL macro T2CA ???
Ah yes, that's another way to do it.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|