Can ActiveX DLL component contain ActiveX control?
Author |
Message |
Bing #1 / 12
|
 Can ActiveX DLL component contain ActiveX control?
I have an ActiveX control. This ActiveX is invisible at run time. Can I make an ActiveX DLL COM based on this ActiveX control?
|
Sat, 22 May 2004 14:39:22 GMT |
|
 |
Ivan Demkovitc #2 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Yes. Start new project. Add reference to OCX file (not Comonent!!!) You will not see it as a reference, but you will be able to see object in object browser. Then just Declare this object and work with it. I wrapped WinSock control into DLL with all events, properties, etc..
Quote: > I have an ActiveX control. This ActiveX is invisible at > run time. Can I make an ActiveX DLL COM based on this > ActiveX control?
|
Sat, 22 May 2004 22:52:32 GMT |
|
 |
Dick Grie #3 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Hi, Yes. You can either place a form in your ActiveX DLL and use it to host the ActiveX OCX, then reference it from you class module (I usually do it this way), or you can set a reference to the ActiveX control, and use CreateObject or similar syntax in code only, with no form. Simply because a form is included in the project does not mean that the form ever needs to be made visible -- it does not. Thus, you do not have to have any UI elements to use forms to host ActiveX controls. -- Richard Grier (Microsoft Visual Basic MVP) Hard & Software 12962 West Louisiana Avenue Lakewood, CO 80228 303-986-2179 (voice) 303-986-3143 (fax) Leave voice mail or fax that I can receive as email at 303-593-9315 Author of Visual Basic Programmer's Guide to Serial Communications, 2nd Edition ISBN 1-890422-25-8 (355 pages). For information look on my homepage at http://www.hardandsoftware.net. Use the Books link to order. For faster service contact the publisher at http://www.mabry.com.
|
Sun, 23 May 2004 00:29:25 GMT |
|
 |
Bing #4 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Hi, I tried to add a form. But VB doesn't allow me to add form into my ActiveX DLL application. That button is greyed out. If I use the no form way to do this, how can I catch the events of the constitute control. I need to forward some of the events back to user of my COM. Thanks a lot. Bing Quote: >-----Original Message----- >Hi, >Yes. >You can either place a form in your ActiveX DLL and use it to host the >ActiveX OCX, then reference it from you class module (I usually do it this >way), or you can set a reference to the ActiveX control, and use >CreateObject or similar syntax in code only, with no
form. Simply because a Quote: >form is included in the project does not mean that the
form ever needs to be Quote: >made visible -- it does not. Thus, you do not have to
have any UI elements Quote: >to use forms to host ActiveX controls. >-- >Richard Grier (Microsoft Visual Basic MVP) >Hard & Software >12962 West Louisiana Avenue >Lakewood, CO 80228 >303-986-2179 (voice) >303-986-3143 (fax) >Leave voice mail or fax that I can receive as email at 303-593-9315 >Author of Visual Basic Programmer's Guide to Serial Communications, 2nd >Edition ISBN 1-890422-25-8 (355 pages). >For information look on my homepage at
http://www.hardandsoftware.net. Quote: >Use the Books link to order. For faster service contact the publisher at >http://www.mabry.com. >.
|
Sun, 23 May 2004 01:15:36 GMT |
|
 |
Bing #5 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Hi Ivan, Thanks for your great suggestion. It really helps. But sorry for bothering you again. I just need to know how I can capture events of the constitute ActiveX control. I need to forward some of its events back to my COM users. Thanks again. Bing Quote: >-----Original Message----- >Yes. >Start new project. >Add reference to OCX file (not Comonent!!!) You will not see it as a >reference, but you will >be able to see object in object browser. >Then just Declare this object and work with it. >I wrapped WinSock control into DLL with all events, properties, etc..
>> I have an ActiveX control. This ActiveX is invisible at >> run time. Can I make an ActiveX DLL COM based on this >> ActiveX control? >.
|
Sun, 23 May 2004 01:22:19 GMT |
|
 |
