Home All Groups Group Topic Archive Search About
Author
22 Mar 2006 9:42 PM
Brian Shafer
Hi,
I have a vendors ActiveX control, that I want to put into a class.  The main
reason for this, I have app that runs on 3 computers.  I want this control on
just one computer.  I need to handle errors and messages with the control. 
So, I was thinking the easiest way would be to write a "wrapper" class around
the control.  I've never written my own class and would like some help
getting started... 
Any Help?
  Thanks,
    Brian Shafer

Author
22 Mar 2006 9:47 PM
Ken Halter
Show quote Hide quote
"Brian Shafer" <BrianSha***@discussions.microsoft.com> wrote in message
news:23F74393-93AF-4DE1-B4CB-1E4DD48C1A3A@microsoft.com...
> Hi,
> I have a vendors ActiveX control, that I want to put into a class.  The
> main
> reason for this, I have app that runs on 3 computers.  I want this control
> on
> just one computer.  I need to handle errors and messages with the control.
> So, I was thinking the easiest way would be to write a "wrapper" class
> around
> the control.  I've never written my own class and would like some help
> getting started...
> Any Help?
>  Thanks,
>    Brian Shafer

You can't replace a 3rd party control with a class. You can create the
wrapper but the OCX still needs to be in place and a class won't help get by
any licensing problems. Plus, if you do this, you'll want to avoid passing
instances of the referenced OCX around to any public methods or you'll run
into the wall below....

PRB: Passing ActiveX Control to Component Gives "Type Mismatch" Error
Message
http://support.microsoft.com/kb/190210/en-us

Unless there are specific licensing restrictions, you should be able to
install the OCX on a server and, after registering it locally, it should run
on any PC that has access to the server.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Author
22 Mar 2006 10:09 PM
Brian Shafer
Might have sounded shady, but I am not trying to get around a licensing
issue.  
I have this control that controls a Marquee display.   I wanted to
intergrate the ocx into one of my apps and pass the data from there.  Problem
is,  I run this app on 3 computers.  I was just tring to think of a way to
get around putting code in each call to a procedure of the ocx and check for
compter name and then execute my code....

Show quoteHide quote
"Ken Halter" wrote:

> "Brian Shafer" <BrianSha***@discussions.microsoft.com> wrote in message
> news:23F74393-93AF-4DE1-B4CB-1E4DD48C1A3A@microsoft.com...
> > Hi,
> > I have a vendors ActiveX control, that I want to put into a class.  The
> > main
> > reason for this, I have app that runs on 3 computers.  I want this control
> > on
> > just one computer.  I need to handle errors and messages with the control.
> > So, I was thinking the easiest way would be to write a "wrapper" class
> > around
> > the control.  I've never written my own class and would like some help
> > getting started...
> > Any Help?
> >  Thanks,
> >    Brian Shafer
>
> You can't replace a 3rd party control with a class. You can create the
> wrapper but the OCX still needs to be in place and a class won't help get by
> any licensing problems. Plus, if you do this, you'll want to avoid passing
> instances of the referenced OCX around to any public methods or you'll run
> into the wall below....
>
> PRB: Passing ActiveX Control to Component Gives "Type Mismatch" Error
> Message
> http://support.microsoft.com/kb/190210/en-us
>
> Unless there are specific licensing restrictions, you should be able to
> install the OCX on a server and, after registering it locally, it should run
> on any PC that has access to the server.
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>
>
>
Author
22 Mar 2006 10:40 PM
Ken Halter
Show quote Hide quote
"Brian Shafer" <BrianSha***@discussions.microsoft.com> wrote in message
news:712F211B-3681-480D-9861-D20BE9627B46@microsoft.com...
> Might have sounded shady, but I am not trying to get around a licensing
> issue.

No problem... wasn't trying to accuse. Just "inform" <g>

> I have this control that controls a Marquee display.   I wanted to
> intergrate the ocx into one of my apps and pass the data from there.
> Problem
> is,  I run this app on 3 computers.  I was just tring to think of a way to
> get around putting code in each call to a procedure of the ocx and check
> for
> compter name and then execute my code....

I'm not really catching on here... you have to pass the computer name to the
ocx? or, just trying to reduce the code required to call procedures in the
ocx?

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Author
22 Mar 2006 10:53 PM
Brian Shafer
No problem Ken, just didn't want anyone else reading here to think I might be
doing something I shouldn't be doing.

This might help alittle bit....
This ocx is for comumication to an LED Display board on our network.  I pass
it some varibles to display text and changes colors.. stuff like that.   What
I am doing is passing production data from one of my manufacting interfaces
that I wrote in vb.  The issue is I run this app on 3 HMI "Human Machine
Interfaces".   And I don't want each machine to be sending data to the LED
display on the network.  Would be reduntant, and make my LED display blink
alot(each new message, clears out the old message first).  
So, instead of going back and adding a check for what the computer name is
and only running the code on the computer that matches the comptername,  I
thought I'd write a class and do all of the coding there.

It was only 7 places in the code that I had to add that compairion too.  But
I went ahead and did that...

But thanks for you insight :)
   Brian Shafer

Show quoteHide quote
"Ken Halter" wrote:

> "Brian Shafer" <BrianSha***@discussions.microsoft.com> wrote in message
> news:712F211B-3681-480D-9861-D20BE9627B46@microsoft.com...
> > Might have sounded shady, but I am not trying to get around a licensing
> > issue.
>
> No problem... wasn't trying to accuse. Just "inform" <g>
>
> > I have this control that controls a Marquee display.   I wanted to
> > intergrate the ocx into one of my apps and pass the data from there.
> > Problem
> > is,  I run this app on 3 computers.  I was just tring to think of a way to
> > get around putting code in each call to a procedure of the ocx and check
> > for
> > compter name and then execute my code....
>
> I'm not really catching on here... you have to pass the computer name to the
> ocx? or, just trying to reduce the code required to call procedures in the
> ocx?
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>
>
>