|
I am trying to uninstall applications installed using msiinstallproduct function by giving REMOVE=ALL in the cmdline .I am passing the .msi file name to the function . And it returns the errorcode ERROR_UNKNOWN_PRODUCT
please suggest me how to remove applications
vineesh
|
|
|
|
|
Hello,
I have been trying to get currently running user application same as task manager in which first tab "Application" shows all currently running user applications.
I have used EnumWindows() API to find current open windows so i thought i could be able to find all the application running.
But problem with EnumWindows() is it gets all windows such as task bar, any services running as well as user application windows such as my computer or outlook.
Finally problem is i want to find all windows explorer windows opened by user.
EnumWindows() can get exe path of the window as well as title of the window.
But for any explorer window exe name is always C:\Windows\explorer.exe and it is same for any explorer window whether it is opened by user or by operating system as a service.
So how to find whether the window that is opened is a explorer window that is opened by user.
How to differentiate between explorer windows opened by user or windows service windows whereas the exe path is same C:\Windows\explorer.exe.
I need urgent help in problem.
If any body have any clue please share.
Any body has clu
vicky
|
|
|
|
|
You can use IsWindow and IsWindowVisible to check if it is a visible window.
To get the title bar text call GetWindowText on the window handle.
«_Superman_»
|
|
|
|
|
Sure, use these APIs; You will get the user name for each process (EXPLORER)
OpenProcessToken<br />
GetTokenInformation<br />
LookupAccountSid
|
|
|
|
|
There is an API called "GetInstalledPath".Search on net and use it.Its working fine for my application.It will get the installed path.
|
|
|
|
|
Thanks
It worked!!
vicky
|
|
|
|
|
Hi,
I tried to compile a VC++ application using Visual Studio 2005 IDE on a 64 bit platform.
I get the error below:
Error C2011: '_CONTEXT' : 'struct' type redefinition C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h 3437
Can anyone please advice me how to get rid of this error?
"Always Expect the Unexpected"
-Krista
|
|
|
|
|
Is your application redefining such a struct?
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]
|
|
|
|
|
Nope...
The redeclaration is done (ofcourse with different #if defined) is winnt.h which is a standard header file and not created in my application.
If the same winnt.h worked fine in 32 bit compilation, why should the 64bit compiler throw error?
Any ideas?
"Always Expect the Unexpected"
-Krista
|
|
|
|
|
Well, if winnt.h re-declares, what declares it?
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]
|
|
|
|
|
KristaK wrote: If the same winnt.h worked fine in 32 bit compilation, why should the 64bit compiler throw error?
I ran into this same problem and tracked it down. When the ported project was copied to the x64 environment, there was still a 32 bit define in the preprocessor definition: _X86_
Remove that and it works.
|
|
|
|
|
There obviously is a redefinition, so the question is where. The first thing to determine is what .CPP or .C file is being compiled when the error message occurs. This is a obviously a simple matter. Then use the The next step is to use the /P[^] compiler option to dump the pre-processor output. Finally search the generated file and look for the definitions.
Steve
|
|
|
|
|
I am working for an application where i am supposed to display the latest data on a list box from a XML. I got the datetime node from the XML and saved it into a string.
which is the format of str = "2009/12/3|19:04:43" & str1 = "2009/12/3|19:05:23"
My only concern is how is it possible to compare these two strings by date & time and display the one which is latest.
Please let me know the simplest way to compare them.
Thanks in Advance
|
|
|
|
|
You could use the COleDateTime::ParseDateTime[^] function in order to "convert" the strings into COleDateTime objects which are comparable. But your string has to be a standard format. Is the format in the xml fixed or could you adapt it a bit ? In yes, then I would suggest to use a standard format and then use COleDateTime objects.
|
|
|
|
|
No we are not supposed to change the format. I will be happy if you could provide me the sample code for parsing the date & time from the string and do the comparision.
Thanks in advance
|
|
|
|
|
you need not to change the formate... just change the formate for comparision purpose .. and retain the existing formate....
vikas da
|
|
|
|
|
Looks like your strings are in year/month/day|hour:min:sec format.
The 19 hour indicates you are using 24 hr notation (rather than 12 hr + am/pm) - good.
The only change you need to make is format your day as 03 instead of 3.
After that why can't you just do a normal string compare ?
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Normal string comparison can be done however if the values of the strings are changed to
str = "2009/12/3|19:04:43" & str1 = "2009/12/3|9:05:23"
Then It shows that str1 is greater than str though STRING str is the latest one.
Thus i want to have other way where we can compare them by date and time.
|
|
|
|
|
That's not the same as the original you showed.
In your op both were 19: which made me assume you were using 2 digit formatting for everything but day, which is why i said change it.
You said you are saving the string so i assume you control the formatting.
Just use YYYY/MM/DD|hh:mm:ss and you'll be fine.
So for your last example you'd have:
str = "2009/12/03|19:04:43"
str1 = "2009/12/03|09:05:23"
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
If you cannot change the format and want to know the difference, then extract year and compare first.
If they are same, extract month and compare.
Continue this for day, hour, minute and second.
You can extract by tokenizing the string using the tokens /|:
Or you can simply delete the 3 charecters from the string /|:
And then assign them to ULONGLONG variables and compare the numbers.
«_Superman_»
|
|
|
|
|
Its very Urgent for me In my program CString is not Releasing the memory in Release mode in vc6.0 only it's working fine in debug mode and later versions of visual studio here i am sending a sample application can any one send replay its very urgent for me.
#include "stdafx.h"
#include "afx.h"
#include "afxwin.h"
#include <windows.h>
#include "fixalloc.h"
#pragma warning (disable:4786)
#pragma warning (disable:4503)
#include<list>
#include<string>
#include<vector>
using namespace std;
void test()
{
vector<CString> stldmlist;
CString a;
FILE *fp=fopen("E:\\log1.txt","r");
char str[1000];
while(!feof(fp))
{
fscanf(fp,"%s\n",str);
a=str;
stldmlist.push_back(a);
}
fclose(fp);
AfxMessageBox("Memory");
}
UINT32 main(int argc, char* argv[])
{
AfxMessageBox("Start ");
test();
AfxMessageBox("End");
return 1;
}
Hi this Ravinder
|
|
|
|
|
Same sample code, same question again - you're persistent, I'll give you that...
However, again - no objective evidence confirming your hypothesis, same belief that it must be MFC that has the problem, not your code or understanding.
Help us to help you - tell us in detail why you think MFC is wrong, with proper, reproducible evidence - then maybe someone can help!!!
|
|
|
|
|
What makes you conclude that it isn't releasing memory?
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]
|
|
|
|
|
How are you concluding that CString isn't releasing memory? Are you using some kind of a utility that is reporting it? If yes, then I think that your utility sucks and you should stop using it.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi Friends,
I have an application which runs as a service. It works fine with "Local system account" as well as with any specific account. This is for windows 2003.
For windows 2008 (32 and 64 bit) my service runs correctly only when it is running with specific user account. But fails in case of "local system account". Also it gives me following error message -
"error 1053: The service did not respond to the start or control request in timely fashion".
I tried following things
- turning off "Data Execution prevention(DEP)"
- increased "ServicesPipeTimeout" to 60 seconds
but still with "local system account" my service does not start at all.
- Vikram S
|
|
|
|