Link to home
Start Free TrialLog in
Avatar of huweiqi
huweiqi

asked on

Cannot use DCOM Event in Windows 98? Help!

Hello,
I have a problem in using DCOM Event as following:

Environment:
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.

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

Project1.Class1

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.
----------------------------------------

Avatar of tommy_boy
tommy_boy

You need to make sure DCOM98 is installed on your 98 machine.
Avatar of huweiqi

ASKER

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.
Check out Q267836
(http://support.microsoft.com/support/kb/articles/Q267/8/36.ASP)
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!
Avatar of huweiqi

ASKER

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.

http://support.microsoft.com/support/kb/articles/Q235/6/38.ASP
Avatar of huweiqi

ASKER

Hello,

All DCOM Version is 4.71.0.3328 (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.

Avatar of huweiqi

ASKER

Hello,

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.

Avatar of Asta Cu
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
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms02-015.asp
Synopsis:
Microsoft Security Bulletin MS02-015  
28 March 2002 Cumulative Patch for Internet Explorer
Originally posted: March 28, 2002
Summary
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.
":0)
Asta
Avatar of huweiqi

ASKER


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?
ASKER CERTIFIED SOLUTION
Avatar of Moondancer
Moondancer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial