For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > July 2006 > How Do I Com Wrap OCX files for a VB6 app?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How Do I Com Wrap OCX files for a VB6 app?
Justin [497165]

2006-06-29, 6:56 pm

I have a few older applications that I want to get up and running in a U3
environment. If you don't know what U3 is that's fine. Just know that
while in this environment I CAN NOT register the OCX files that I need to
run my apps.

I've been told to wrap these OCX files in a COM Wrapper so they can be used
without registering them. I searched and searched and came up with nothing!
I have no clue how to do this.

Can someone please help me out or at the very least point me to something
that discusses this?

In short - These are pretty simple VB6 apps that use OCX controls. When I
install my app I need to reg these files however, now, that's not an option.

Thanks for any advise!


Karl E. Peterson

2006-06-29, 6:56 pm

Justin [497165] wrote:
> I have a few older applications that I want to get up and running in
> a U3 environment. If you don't know what U3 is that's fine. Just
> know that while in this environment I CAN NOT register the OCX files
> that I need to run my apps.
>
> I've been told to wrap these OCX files in a COM Wrapper so they can
> be used without registering them. I searched and searched and came
> up with nothing! I have no clue how to do this.
>
> Can someone please help me out or at the very least point me to
> something that discusses this?
>
> In short - These are pretty simple VB6 apps that use OCX controls.
> When I install my app I need to reg these files however, now, that's
> not an option.
>
> Thanks for any advise!


Well, this just isn't making sense. VB6 apps can't use an unregistered OCX,
either. I think you have your terms . Do you really mean that this
U3-thingie simply cannot use OCX controls at all? But it is capable of
interacting with COM objects exposed, say, from an ActiveX DLL?
--
Working without a .NET?
http://classicvb.org/


Justin [497165]

2006-06-29, 6:56 pm

U3 allows you to run your apps from a USB drive. When you unplug the drive
you MUST undo everything you did to the machine and keep all data on the USB
drive.

So two things are an issue here.

1. I can register the OCX files on startup and unregister them when the
drive is removed. I've already handled this only to discover...
2. The U3 apps must run while logged on as a GUEST. You can not register
these OCX files while you are a GUEST on 2000, XP and 2003.

Thus they tell everyone specificly to included all DLLs and OCX files in a
COM Wrapper. Here is where I'm stuck. This makes no sense to me???


MikeD

2006-06-29, 6:56 pm


"Justin [497165]" <Justin@NoSpam.com> wrote in message
news:OoEm078mGHA.3544@TK2MSFTNGP05.phx.gbl...
> U3 allows you to run your apps from a USB drive. When you unplug the
> drive you MUST undo everything you did to the machine and keep all data on
> the USB drive.
>
> So two things are an issue here.
>
> 1. I can register the OCX files on startup and unregister them when the
> drive is removed. I've already handled this only to discover...
> 2. The U3 apps must run while logged on as a GUEST. You can not register
> these OCX files while you are a GUEST on 2000, XP and 2003.
>
> Thus they tell everyone specificly to included all DLLs and OCX files in a
> COM Wrapper. Here is where I'm stuck. This makes no sense to me???



I think you're SOL. ActiveX components must be registered. A Guest user
doesn't have permissions to do that.

The only thing I can suggest, and I don't know if you can do this as you
weren't clear if you have ALL the source code for the EXE *and* the OCXs, is
to re-write your VB6 apps to include the UserControl modules from the OCX(s)
into the EXE. Basically, this means all the UserControls are compiled into
the EXE. You shouldn't have a problem then because nothing needs
registered.

I'm curious though. With the restrictions you stated, how does the VB6
runtime get registered?

I suppose another possible "solution" is that the OCXs exist on the local
hard drive and are "pre-registered".

Most likely, to provide any real answer, we'd need to know more about this
U3 thingy. But it sounds like it has some serious constraints to have to
deal with, and with a VB app that utilizes ActiveX components, you might not
be able to work around them (at least easily and without having to re-write
the VB apps).

--
Mike
Microsoft MVP Visual Basic


Karl E. Peterson

2006-06-29, 6:56 pm

Justin [497165] wrote:
> U3 allows you to run your apps from a USB drive. When you unplug the
> drive you MUST undo everything you did to the machine and keep all
> data on the USB drive.


Interesting!

