Eamon
asked on
MSCOMM
Why does this work on my computer
Dim MSComm1 As Object
Set MSComm1 = CreateObject("MSCOMMLib.MS Comm")
but it does not work on another computer that has MSCOMM32.OCX in the system32 folder and it is registered.
I get an error Activex component cannot create object.
I do not want to add a reference to the Microsoft Comm Control 6.0 because this would cause errors on other computers that do not have the OCX.
Dim MSComm1 As Object
Set MSComm1 = CreateObject("MSCOMMLib.MS
but it does not work on another computer that has MSCOMM32.OCX in the system32 folder and it is registered.
I get an error Activex component cannot create object.
I do not want to add a reference to the Microsoft Comm Control 6.0 because this would cause errors on other computers that do not have the OCX.
I know it may be registered, perhaps there is a problem with it though, have you tried to unregister then register again? regsvr32 /u to unregister
blimey, not again, lol!
ASKER
I have put it on 8 computers in one of our stores. I did not work on any of them. It could hardly be a problem with all 8.
I will try anyway just to make sure.
I have vb6 installed on my computer could this be why it is working on mine and not the others.
I will try anyway just to make sure.
I have vb6 installed on my computer could this be why it is working on mine and not the others.
ok, I was thinking it was just one when u said another computer
Is the the same version of that ocx? you could copy yours onto there, into a different directory to win\system32 then try to register that.
Is the the same version of that ocx? you could copy yours onto there, into a different directory to win\system32 then try to register that.
ASKER
Tried the unregister then register again did not work.
ASKER
Could it be something stupid like that MSCOMMLib.MSComm isn't MSCOMM32.OCX
Will try copying my file
Will try copying my file
You should expect the unexpected and not assume users will have it. What I have tended to do is copy all the libs I use into the local directory where app is installed then register it.
ASKER
They have my ocx file now and still no good
so u unregistered the existing one
then registered this newly created copy?
then registered this newly created copy?
whats the error code, is it 429?
ASKER
yes 429
ASKER
Have just noticed in the store that when I go to add a reference to the ocx that it is not in the list (see jpg)
I had to browse to the ocx.
Is it registered correctly or is there something else I need to do.
I have another program that tries to make sure that each computer has the required files.
It does the following
FileCopy "\\server\c\epos\updates\O CX\*.*", "c:\WINDOWS\system32\*.*"
Shell ("regsvr32 /s mswinsck.ocx")
Shell ("regsvr32 /s MSCOMM32.OCX")
Shell ("regsvr32 /s MSINET.OCX")
Shell ("regsvr32 /s cgPrint") ' this is my own dll
Could this be causing a problem. Also can you have the same file in two different folders registered.
What I mean is could mscomm be somewhere else on the computer and registered.
Comm.jpg
I had to browse to the ocx.
Is it registered correctly or is there something else I need to do.
I have another program that tries to make sure that each computer has the required files.
It does the following
FileCopy "\\server\c\epos\updates\O
Shell ("regsvr32 /s mswinsck.ocx")
Shell ("regsvr32 /s MSCOMM32.OCX")
Shell ("regsvr32 /s MSINET.OCX")
Shell ("regsvr32 /s cgPrint") ' this is my own dll
Could this be causing a problem. Also can you have the same file in two different folders registered.
What I mean is could mscomm be somewhere else on the computer and registered.
Comm.jpg
ASKER
I browsed to c:\windowa\system32\mscomm 32.ocx and added the reference but I still get the error.
I have a a small test mdb that has the comm control on a form and tried that and that worked.
It must be just something stupid I am doing.
I have a a small test mdb that has the comm control on a form and tried that and that worked.
It must be just something stupid I am doing.
what is the purpose of it? kicking a cash drawer?
if so you may want to look at this :
Shell "cmd /c echo p0 > LPT1:", vbHide
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
This is what it is used for a Customer Display.
Public Sub CustDisplayInitialize()
On Error GoTo errhandler
Dim MSComm1 As Object
Set MSComm1 = CreateObject("MSCOMMLib.MS Comm")
MSComm1.CommPort = gblCustDisplayCommPort
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
MSComm1.Output = Chr$(27) & "@"
MSComm1.Output = Chr$(13)
MSComm1.Output = Chr$(27) + "U"
MSComm1.Output = ""
MSComm1.Output = Chr$(13)
MSComm1.Output = Chr$(27) + "D"
MSComm1.Output = ""
MSComm1.PortOpen = False
Exit Sub
errhandler:
MsgBox Err.Description, vbCritical, "ERROR In CustDisplayInitialize"
MsgBox "You will not be able to use the CustomerDisplay until this problem is solved.", vbInformation, ""
gblCustDisplayCommPort = 0
End Sub
Public Sub CustDisplayInitialize()
On Error GoTo errhandler
Dim MSComm1 As Object
Set MSComm1 = CreateObject("MSCOMMLib.MS
MSComm1.CommPort = gblCustDisplayCommPort
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
MSComm1.Output = Chr$(27) & "@"
MSComm1.Output = Chr$(13)
MSComm1.Output = Chr$(27) + "U"
MSComm1.Output = ""
MSComm1.Output = Chr$(13)
MSComm1.Output = Chr$(27) + "D"
MSComm1.Output = ""
MSComm1.PortOpen = False
Exit Sub
errhandler:
MsgBox Err.Description, vbCritical, "ERROR In CustDisplayInitialize"
MsgBox "You will not be able to use the CustomerDisplay until this problem is solved.", vbInformation, ""
gblCustDisplayCommPort = 0
End Sub
ASKER
rockiroads
I have registered it manually and there is no error.
I agree with you that it must be something to do with the registering of the control.
I will take a fresh look at it on Monday.
I have registered it manually and there is no error.
I agree with you that it must be something to do with the registering of the control.
I will take a fresh look at it on Monday.
Shell "cmd /c echo " & Chr$(27) & "@" &" > " & gblCustDisplayCommPort , vbHide
Shell "cmd /c echo " & Chr$(13) &" > " & gblCustDisplayCommPort , vbHide
ASKER
Surone1
Thanks but I'd rather sort the issue than try to work around it.
Thanks but I'd rather sort the issue than try to work around it.
you need a license to run
ie
http://www.visualbasicscript.com/m_1947/tm.htm
http://support.microsoft.com/kb/315501
ie
http://www.visualbasicscript.com/m_1947/tm.htm
http://support.microsoft.com/kb/315501
Also, MS has released several Security Bulletins for a LOT of ActiveX controls ... are you certain the machine where you're having troubles is up to date with all Windows/Office Service Packs? I don't see that actual control listed, but it's heavily dependent on other controls, so that may be your issue.
ASKER
On one of the computers in the stores I have a vb6 program installed that uses the comm control.
This program is working fine. I don't really understand how the licensing works.
Do I not have a license for the vb6 program running in the store.
This program is working fine. I don't really understand how the licensing works.
Do I not have a license for the vb6 program running in the store.
ASKER
I mentioned previous to this that I have a access form with the control on it and this worked. So how come I have a licence for that.
try to download from here
http://activex.microsoft.com/controls/vb6/MScomm32.cab
and put both into system32 and register
http://activex.microsoft.com/controls/vb6/MScomm32.cab
and put both into system32 and register
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Will try it wednesday. have to leave now. Thanks for the help
If so, you may have an issue with that control. Have you tried re-registering the control, or re-installing the redistribution package for those controls?