Ivan Demkovitc #6 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Ok. Start new Project. Project/References browse for OCX file you need. Then write code in class module (this is sample for WinSock Control) Option Explicit Private WithEvents oWinSock As Winsock 'Declare all object events to bubble them up to 'application Event oError(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) Event oDataArrival(ByVal bytesTotal As Long) Event oClose() Event oConnect() Event oConnectionRequest(ByVal requestID As Long) Event oSendComplete() Event oSendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long) Private Sub Class_Initialize() Set oWinSock = New MSWinsockLib.Winsock End Sub Private Sub Class_Terminate() Set oWinSock = Nothing End Sub 'bubble up all events Private Sub oWinSock_Close() RaiseEvent oClose End Sub Private Sub oWinSock_Connect() RaiseEvent oConnect End Sub Private Sub oWinSock_ConnectionRequest(ByVal requestID As Long) RaiseEvent oConnectionRequest(requestID) End Sub .....
Quote: > Hi, > I tried to add a form. But VB doesn't allow me to add form > into my ActiveX DLL application. That button is greyed out. > If I use the no form way to do this, how can I catch the > events of the constitute control. I need to forward some > of the events back to user of my COM. > Thanks a lot. > Bing > >-----Original Message----- > >Hi, > >Yes. > >You can either place a form in your ActiveX DLL and use > it to host the > >ActiveX OCX, then reference it from you class module (I > usually do it this > >way), or you can set a reference to the ActiveX control, > and use > >CreateObject or similar syntax in code only, with no > form. Simply because a > >form is included in the project does not mean that the > form ever needs to be > >made visible -- it does not. Thus, you do not have to > have any UI elements > >to use forms to host ActiveX controls. > >-- > >Richard Grier (Microsoft Visual Basic MVP) > >Hard & Software > >12962 West Louisiana Avenue > >Lakewood, CO 80228 > >303-986-2179 (voice) > >303-986-3143 (fax) > >Leave voice mail or fax that I can receive as email at > 303-593-9315 > >Author of Visual Basic Programmer's Guide to Serial > Communications, 2nd > >Edition ISBN 1-890422-25-8 (355 pages). > >For information look on my homepage at > http://www.hardandsoftware.net. > >Use the Books link to order. For faster service contact > the publisher at > >http://www.mabry.com. > >.
|
Sun, 23 May 2004 01:22:55 GMT |
|
 |
Dick Grie #7 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Hi,
I tried to add a form. But VB doesn't allow me to add form into my ActiveX DLL application. That button is greyed out << This is strange. There is no restriction for forms in any ActiveX project, be it DLL, EXE, or OCX. I have several example of this in my book. If you send me email, I can return you an example that illustrates. What ActiveX control are you trying to host? -- Richard Grier (Microsoft Visual Basic MVP) Hard & Software 12962 West Louisiana Avenue Lakewood, CO 80228 303-986-2179 (voice) 303-986-3143 (fax) Leave voice mail or fax that I can receive as email at 303-593-9315 Author of Visual Basic Programmer's Guide to Serial Communications, 2nd Edition ISBN 1-890422-25-8 (355 pages). For information look on my homepage at http://www.hardandsoftware.net. Use the Books link to order. For faster service contact the publisher at http://www.mabry.com.
|
Sun, 23 May 2004 03:38:26 GMT |
|
 |
#8 / 12
|
 Can ActiveX DLL component contain ActiveX control?
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
Bing #9 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Now I have my COM. It hosts an ActiveX control inside it. In my COM, I have event procedure to check events of that ActiveX control. In that event procedure, I want to use Err.Raise to report errors back to the user of my COM. But it looks like Err.Raise doesn't work in that event procedure, which means it cannot forward err event back to the client. Does anybody know how to fix this problem? Thanks very much in advance. Quote: >-----Original Message----- >Ok. >Start new Project. >Project/References browse for OCX file you need. >Then write code in class module (this is sample for WinSock Control) >Option Explicit >Private WithEvents oWinSock As Winsock >'Declare all object events to bubble them up to >'application >Event oError(ByVal Number As Integer, Description As
String, ByVal Scode As Quote: >Long, ByVal Source As String, ByVal HelpFile As String,
ByVal HelpContext As Quote: >Long, CancelDisplay As Boolean) >Event oDataArrival(ByVal bytesTotal As Long) >Event oClose() >Event oConnect() >Event oConnectionRequest(ByVal requestID As Long) >Event oSendComplete() >Event oSendProgress(ByVal bytesSent As Long, ByVal
bytesRemaining As Long) Quote: >Private Sub Class_Initialize() > Set oWinSock = New MSWinsockLib.Winsock >End Sub >Private Sub Class_Terminate() > Set oWinSock = Nothing >End Sub >'bubble up all events >Private Sub oWinSock_Close() > RaiseEvent oClose >End Sub >Private Sub oWinSock_Connect() > RaiseEvent oConnect >End Sub >Private Sub oWinSock_ConnectionRequest(ByVal requestID As Long) > RaiseEvent oConnectionRequest(requestID) >End Sub >......
>> Hi, >> I tried to add a form. But VB doesn't allow me to add form >> into my ActiveX DLL application. That button is greyed out. >> If I use the no form way to do this, how can I catch the >> events of the constitute control. I need to forward some >> of the events back to user of my COM. >> Thanks a lot. >> Bing >> >-----Original Message----- >> >Hi, >> >Yes. >> >You can either place a form in your ActiveX DLL and use >> it to host the >> >ActiveX OCX, then reference it from you class module (I >> usually do it this >> >way), or you can set a reference to the ActiveX control, >> and use >> >CreateObject or similar syntax in code only, with no >> form. Simply because a >> >form is included in the project does not mean that the >> form ever needs to be >> >made visible -- it does not. Thus, you do not have to >> have any UI elements >> >to use forms to host ActiveX controls. >> >-- >> >Richard Grier (Microsoft Visual Basic MVP) >> >Hard & Software >> >12962 West Louisiana Avenue >> >Lakewood, CO 80228 >> >303-986-2179 (voice) >> >303-986-3143 (fax) >> >Leave voice mail or fax that I can receive as email at >> 303-593-9315 >> >Author of Visual Basic Programmer's Guide to Serial >> Communications, 2nd >> >Edition ISBN 1-890422-25-8 (355 pages). >> >For information look on my homepage at >> http://www.hardandsoftware.net. >> >Use the Books link to order. For faster service contact >> the publisher at >> >http://www.mabry.com. >> >. >.
|
Sun, 23 May 2004 10:39:27 GMT |
|
 |