> So two things are an issue here.
>
> 1. I can register the OCX files on startup and unregister them when
> the drive is removed. I've already handled this only to discover...


Cool.

> 2. The U3 apps must run while logged on as a GUEST. You can not
> register these OCX files while you are a GUEST on 2000, XP and 2003.


Ugh... Oh man, you're screwed, aren't ya?

> Thus they tell everyone specificly to included all DLLs and OCX files
> in a COM Wrapper. Here is where I'm stuck. This makes no sense to
> me???


Yep, no sense here, either. If you can't write to HKCR and/or HKLM, no
amount of wrapping is gonna allow you to use unregistered ActiveX
components. I mean, the thing to ask these folks is -- if it's a *COM*
wrapper, how are you supposed to register *that*?

Unless, and this is a long shot, unless the OCXs were written by you and you
can include them directly within your app?
--
Working without a .NET?
http://classicvb.org/


Karl E. Peterson

2006-06-29, 6:56 pm

MikeD wrote:
> I'm curious though. With the restrictions you stated, how does the
> VB6 runtime get registered?


Believe it or not, it isn't an axDLL! No registration required.
--
Working without a .NET?
http://classicvb.org/


Karl E. Peterson

2006-06-29, 6:56 pm

MikeD wrote:
> Most likely, to provide any real answer, we'd need to know more about
> this U3 thingy.


Looks like a *very* concept!

http://www.u3.com/developers/default.aspx

> But it sounds like it has some serious constraints to
> have to deal with, and with a VB app that utilizes ActiveX
> components, you might not be able to work around them (at least
> easily and without having to re-write the VB apps).


That's my initial take. I just sent off an email to their "for more info"
alias.
--
Working without a .NET?
http://classicvb.org/


MikeD

2006-06-29, 6:56 pm


"Karl E. Peterson" <karl@mvps.org> wrote in message
news:uPZK1b9mGHA.3980@TK2MSFTNGP03.phx.gbl...
> MikeD wrote:
>
> Believe it or not, it isn't an axDLL! No registration required.



Are we talking about the same "VB6 runtime" file. I'm talking about
MSVBVM60.DLL, which is an ActiveX DLL and needs registered (at least as far
as I know).

--
Mike
Microsoft MVP Visual Basic


Stefan Berglund

2006-06-29, 6:56 pm

On Thu, 29 Jun 2006 16:56:44 -0700, "Karl E. Peterson" <karl@mvps.org>
wrote:
in <e3I9te9mGHA.3884@TK2MSFTNGP02.phx.gbl>

>MikeD wrote:
>
>Looks like a *very* concept!
>
>http://www.u3.com/developers/default.aspx
>
>
>That's my initial take. I just sent off an email to their "for more info"
>alias.


That does look . I wonder how you do a multi user networked U3 app.

---
Stefan Berglund
Karl E. Peterson

2006-06-29, 6:56 pm

MikeD wrote:
> "Karl E. Peterson" <karl@mvps.org> wrote in message
> news:uPZK1b9mGHA.3980@TK2MSFTNGP03.phx.gbl...
>
> Are we talking about the same "VB6 runtime" file. I'm talking about
> MSVBVM60.DLL, which is an ActiveX DLL and needs registered (at least
> as far as I know).


Okay, I was all set to tell you to load it up in Depends, and see that it
didn't export the ordinary entry points. Alas, it does. Which makes me
really wonder why I said the above, and the best I can come up with is --
it's true! <g> You can run, say, a VB6-authored EXE from a CD on a machine
without the runtime installed if the DLL is in the same folder as the EXE.
What's up with that? Hmmmm, it's threads like this:

http://groups.google.com/group/comp...1944a3c956006fa

that seem to beg the question...
--
Working without a .NET?
http://classicvb.org/


ljh

2006-06-30, 3:56 am

