|
I have a program running as a service. I am using the IUpdateSearcher and IUpdateInstall interfaces. I can perform a WSUS search, find out what updates the computer needs and launch the update wizard. At this point I get the update wizard GUI, it will download the updates but then fails to install them.
In looking at the WindowsUpdate log I see error, 0x80240020, and in doing a web search I see a lot of people suggesting to update the SensLogn registry key. However when I check that key it is there and looks fine.
If I run my program from within the context of the user, we gave the program this capability also, then the update runs fine.
Has anyone run the runwizard GUI from within a service and had it work?
Thanks,
Bob
|
|
|
|
|
|
SetActivePage() seems like a good choice.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
David I know that part. I am just wondering, in my view class, PropertySheet class is a member of it & calling sheet class doModal directly. In this scenario, can I set message Map between sheet & pages & call the method. If so, how do I? If this is not appropriate, then what should I do.
I am working with eVC++ with WinCE, so in my tabs I don't have any Ok, Cancel, Apply buttons. On pressing "Enter" key on a tab name, OnApply() is called.
Thanks
Terry
|
|
|
|
|
Please anyboady can point me to an implementation of a control like the one used in MindJet program ? ie a TreeMap control, which is like a TreeCtrl, but has a 2D layout of the items and braches,etc.
Thank you in advance.
(I also ppreciate any link to even a commercial implementation for MFC)
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Can you use something like Graphviz[^]
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
I am working at a IE plugin.
I am using RegisterHotKey() function to set some hotkeys for the plugin
(CTRL-C, CTRL-V,...). So, I define some system wide hotkeys.
I want to unregister these hotkeys if the focus is on another window.
I tried to use RegisterHotKey() on WM_SETFOCUS message and
to use UnregisterHotKey()on WM_KILLFOCUS message in the window callback function.
It didn't work.
Any suggestions?
danginkgo
|
|
|
|
|
I would like to write a program to check which process has locked a specific file or directory.
For example , when I attempt to delete a directory and receive the message from the explorer ' ... directory used by another process', I would like to know which process has locked this directory.
Are there any Windows APIs to accomplish this?
Thank you.
modified 7-Mar-17 16:42pm.
|
|
|
|
|
There are several freeware products which can acomplish this. Couple of them are unlocker[^] and process explorer[^]. There is an article at codeproject as well showing how to acomplish this programtically but I can't seem to find it at the moment.
-Saurabh
|
|
|
|
|
Thank you. I downloaded unlocker and it does a good job.
modified 7-Mar-17 16:42pm.
|
|
|
|
|
Hi everybody,
this is my first post here so I hope I am in he correct board.
I am coding a little windows application that regularly get data from an http server (apache2 on linux). The application is coded in C++ and uses the wininet library to access internet.
My problem is that TCP connections closing do not seem to be clean. I am using InternetOpen() and InternetOpenUrl() synchronously. After I call InternetCloseHandle(), the connection state are:
-on the client: CLOSE_WAIT
-on the server: FIN_WAIT2
...and this lasts about one minute, which I guess is the default timeout for this state on the server.
Before I go more in the details of my implementation, could somebody confirm that this is not normal?
Many thanks in advance,
Smaon
modified on Monday, June 23, 2008 12:01 PM
|
|
|
|
|
Ok, here is an example program that illustrate my problem:
win32 console application.
#include "stdafx.h"
#include <wininet.h>
#include <string>
int _tmain(int argc, _TCHAR* argv[])
{
HINTERNET hInternet = InternetOpen((L"soper"), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL,0);
if ( !hInternet ){
return 0;
}
HINTERNET hConnection = InternetOpenUrl( hInternet, L"http://localhost/anypage.php", NULL, 0, INTERNET_FLAG_NO_CACHE_WRITE, 0 );
std::string result = "";
if ( hConnection )
{
CHAR buffer[1024];
DWORD dwRead;
while ( InternetReadFile( hConnection, buffer, 1023, &dwRead ) )
{
if ( dwRead == 0 )
break;
buffer[dwRead] = 0;
result += buffer;
}
}
printf("%s\n", result.c_str());
InternetCloseHandle( hConnection );
InternetCloseHandle( hInternet );
Sleep(30000);
return 0;
}
For the 30 seconds of the Sleep(), the connection remains in CLOSE_WAIT on the client side and FIN_WAIT2 on the server side. When the application exits, the connection is dropped. I don't think this is normal...
Smaon
|
|
|
|
|
|
Is it possible to set priority to the callback function?
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Nope. (anyway, please, be more specific).
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]
|
|
|
|
|
I thought, If possible I want to set high priority to callback which gets MIDI message and keep the MIDI message processing thread priority default(normal).
Otherwise, I need to set below_normal to processing thread.
Thanks for your help!!
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
That way you only hit the target if the callback it's called by different thread.
BTW: Why do you need 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]
|
|
|
|
|
Hi,
The callback get MIDI message and write into ring buffer after that it wakeup processing thread using event.
Sometimes when callback got more than one message, it writes in ring buffer and wakeup processing thread many times.
This time, If the callback is on writing a message from MIDI to ringbuffer and processing thread think this message is complete and reads by incrementing pointer.
If processing thread does it faster, it goes one byte beyond actual message(not complete) written by callback then callback get "buffer overrun" condition.
Thats why now, I made processing thread priority below normal and seems working.
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
I think adjusting thread priority is not a reliable fix for the flaw on your syncrhonization mechanism.
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]
|
|
|
|
|
Hi,
Me too think so, even though it seems working, It would be better If I fix it in some other proper way and not by just priority or timing.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
I didn't fully understand what you were saying but I understood that the problem was because your buffer was accessed by two threads and you have problems when one is writing in it while the other is reading it (which is logical). If that's your problem, why don't you access the buffer in a critical section ? This way, only one thread will be able to access the buffer at a time and this will avoid having data corruption.
|
|
|
|
|
Hi,
I will try If I can use critical section.
Problem is data is written into a single ring buffer.
If I use critical section, then other thread cannot access any part of ring buffer until write finish.
I want to let other thread to read the messages written completely by write thread(callback) and not current message being written.
One way is, I can check write pointer location, if the message not complete, then reset the read pointer to current message starting byte and check for complete message again.
Thanks for your help, I will try this tomorrow in office and update after I fix it.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Another option is to update the write pointer only when you have written your message completely.
|
|
|
|
|
Cedric Moonen wrote: Another option is to update the write pointer only when you have written your message completely.
Hi,
It is fixed now by your idea and there is no overrun.
Thanks for your great suggestion!!
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|