Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > Problem with ComObject in Web Client mode

Forum

Search UsersRules
Problem with ComObject in Web Client mode
#1
Just came
Points:: 0
Joined:: Feb 29, 2012

Hello,

We try to get ID Hard Disk on client computer.
We used following code:

Code
&AtClient
Procedure ShowHardiskID()

   objService=GetCOMObject("winmgmts:impersonationLevel=impersonate}!\\.\root\CIMV2");
   For Each objDisk In objService.ExecQuery("SELECT * FR OM Win32_DiskDrive")   Do    
       Message(objDisk.DeviceID);
   EndDo;

EndProcedure


On the thin-client runs with no problems, but a web-client to connect fails.
Error message on IE: "COM-object are only supported in Microsoft Internet Explorer".
At Client we used: IE 11 on Windows8.1 .
Please help us to fix this error.

Profile
#2
Guest
Points::
Joined::

Hello, Nguyen TH!

Unfortunately, COM objects are not supported in web client. But you can create an add-in for web browser, if you need this, or try to run COM objects on server and return the result to the client.

Profile
#3
Active user
Points:: 0
Joined:: Nov 19, 2012

Quote
Timofey Bugaevsky wrote:
Unfortunately, COM objects are not supported in web client.
I think it's wrong.
Or syntax assistant is not accurate.

Profile
#4
Guest
Points::
Joined::

Thank you, Alexey, I'm sorry for my mistake.

Yes, you can use COM objects in web client, but only in Microsoft Windows and Microsoft Internet Explorer. You also should allow using ActiveX, add the publication URL to trusted sites and there also might be other limitations like using 64bit Internet Explorer for COM objects of 64bit Microsoft Office, for example.

Thus it is still better to use other methods for web client to make the application that will run on other browsers.

Profile
#5
Just came
Points:: 0
Joined:: Feb 29, 2012

Thanks Timofey,

The problem has been solved. I have DiskID by other way.
1. First: I used the function: RunApp("cmd /c wmic DiskDriver get DeviceID >c:\Disk.txt") to write disk information to the file, for example: "c:\Disk.txt"
2. Then: Read data from file "c:\Disk.txt" .

Thank you for kindly help!

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.