Ivan Demkovitc #10 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Can you post some code?
Quote: > Now I have my COM. It hosts an ActiveX control inside it. > In my COM, I have event procedure to check events of that > ActiveX control. In that event procedure, I want to use > Err.Raise to report errors back to the user of my COM. But > it looks like Err.Raise doesn't work in that event > procedure, which means it cannot forward err event back to > the client. Does anybody know how to fix this problem? > Thanks very much in advance. > >-----Original Message----- > >Ok. > >Start new Project. > >Project/References browse for OCX file you need. > >Then write code in class module (this is sample for > WinSock Control) > >Option Explicit > >Private WithEvents oWinSock As Winsock > >'Declare all object events to bubble them up to > >'application > >Event oError(ByVal Number As Integer, Description As > String, ByVal Scode As > >Long, ByVal Source As String, ByVal HelpFile As String, > ByVal HelpContext As > >Long, CancelDisplay As Boolean) > >Event oDataArrival(ByVal bytesTotal As Long) > >Event oClose() > >Event oConnect() > >Event oConnectionRequest(ByVal requestID As Long) > >Event oSendComplete() > >Event oSendProgress(ByVal bytesSent As Long, ByVal > bytesRemaining As Long) > >Private Sub Class_Initialize() > > Set oWinSock = New MSWinsockLib.Winsock > >End Sub > >Private Sub Class_Terminate() > > Set oWinSock = Nothing > >End Sub > >'bubble up all events > >Private Sub oWinSock_Close() > > RaiseEvent oClose > >End Sub > >Private Sub oWinSock_Connect() > > RaiseEvent oConnect > >End Sub > >Private Sub oWinSock_ConnectionRequest(ByVal requestID As > Long) > > RaiseEvent oConnectionRequest(requestID) > >End Sub > >......
> >> Hi, > >> I tried to add a form. But VB doesn't allow me to add > form > >> into my ActiveX DLL application. That button is greyed > out. > >> If I use the no form way to do this, how can I catch the > >> events of the constitute control. I need to forward some > >> of the events back to user of my COM. > >> Thanks a lot. > >> Bing > >> >-----Original Message----- > >> >Hi, > >> >Yes. > >> >You can either place a form in your ActiveX DLL and use > >> it to host the > >> >ActiveX OCX, then reference it from you class module (I > >> usually do it this > >> >way), or you can set a reference to the ActiveX > control, > >> and use > >> >CreateObject or similar syntax in code only, with no > >> form. Simply because a > >> >form is included in the project does not mean that the > >> form ever needs to be > >> >made visible -- it does not. Thus, you do not have to > >> have any UI elements > >> >to use forms to host ActiveX controls. > >> >-- > >> >Richard Grier (Microsoft Visual Basic MVP) > >> >Hard & Software > >> >12962 West Louisiana Avenue > >> >Lakewood, CO 80228 > >> >303-986-2179 (voice) > >> >303-986-3143 (fax) > >> >Leave voice mail or fax that I can receive as email at > >> 303-593-9315 > >> >Author of Visual Basic Programmer's Guide to Serial > >> Communications, 2nd > >> >Edition ISBN 1-890422-25-8 (355 pages). > >> >For information look on my homepage at > >> http://www.hardandsoftware.net. > >> >Use the Books link to order. For faster service > contact > >> the publisher at > >> >http://www.mabry.com. > >> >. > >.
|
Sun, 23 May 2004 22:44:28 GMT |
|
 |