Its not cheap (in fact it is ridiculous....."Thinstall pricing starts at
$5,000 USD per application plus the end user per seat fee for distribution
of the Thinstall VOS.") but Thinstall (www.thinstall.com) is one option.

A much less expensive option is VB-Powerwrap
(http://www.moonlight-software.com/vbpower.htm) at $99.

Both will allow you to wrap your application into a single exe that requires
no installation to run. But, VB-Powerwrap leaves you some money for rent
and food.

ljh

"Justin [497165]" <Justin@NoSpam.com> wrote in message
news:Otj8Ze7mGHA.1428@TK2MSFTNGP02.phx.gbl...
>I have a few older applications that I want to get up and running in a U3
>environment. If you don't know what U3 is that's fine. Just know that
>while in this environment I CAN NOT register the OCX files that I need to
>run my apps.
>
> I've been told to wrap these OCX files in a COM Wrapper so they can be
> used without registering them. I searched and searched and came up with
> nothing! I have no clue how to do this.
>
> Can someone please help me out or at the very least point me to something
> that discusses this?
>
> In short - These are pretty simple VB6 apps that use OCX controls. When I
> install my app I need to reg these files however, now, that's not an
> option.
>
> Thanks for any advise!
>



Ervins Zascerinskis

2006-06-30, 3:56 am

Look there
http://www.molebox.com/

ervins.

"ljh" <reply@groups.please> wrote in message
news:XH4pg.3258$Oc5.2610@bignews4.bellsouth.net...
> Its not cheap (in fact it is ridiculous....."Thinstall pricing starts at
> $5,000 USD per application plus the end user per seat fee for distribution
> of the Thinstall VOS.") but Thinstall (www.thinstall.com) is one option.
>
> A much less expensive option is VB-Powerwrap
> (http://www.moonlight-software.com/vbpower.htm) at $99.
>
> Both will allow you to wrap your application into a single exe that
> requires
> no installation to run. But, VB-Powerwrap leaves you some money for rent
> and food.
>
> ljh
>
> "Justin [497165]" <Justin@NoSpam.com> wrote in message
> news:Otj8Ze7mGHA.1428@TK2MSFTNGP02.phx.gbl...
>
>



Paul Clement

2006-06-30, 7:56 am

On Thu, 29 Jun 2006 13:05:36 -0700, "Justin [497165]" <Justin@NoSpam.com> wrote:

¤ I have a few older applications that I want to get up and running in a U3
¤ environment. If you don't know what U3 is that's fine. Just know that
¤ while in this environment I CAN NOT register the OCX files that I need to
¤ run my apps.
¤
¤ I've been told to wrap these OCX files in a COM Wrapper so they can be used
¤ without registering them. I searched and searched and came up with nothing!
¤ I have no clue how to do this.
¤
¤ Can someone please help me out or at the very least point me to something
¤ that discusses this?
¤
¤ In short - These are pretty simple VB6 apps that use OCX controls. When I
¤ install my app I need to reg these files however, now, that's not an option.
¤
¤ Thanks for any advise!
¤

They do have an example for VB but I don't believe ActiveX is supported unless it is already
installed. You're probably limited to the VB runtime controls.

http://tinyurl.com/g7pbe


Paul
~~~~
Microsoft MVP (Visual Basic)
ljh

2006-06-30, 6:55 pm

I forgot about Molebox.......excellent software!

"Ervins Zascerinskis" <ervins@itc.neonet.lv> wrote in message
news:%238t8oPCnGHA.488@TK2MSFTNGP02.phx.gbl...
> Look there
> http://www.molebox.com/
>
> ervins.
>
> "ljh" <reply@groups.please> wrote in message
> news:XH4pg.3258$Oc5.2610@bignews4.bellsouth.net...
>
>



Schmidt

2006-07-01, 6:55 pm


"Justin [497165]" <Justin@NoSpam.com> schrieb im Newsbeitrag
news:Otj8Ze7mGHA.1428@TK2MSFTNGP02.phx.gbl...

> I've been told to wrap these OCX files in a COM Wrapper
> so they can be used without registering them.


The wrapping in another, additional COM-Component brings
nothing.

But there are solutions to your problem.
Here's one, wich costs you nothing:
It is definitely possible for VB, to use unregistered Dlls and OCXs.
One simply has to call the already builtin Dll/OCX-Function
DllGetClassObject, to get a ClassFactory-Instance for the requested
PublicClass.
With oClassFactory.CreateInstance an instance of the appropriate
Class can then be created without any lookup in the registry.
Since doing it this way requires a lot of correctly used OLE-API-Calls,
I've encapsulated the whole thing in some free Helper-Tools:
Here is an example, how to registryless load OCXes using the Tools:
www.datenhaus.de/Downloads/dh_Directcom.zip

Olaf



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com