|
Hi
i want some help from you regarding vbscript and WMI
suppose there are five systems in a network say 1 2 3 4 5 and iam monitoring other systems from system 1. so whenever I run a script it should tell me what are the other systems running in the network and write the output to a log file. and the script should check for a folder and the files in that folder on remote machines and writes to the log file on the monitoring systyem i.e on system 1
can u please help me with a script example for this
Thanks in Advance
abhi
|
|
|
|
|
I'm on a project where they are considering the idea of creating a COM object to expose some functionality. I don't have any COM experience, so I figured I ask the experts for some guidance.
One concern is that there is a possibility that functionality will need to eventually be hosted on a Linux server. In other words, the COM object will be communicated with from a Windows client to a Linux box via messaging.
I've searched the Web to see what has been written on this subject, but didn't find much information on the subject. Is there good support for developing/using COM objects in Linux? If so, I'd appreciate it if you could post a link to information about the issues/risks/etc to keep in mind when designing the COM class. If not, what makes it a problem?
Thanks for any help.
:josh:
My WPF Blog[ ^]
We are what we repeatedly do. Excellence then, is not an act, but a habit. - Aristotle
|
|
|
|
|
I doubt there is COM on Linux. CORBA, probably.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the feedback.
:josh:
My WPF Blog[ ^]
We are what we repeatedly do. Excellence then, is not an act, but a habit. - Aristotle
|
|
|
|
|
There is plenty of COM on Linux.
--
LOADING...
|
|
|
|
|
Joergen Sigvardsson wrote: There is plenty of COM on Linux.
Do you have any advice or information to share regarding COM on Linux? Are there a lot of problems when creating a COM object to be used on both Windows and Linux? If so, are they bad enough to warrant "second thoughts" about whether it is a reasonable thing to do?
:josh:
My WPF Blog[ ^]
We are what we repeatedly do. Excellence then, is not an act, but a habit. - Aristotle
|
|
|
|
|
When it comes to DCOM, there should be no problems, as all communication is made over the wire. When it comes to COM - the binary standard, it will probably not work out of the box. Last time I checked, g++ did not generate ABI-compatible vtables compatible with the VC++ compiler. Some hackery in C + Wine might do the trick, but it's nothing I would like to maintain...
If you can manage to recompile components for Linux, then there is no real problem as far as binary compatibility goes.
EntireX is a system I played with a long time ago, and from what I can tell, it's still around - although unsupported! There might be other solutions too. I know there are other products for other Unix-operating systems (if I recall correctly, Microsoft bought it from Mainsoft (I think their name was) when they ported IE to Solaris).
I am however a bit skeptical about using COM-technology with Linux. It's akin to pushing a cube through a round hole - it just doesn't fit very well. Are there any specific reasons why you won't make the COM-objects to act like proxies on the Windows-side? It would be an easy task to hook it all up with RPC between Linux and Windows through the proxies. That way you can have proxy objects for communication with Linux servers, and "regular" objects for communication with Windows servers.
Is transparency is an absolute and unalterable requirement? Also, is there a design that you have to adher to, or do you have free reign on the design?
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
First of all, thanks a lot for the help. I really appreciate it!
Joergen Sigvardsson wrote: I am however a bit skeptical about using COM-technology with Linux.
Me too!
Joergen Sigvardsson wrote: Is transparency is an absolute and unalterable requirement? Also, is there a design that you have to adher to, or do you have free reign on the design?
This is a "top down" design approach, where high-level executives push down their decisions on low-level technical details. I'm just looking for ammo to shoot back with.
:josh:
My WPF Blog[ ^]
We are what we repeatedly do. Excellence then, is not an act, but a habit. - Aristotle
|
|
|
|
|
|
Thanks for the feedback.
:josh:
My WPF Blog[ ^]
We are what we repeatedly do. Excellence then, is not an act, but a habit. - Aristotle
|
|
|
|
|
Hi all,
I am doing a project using COM. I need to embedd my own html page as a frame in a page accessed from internet.
For Eg: I am accessing google.com , and with the help of my COM ,I should be able to embedd my own html page as a frame on the google page .
Is it Possible ??.
Thanks
George
|
|
|
|
|
georgekjolly wrote: am doing a project using COM. I need to embedd my own html page as a frame in a page accessed from internet.
Thats probably the weirdest thing i heard, why would you want to do this?
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
Hi,
I've used the MFC class wizards in VC2003 to create a wrapper for an ActiveX control (derived from CWnd). I've then successfully embedded that control into a window and it works beautifully (so far so good).
My question is, how can I invoke the control's standard Property dialog from within MFC? I need to give the user access to the control's properties at runtime, but so far have not had any luck doing this.
Can anybody help?
- Don
|
|
|
|
|
What is the difference between these two?
Can anyone help?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
"I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."
|
|
|
|
|
None, aside from the naming convention.
|
|
|
|
|
I'm trying to modify a Event Calendar available here as a demo to use a sql database but have not been successful.
If anyone thinks they can help, or have something I can work with I would appreciate it.
Thanks in advance...
|
|
|
|
|
Hai,
I am trying to compile my application in VC++, I am getting error "file not found: ..\lib\ScriptHost.tlb". That file is not available in my machine. how to get that file? That file is included in the file
"..\Rogue Wave\Stingray Studio 2006\Include\toolkit\ActvHost\ScriptHost.rc"
Can anyone suggest me what I could do for this
Thanks
Surendran
|
|
|
|
|
I haven't worked with the tookit you have mentioned so can't give specific answer about missing file. Ideally, since its a dev toolkit, the TLB, if used, should be part of the SDK/Toolkit you have installed.
If it's not, you can use following methods to generate it -
1. If you have its IDL, then use MIDL compiler to generate a TLB
2. If you have its COM component registered on system and assuming it has the TLB embeded in it, you can use OLE/COM object viewer to get the IDL file code and use step 1 to generate it
There might be other ways to generate it, but I need to fix few things myself, so can't think much at the moment Hope this helps.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I would have thought that if you've paid for a RogueWave toolkit then you're entitled to a certain amount of support from RogueWave ?
'g'
|
|
|
|
|
I have a bug in .NET which I'm trying to repro for Microsoft. To repro this bug, my app needs to respond to events raised by a COM object.
In my app, this object is iTunes. However, for my repro, I want to use a COM object already installed on a common XP setup.
So - are you aware of a COM object I can create in my app, which raises events for which I can create a handler?
Preferably, this COM object has a UI (in fact, is an application), so I can control when the events are fired. For instance, with iTunes I create an instance of iTunes, then create a handler for the VolumeChanged event, then I click on iTunes and move the volume slider. Each change sends an event to my app.
Also preferably - very little code. I can do the above with iTunes in three lines of code. I'm not interested in learning about another COM object, just using it to demo a bug. So if you can provide those 3 lines of code, more power to you! (and me).
Thanks!
|
|
|
|
|
How about WebBrowser control for instantiating IE. (see IWebBrowser2 interface and its related events)
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
That would have worked nicely, thanks.
However, I was able to fix my bug (you can see the thread over on C# if you are interested). Turns out that my event handlers for the COM object were not executing on the same thread as my form, and I was getting odd UI behavior as a result.
I needed to check .InvokeRequired, and call Invoke() if necessary. I fixed this, and every last little bit of the bug just disappeared!
I still don't know why .NET wasn't throwing "wrong thread" exceptions, but that was definitely the problem.
You can see the thread and a very nice explanation of the problem here:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&fr=26
|
|
|
|
|
Cool. I agree, there are problems with events when multiple threads are involved. Need to be a bit careful
I was unable to get to the thread using the link you provided
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
JoeRip wrote: Turns out that my event handlers for the COM object were not executing on the same thread as my form, and I was getting odd UI behavior as a result.
Awooga! Awooga!
Sorry, that's the sound of the alarm going off in my head.
Something's not right with your apartment setup. If you have forms, the thread that creates them should be marked with the [STAThread] attribute. This ensures that COM events are fired on the correct thread - it tells COM that this thread uses the apartment-threaded model (CoInitializeEx is called with the COINIT_APARTMENTTHREADED flag). Objects created by this thread have their calls sent back to this thread, regardless of which thread those calls were made from (if the object is implemented correctly).
The object is also marked for a given threading model - this is done in the registry for objects implemented as in-process servers (in DLLs). Normally automation objects are also marked apartment-threaded - this means that whichever thread you make a call to them on, COM will marshal the call to the thread you created the object on. However, COM can only do its stuff if you correctly marshal interface pointers between threads - if you just pass raw interface pointers around you can end up calling an object incorrectly on the wrong thread when it's not expecting it, causing unexpected race conditions or other thread-model violations. This is a particular problem if an event has to be raised by a worker thread.
This shouldn't happen if you're using an out-of-process object though, since those calls always need to be marshalled, which leads me to think that your UI thread isn't marked [STAThread] .
|
|
|
|
|
Ah, but it is. I'm using the standard VS .NET Windows Application template. Here's my main:
namespace Eye_On_iTunes<br />
{<br />
static class Program<br />
{<br />
[STAThread]<br />
static void Main()<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
Application.Run(new frmEye_On_iTunes());<br />
}<br />
}<br />
}
and all of my code is running in the form class frmEye_On_itunes(). Note the thread model.
To get the iTunesApp object, I simply:
itunesapp = new iTunesLib.iTunesApp();
and to create event handlers for the iTunes events I simply
itunesapp.OnDatabaseChangedEvent += new _IiTunesEvents_OnDatabaseChangedEventEventHandler(itunes_OnDatabaseChangedEvent);
where itunes_OnDatabaseChangedEvent is a handler in the form class.
So I also assumed the event handler thread would be the form thread, and that it would be safe. However, apparently it wasn't.
I added a check to InvokeRequired, and re-routed the message back through with a delegate, like this:
private void itunes_OnDatabaseChangedEvent(object deletedObjectIDs, object changedObjectIDs)<br />
{<br />
if (InvokeRequired)<br />
{<br />
Invoke(new iTunesLib._IiTunesEvents_OnDatabaseChangedEventEventHandler(itunes_OnDatabaseChangedEvent), new object[] { deletedObjectIDs , changedObjectIDs});<br />
}<br />
else<br />
{<br />
}<br />
}
and all problems went away. So .NET says that InvokeRequired is true when this event fires for the COM object itunesapp, apparently.
|
|
|
|
|