Bing #11 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Private Sub amTapi1_Connected() dim i On Error GoTo errHandler i = 1 / 0 ' set status pStatus = CONN ' Hang up any existing call amTapi1.HangUp Exit Sub errHandler: Err.Raise Err.Number, Err.Source, Err.Description End Sub where amTapi1 is a constitute component. Connected is one of its events. When "Connected" event launches and triggers the "divide by zero" error, the program will stop at the errHandler of this event. It doesn't forward this error back to the client of my component as what Err.Raise should do. Err.Raise works fine in methods of my component. Thanks very much. Bing Quote: >-----Original Message----- >Can you post some code?
>> Now I have my COM. It hosts an ActiveX control inside it. >> In my COM, I have event procedure to check events of that >> ActiveX control. In that event procedure, I want to use >> Err.Raise to report errors back to the user of my COM. But >> it looks like Err.Raise doesn't work in that event >> procedure, which means it cannot forward err event back to >> the client. Does anybody know how to fix this problem? >> Thanks very much in advance. >> >-----Original Message----- >> >Ok. >> >Start new Project. >> >Project/References browse for OCX file you need. >> >Then write code in class module (this is sample for >> WinSock Control) >> >Option Explicit >> >Private WithEvents oWinSock As Winsock >> >'Declare all object events to bubble them up to >> >'application >> >Event oError(ByVal Number As Integer, Description As >> String, ByVal Scode As >> >Long, ByVal Source As String, ByVal HelpFile As String, >> ByVal HelpContext As >> >Long, CancelDisplay As Boolean) >> >Event oDataArrival(ByVal bytesTotal As Long) >> >Event oClose() >> >Event oConnect() >> >Event oConnectionRequest(ByVal requestID As Long) >> >Event oSendComplete() >> >Event oSendProgress(ByVal bytesSent As Long, ByVal >> bytesRemaining As Long) >> >Private Sub Class_Initialize() >> > Set oWinSock = New MSWinsockLib.Winsock >> >End Sub >> >Private Sub Class_Terminate() >> > Set oWinSock = Nothing >> >End Sub >> >'bubble up all events >> >Private Sub oWinSock_Close() >> > RaiseEvent oClose >> >End Sub >> >Private Sub oWinSock_Connect() >> > RaiseEvent oConnect >> >End Sub >> >Private Sub oWinSock_ConnectionRequest(ByVal requestID As >> Long) >> > RaiseEvent oConnectionRequest(requestID) >> >End Sub >> >......
>> >> Hi, >> >> I tried to add a form. But VB doesn't allow me to add >> form >> >> into my ActiveX DLL application. That button is greyed >> out. >> >> If I use the no form way to do this, how can I catch the >> >> events of the constitute control. I need to forward some >> >> of the events back to user of my COM. >> >> Thanks a lot. >> >> Bing >> >> >-----Original Message----- >> >> >Hi, >> >> >Yes. >> >> >You can either place a form in your ActiveX DLL and use >> >> it to host the >> >> >ActiveX OCX, then reference it from you class module (I >> >> usually do it this >> >> >way), or you can set a reference to the ActiveX >> control, >> >> and use >> >> >CreateObject or similar syntax in code only, with no >> >> form. Simply because a >> >> >form is included in the project does not mean that the >> >> form ever needs to be >> >> >made visible -- it does not. Thus, you do not have to >> >> have any UI elements >> >> >to use forms to host ActiveX controls. >> >> >-- >> >> >Richard Grier (Microsoft Visual Basic MVP) >> >> >Hard & Software >> >> >12962 West Louisiana Avenue >> >> >Lakewood, CO 80228 >> >> >303-986-2179 (voice) >> >> >303-986-3143 (fax) >> >> >Leave voice mail or fax that I can receive as email at >> >> 303-593-9315 >> >> >Author of Visual Basic Programmer's Guide to Serial >> >> Communications, 2nd >> >> >Edition ISBN 1-890422-25-8 (355 pages). >> >> >For information look on my homepage at >> >> http://www.hardandsoftware.net. >> >> >Use the Books link to order. For faster service >> contact >> >> the publisher at >> >> >http://www.mabry.com. >> >> >. >> >. >.
|
Mon, 24 May 2004 03:39:07 GMT |
|
 |
Ivan Demkovitc #12 / 12
|
 Can ActiveX DLL component contain ActiveX control?
