|
How to change the programme to make it can create an instance of the class on remote machine.
thanks a lot
|
|
|
|
|
chaocai wrote:
How to change the programme to make it can create an instance of the class on remote machine.
I assume what you want to do is, use XYDispDriver to create com object remotely. You need to be familiar with COM+ (or DCOM) in order to do this.
1. First, the com dlll or exe you want to use has to be registered with COM+ as "server application" on the remote machine.
2. Secondly, you need to create a type library by exporting the server application from the remote machine. The type library should be imported on your local machine (where code using XYDispDriver runs).
3. Finally, call the CreateObject method of the XYDispDriver class. The com object created will live on the remote machine.
Note that you cannot do this for all com objects and it all depends on how your com component is constructed.
Good luck.
My articles and software tools
|
|
|
|
|
Attempted to run a vbscript using xyntservice and got the following error message:
Failed to start program 'vbcode3.vbs', error code = 2
When I code the ini file to look like the following:
[Settings]
ServiceName = XYNTService
proccount = 1
CheckProcess = 20
[Process0]
CommandLine = Wscript vbcode3.vbs
workingDir = c:\
userinterface = yes
Restart = no
The service starts the process "Wscript" but does not run the program associated with it. Any ideas on how to get the VBScript code to run?
Thanks
Al Olson
|
|
|
|
|
Ok, this is an easy one. The "error code = 2" means the system cannot find your file, in this case it is the vb script file that it can't find.
You need to change the command line in your XYNTService.ini file to something like the following:
CommandLine=wscript c:\mydir\vbcode3.vbs
Good luck.
My articles and software tools
|
|
|
|
|
Thanks for the suggestion, however this doesn't work either. When I try it WScript becomes a started process but it does not run the program VBCode3.vbs. I can see WScript in the process list but it is not getting any CPU time nor is the program accessing any of the data. My vbscript code is suppose to access the domain coontroller on the network and when I run this from the command line with the following command it works great:
Wscript VBCode3.vbs
Any thoughts?
Thanks
al
|
|
|
|
|
This time it might be a different problem. Please check the XYNTService.log file again, if it no longer generates the "Error code = 2" error, then the previous problem was fixed.
If the above is true, the new problem could be a "resource" issue. This is the most typical problem for an app to fail when started by a service. Basically, XYNTService is using the "Local System" account by default, it does not have access to many resources on the network, which may include the "domain controller". What you can do is reconfigure the service to run under your own account (or another domain account that has the appropriate rights). The reconfiguration process is already described in my article in detail (see the FAQ section).
Good luck.
My articles and software tools
|
|
|
|
|
I figured that it would need to be setup under my account so I did so based upon your directions. I just got done checking it and it turns out that the process did work, output files were created and they did contain the correct data. The surprising thing here is that when viewing the process "WScript" it does not appear to be getting cpu time at all, yet the process still worked. The only change I made in the ini file was to run my VBScript module in batch mode using "//B" parameter. This job does run a long time and it did take over 90 minutes to complete. I'll be letting this service run each time I log in now to see if it continues to operate as expected. Thank you for you help
al
|
|
|
|
|
Hi,
Thanks.I saw your sample XYEvent1.my doubt is say if i have created a ATL Control say a BUTTON.And included events for this .And In my VC++ console application i dynamiccaly create controls(more than 1 BUTTON).My doubt is How to know which button was clicked on the console
and fire the event.Pls help.I am struggling for a while with this.
I will be really grateful if u help me in this regard.Even if u take you sample how to handle this?
Thnks in advance
Ram
|
|
|
|
|
The method I use does not work with GUI controls (Buttons, Text Boxes, etc.). I used ATL in my projects, but I do not know enough to give you advice on how to handle com events with ATL. Sorry.
You can find a lot of references on COM EVENT and ATL from the web. For example, search "ATL COM Event" on google will give you a lot results.
Good luck.
Click here to see my articles and software tools
|
|
|
|
|
|
Hi,
I have a BIG question ... . How did you managed to write so many articles on codeproject.com? Do you have any full/part time job? I would also like to write more, but I have not time for , I have to work 8-10 hours/day. Hopfuly you can give me the clue ... THANKS.
|
|
|
|
|
Iulian Iuga wrote:
How did you managed to write so many articles on codeproject.com? Do you have any full/part time job?
Hi, Iulian. The answer to your question is, I don't waste time posting in the forums like others do. Seriously, there are people who have written more articles than me and still managed to make a lot of posts in various forums.
By the way, I do have a full-time job and I enjoy a lot of freedom in my work (most of times I can decide a lot of things myself).
Thank you for your interests.
Click here to see my articles and software tools
|
|
|
|
|
Good Luck!
You are the best!Me too!
|
|
|
|
|
Dear Xiangyang Liu:
You seem to have an out of the ordinary view point towards forums. May be you had a bad experience relating to them in the past. I strongly believe that articles and posts are equally important for any developer community and lead to a better learning effort.
It hardly takes a minute to post on the forum if the answer is known before hand. I encourage you to take part in forums. They are really helpful to developers seeking exact answers and suggestions. In the process you will learn new things and earn the respect of your peers.
By the way your have earned mine. Great articles! Keep them coming...
, Happy Coding.
Rai Umair
What is now proved, was once only imagened...
|
|
|
|
|
|
Dear Xiangyang Liu:
You seem to have an out of the ordinary view point towards forums. May be you had a bad experience relating to them in the past. I strongly believe that articles and posts are equally important for any developer community and lead to a better learning effort.
It hardly takes a minute to post on the forum if the answer is known before hand. I encourage you to take part in forums. They are really helpful to developers seeking exact answers and suggestions. In the process you will learn new things and earn the respect of your peers.
By the way your have earned mine. Great articles! Keep them coming...
, Happy Coding.
Rai Umair
What is now proved, was once only imagened...
|
|
|
|
|
Rai Umair wrote:
You seem to have an out of the ordinary view point towards forums.
I did make occasional posts to answer others' questions and also ask questions, most of the time I wasn't logged on or using my real name. I wasn't fast enough to come up with the answers, typically a better answer was already posted by someone else by the time I press "submit".
I had some bad experiences getting into arguments with others, but not nearly enough comparing to others.
Thanks for your suggestion and support.
Have a nice weekend.
Click here to see my articles and software tools
|
|
|
|
|
hi Are you chinese!
your session management tools is very cool
i am in beijing now
My Homepage : http://www.accesine.com
|
|
|
|
|
Hello, Mr. Tian. I am glad you liked my session management tool. If you have any question, e-mail me.
I was originally from Changsha (Hunan), came to USA more than 15 years ago. It is great to get contacted by people from the IT industry in China, I hope someday I can go back and work there.
Click here to see my articles and software tools
|
|
|
|
|
Very glad to know that you are from Changsa. I am from Yueyang (Hunan). I know you because I used your XYNTService in one of my previous project. It works great till now! I am considering to use your XMLDBComponent in my current project, but not decide yet since the Data Component in my design is not fully finished.
By the way, where a u right now? I am in Rochester, NY. Anyway, thank you very much for your article and source code!
Lianghua Zhou
|
|
|
|
|
|
In the year 2000/2001 i live and work for a priod of 14 weeks in China (QingPu - Shanghai) and i see that you have the real China mentality. And I like it!
Many Regards
Martin IJzerman
Martin Y
|
|
|
|