How get "miscStatus" from vb6 ocx?

130 views Asked by At

How I can get miscStatus for VB6 ocx from .net without need for register it on local computer?

I use TLI (TypeLibInfo) for all other info about ocx but this property i do not know how get?

Did someone know how regsvr32 generate MiscStatus when register ocx?


EDIT: I forget say that I want obtain miscStatus from ocx without need for register it on local computer.

2

There are 2 answers

0
StayOnTarget On

I don't believe there is a standard tool like TLI that can do this. miscStatus appears to be written during registration by the DLLRegisterFunction call, which is provided by the DLL/OCX itself and can do basically anything it wants.

For instance, the registry values to be written during registration might be contained in a resource. But that is up to the programmer.

Looking at some older source code of regsvr32 itself you can see it totally omits the keyword miscstatus. I think this confirms that its value isn't required to be stored in any standardized way.

If you absolutely cannot register the OCX on your dev/build PC, the next best thing I can think of would be to register it in some kind of sandbox - like a VM, or Sandboxie, or maybe even Docker. Then you can throw away the sandbox after reading the registry value. But I've never really tried this.


Also, consider if that value really is essential. If you leave it out, does anything break? It may be that many of the misc status flags are not set or don't matter for your particular applicaiton.

1
Étienne Laneville On

You can try locating the OCX in the Registry using Registry.GetValue. It sounds like you probably already have the OCX's CLSID:

Dim ocxClsid As String = "13DE4A42-8D21-4C8E-BF9C-8F69CB068FCA" ' Replace with your CLSID
Dim key As String = "HKEY_CLASSES_ROOT\CLSID\{" & ocxClsid & "}\"

Dim readValue = My.Computer.Registry.GetValue(
    key, "MiscStatus", Nothing)