Cannot use DCOM Event in Windows 98? Help!

I have a problem in using DCOM Event as following:

Server: Windows 2000 Server + SP1
Client: Windows 98/Windows 2000 Professional
DevTool: Visual Basic 6.0 + SP5
Other: DCOM98 V1.3 has been installed in Windows 98 and I
login to Domain as Administrator.

1. I Create an ActiveX DLL Project, add Class1, define event named MyEvent:


Public Event MyEvent ...

Public Sub CallMyEvent()
     do something ...
     RaiseEvent MyEvent ...
End Function

After create ActiveX DLL, I add it into MTS, set Default Authentication Level to None, Default Impersonation Level to Impersonate (or Identity, and same result), Login account to Administrator.

2. Then I Create a Standard EXE Project to use Project1.Class1
a) If I code as follow:
     Dim WithEvents MyObj as Project1.Class1
     Private Event MyObj ...
     Set MyObj = New Project1.Class1
     MyObj.CallMyEvent ...
in Windows 98, an Error like "Class does not support automation or specified interface ..." occurs at New object line , no problem in Windows 2000.

b) If I code as follow:
     Dim WithEvents MyObj as Project1.Class1
     Private Event MyObj ...
     Set MyObj = CreateObject("Project1.Class1")
     MyObj.CallMyEvent ...
in Windows 98, an Error like "Type mismatch ..." occurs at CreateObject line , no problem in Windows 2000.

c) If I do not use Event:
     Dim MyObj as Object
     Set MyObj = CreateObject("Project1.Class1")
     MyObj.CallMyEvent ...
no problem in both Windows 98 and Windows 2000

Please tell me,
Can Windows 98 support DCOM Event?
If can, how can I use it?
Thank you very much.

Who is Participating?
I am sorry that you have not received what you needed here.  I have therefore refunded to you the 100 points for this question and will close it by moving it to our PAQ at zero points.

You may benefit by posting this question again to draw current attention.  It may also help for you to include this link, so others can see what had transpired previously.

Moondancer - EE Moderator
You need to make sure DCOM98 is installed on your 98 machine.
huweiqiAuthor Commented:
Hello, tommy_boy

I already installed DCOM98 V1.3 which downloaded from Microsoft Web Site before, and reinstalled again a few
minutes ago, but the result is same.

Do you have other sugguestions?
Why CreateObject is ok at point 2.c) in my question?

Thank you.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Check out Q267836
This creates a VB DCOM client/serve app with events.

Try disabling DCOM permissions (Default Access / Launch = Everyone), and run as the Interactive User.

The reason why CreateObject was OK before, is because you weren't subscibed to events.
When an object raises an event, it loops thru the clients connected to it, and raises an event to each one.  If noone has subscribed to events, it won't try to raise one!
huweiqiAuthor Commented:
Hello, morgan_peat

I read the article before, and the demo has the same result.

And I have try your suggestion and still not work.

Something I forgot to tell:
   In some 98 machine, I install IE 5.5 SP1 and then the code run without errors. But it does not always work, only sometimes... , I do not know why ...

Any more idea?

Thank you.
Like huweiqi suggested, it could be DCOM version then.
Look at this article, and it should help you to see what version you have installed on these machines - you can then see if you need a particular version to be able to recieve events.
huweiqiAuthor Commented:

All DCOM Version is (it is V1.3 according to the article metioned above).

I test according to MS article again and again, but alway fail in Windows 98 and success in Windows 2000.

Anyone ever success in receive event in Windows 98 from MTS? Please give me a way.

Thank you.

huweiqiAuthor Commented:

I re-install my Windows 98 and re-do the test.

And it seems ok, Windows 98 can get events.

Now I create a ActiveX Control which use events.

But other problems occur:
1. if I put a DoEvents at the end of MyEvent, the control works fine in VB Form. When it is put in IE, everything is fine except a GPF occur when I close IE (in Kernel32.dll or Unknown module). if I remark DoEvents, all ok.

2. if I use a Class named clsProgress in the control, same problem occur: a GPF error when close IE but the code run without any error. the clsProgress is used to control a ProgressBar object in the control and it is used in many usercontrols without problem.

Does anybody know why?

Thank you.

Asta CuTechnical consultant & graphic designCommented:
Please update the experts here who have so willingly stepped in to help you, since much time has passed since your last comments, and Email notifications may not have been generated to the participating experts here due to some problems at that time.  If you've been helped, accept the respective comment by that expert to grade and close it.

To see all your Open and Locked questions, click your member profile and View Question history to update/close them as well.

Somewhat off-topic, but important.

****************************** ALERT********************************
WindowsUpdate - Critical Update alert March 28, 2002 from Microsoft
Microsoft Security Bulletin MS02-015  
28 March 2002 Cumulative Patch for Internet Explorer
Originally posted: March 28, 2002
Who should read this bulletin: Customers using Microsoft® Internet Explorer
Impact of vulnerability: Two vulnerabilities, the most serious of which would allow script to run in the Local Computer Zone.
Maximum Severity Rating: Critical
Recommendation: Consumers using the affected version of IE should install the patch immediately.
Affected Software:
Microsoft Internet Explorer 5.01
Microsoft Internet Explorer 5.5
Microsoft Internet Explorer 6.0

Thought you'd appreciate knowing this.
huweiqiAuthor Commented:

The problem still not solved.

A DCOM component (registered in MTS) with Event fails in most cases in my Win98 client but always successs in my win2000.

The sample from Microsoft Technical Article has the same result.

Currently I just not to use Event in my server side component.

Should I delete this question?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.