Without looking more deep I can suggest you to try next: Instead of trying to raise error, handle it. Than raise your custom error. Or, perhaps you need create your Error event and fire it when error happens. Try search on it in MSDN.
Quote: > Private Sub amTapi1_Connected() > dim i > On Error GoTo errHandler > i = 1 / 0 > ' set status > pStatus = CONN > ' Hang up any existing call > amTapi1.HangUp > Exit Sub > errHandler: > Err.Raise Err.Number, Err.Source, Err.Description > End Sub > where amTapi1 is a constitute component. Connected is one > of its events. > When "Connected" event launches and triggers the "divide > by zero" error, the program will stop at the errHandler of > this event. It doesn't forward this error back to the > client of my component as what Err.Raise should do. > Err.Raise works fine in methods of my component. > Thanks very much. > Bing > >-----Original Message----- > >Can you post some code?
> >> Now I have my COM. It hosts an ActiveX control inside > it. > >> In my COM, I have event procedure to check events of > that > >> ActiveX control. In that event procedure, I want to use > >> Err.Raise to report errors back to the user of my COM. > But > >> it looks like Err.Raise doesn't work in that event > >> procedure, which means it cannot forward err event back > to > >> the client. Does anybody know how to fix this problem? > >> Thanks very much in advance. > >> >-----Original Message----- > >> >Ok. > >> >Start new Project. > >> >Project/References browse for OCX file you need. > >> >Then write code in class module (this is sample for > >> WinSock Control) > >> >Option Explicit > >> >Private WithEvents oWinSock As Winsock > >> >'Declare all object events to bubble them up to > >> >'application > >> >Event oError(ByVal Number As Integer, Description As > >> String, ByVal Scode As > >> >Long, ByVal Source As String, ByVal HelpFile As String, > >> ByVal HelpContext As > >> >Long, CancelDisplay As Boolean) > >> >Event oDataArrival(ByVal bytesTotal As Long) > >> >Event oClose() > >> >Event oConnect() > >> >Event oConnectionRequest(ByVal requestID As Long) > >> >Event oSendComplete() > >> >Event oSendProgress(ByVal bytesSent As Long, ByVal > >> bytesRemaining As Long) > >> >Private Sub Class_Initialize() > >> > Set oWinSock = New MSWinsockLib.Winsock > >> >End Sub > >> >Private Sub Class_Terminate() > >> > Set oWinSock = Nothing > >> >End Sub > >> >'bubble up all events > >> >Private Sub oWinSock_Close() > >> > RaiseEvent oClose > >> >End Sub > >> >Private Sub oWinSock_Connect() > >> > RaiseEvent oConnect > >> >End Sub > >> >Private Sub oWinSock_ConnectionRequest(ByVal requestID > As > >> Long) > >> > RaiseEvent oConnectionRequest(requestID) > >> >End Sub > >> >......
> >> >> Hi, > >> >> I tried to add a form. But VB doesn't allow me to add > >> form > >> >> into my ActiveX DLL application. That button is > greyed > >> out. > >> >> If I use the no form way to do this, how can I catch > the > >> >> events of the constitute control. I need to forward > some > >> >> of the events back to user of my COM. > >> >> Thanks a lot. > >> >> Bing > >> >> >-----Original Message----- > >> >> >Hi, > >> >> >Yes. > >> >> >You can either place a form in your ActiveX DLL and > use > >> >> it to host the > >> >> >ActiveX OCX, then reference it from you class > module (I > >> >> usually do it this > >> >> >way), or you can set a reference to the ActiveX > >> control, > >> >> and use > >> >> >CreateObject or similar syntax in code only, with no > >> >> form. Simply because a > >> >> >form is included in the project does not mean that > the > >> >> form ever needs to be > >> >> >made visible -- it does not. Thus, you do not have > to > >> >> have any UI elements > >> >> >to use forms to host ActiveX controls. > >> >> >-- > >> >> >Richard Grier (Microsoft Visual Basic MVP) > >> >> >Hard & Software > >> >> >12962 West Louisiana Avenue > >> >> >Lakewood, CO 80228 > >> >> >303-986-2179 (voice) > >> >> >303-986-3143 (fax) > >> >> >Leave voice mail or fax that I can receive as email > at > >> >> 303-593-9315 > >> >> >Author of Visual Basic Programmer's Guide to Serial > >> >> Communications, 2nd > >> >> >Edition ISBN 1-890422-25-8 (355 pages). > >> >> >For information look on my homepage at > >> >> http://www.hardandsoftware.net. > >> >> >Use the Books link to order. For faster service > >> contact > >> >> the publisher at > >> >> >http://www.mabry.com. > >> >> >. > >> >. > >.
|
Mon, 24 May 2004 05:39:14 GMT |
|
|
|