[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Olaf, will dhRichClient3.dll and sqlite36_engine.dll run reg-free?

(Mike Mitchell)

10/20/2011 5:11:00 PM

XP SP3: I've tried building a manifest file using MMM (latest ver
0.9.305), but the .EXE won't run.

I've tried placing dhRichClient3.dll in the Deps folder (off the app
path) and specifying that location in the manifest. I've tried placing
it in the app folder. And I've tried the same (various combinations)
with sqlite36_engine.dll as well.

I've tried various tweaks within the manifest file, but so far the
..EXE just won't load. No errors/crashes/hangs. It just won't load.
Nothing shows up in Task Manager.

MM
8 Answers

Schmidt

10/21/2011 12:24:00 PM

0

Am 20.10.2011 19:11, schrieb MM:
> XP SP3: I've tried building a manifest file using MMM (latest ver
> 0.9.305), but the .EXE won't run.
>
> I've tried placing dhRichClient3.dll in the Deps folder (off the app
> path) and specifying that location in the manifest. I've tried placing
> it in the app folder. And I've tried the same (various combinations)
> with sqlite36_engine.dll as well.
>
> I've tried various tweaks within the manifest file, but so far the
> .EXE just won't load. No errors/crashes/hangs. It just won't load.
> Nothing shows up in Task Manager.

Hmm, never used the MMM-approach (because of
DirectCOM.dll providing its own regfree mechanism).

But did you ensure, that dhRichClient3.dll was
placed *together* with sqlite36_engine.dll
in your \Deps\ or App-Folder?

Just keep the two (or three, when DirectCOM.dll
is needed) Dlls always together - side-by-side -
in your deployment (your target-folders).


Aside from this "togetherness", there's nothing
which works differently from other AX-Dlls
in dhRichClient3. It's after all a normal,
VB6-compiled COM-Dll.


If you cannot get it to work with 'MMM' after
taking care of these "location-necessities" -
then just use it regfree over DirectCOM.dll -
this more low-level regfree approach should
be able to work in parallel to MMM - or if
RC3 or RC4 is the only COM-dependency in your
project, also standalone (without any Manifests).


You can use the cConstructor-Class as your
single Entry-Point into the RC3-Library (to be
able to create instances of all other classes -
as for example an SQLite cConnection-Object).


In a *.bas-module for example:

Private Declare Function GetInstanceEx Lib "DirectCom" _
(StrPtr_FName As Long, StrPtr_ClassName As Long, _
Optional ByVal UseAlteredSearchPath As Boolean = True) As Object

Public Property Get New_c() As cConstructor
Static statConstructor As cConstructor
If statConstructor Is Nothing Then
Set statConstructor = GetInstanceEx( _
StrPtr(App.Path & "\dhRichClient3.dll"), _
StrPtr("cConstructor"))
End If
Set New_c = statConstructor
End Property


Then you can use the above New_c-Helper throughout
your whole App, to create additional instances of
all kind of RC3-Classes regfree.

e.g. instead:

Set MyCnn = New cConnection
....

you would use
Set MyCnn = New_c.Connection
....

to create an instance over New_c, the already
regfree created Constructor-Helper-Instance.

Just do a projectwide search for the term:
'New c' to find all instantiation lines for
RichClient-Classes... and then replace all
of them with 'New_c.' appropriately.

In case you have a Sub Main() already in place
in your project, then there's no need to provide
New_c over a global, "*.bas-module Property-Definition" -
a normal gobal Variable would also work of course -
as for example:

Public New_c as cConstructor '<- define a global Variable

Sub Main()
If RunningInIDE Then 'when in IDE use the registered Binary
Set New_c = New cConstructor 'create the Helper-instance normally

Else 'use a non-registered Binary from your Exes App.Path
Set New_c = GetInstanceEx( _
StrPtr(App.Path & "\dhRichClient3.dll"), _
StrPtr("cConstructor"))
End If

'...
End Sub


Olaf

(Mike Mitchell)

10/21/2011 5:39:00 PM

0

On Oct 21, 1:24 pm, Schmidt <s...@online.de> wrote:
> Am 20.10.2011 19:11, schrieb MM:
>
> > XP SP3: I've tried building a manifest file using MMM (latest ver
> > 0.9.305), but the .EXE won't run.
>
> > I've tried placing dhRichClient3.dll in the Deps folder (off the app
> > path) and specifying that location in the manifest. I've tried placing
> > it in the app folder. And I've tried the same (various combinations)
> > with sqlite36_engine.dll as well.
>
> > I've tried various tweaks within the manifest file, but so far the
> > .EXE just won't load. No errors/crashes/hangs. It just won't load.
> > Nothing shows up in Task Manager.
>
> Hmm, never used the MMM-approach (because of
> DirectCOM.dll providing its own regfree mechanism).
>
> But did you ensure, that dhRichClient3.dll was
> placed *together* with sqlite36_engine.dll
> in your \Deps\ or App-Folder?
>
> Just keep the two (or three, when DirectCOM.dll
> is needed) Dlls always together - side-by-side -
> in your deployment (your target-folders).
>
> Aside from this "togetherness", there's nothing
> which works differently from other AX-Dlls
> in dhRichClient3. It's after all a normal,
> VB6-compiled COM-Dll.
>
> If you cannot get it to work with 'MMM' after
> taking care of these "location-necessities" -
> then just use it regfree over DirectCOM.dll -
> this more low-level regfree approach should
> be able to work in parallel to MMM - or if
> RC3 or RC4 is the only COM-dependency in your
> project, also standalone (without any Manifests).
>
> You can use the cConstructor-Class as your
> single Entry-Point into the RC3-Library (to be
> able to create instances of all other classes -
> as for example an SQLite cConnection-Object).
>
> In a *.bas-module for example:
>
> Private Declare Function GetInstanceEx Lib "DirectCom" _
>     (StrPtr_FName As Long, StrPtr_ClassName As Long, _
>      Optional ByVal UseAlteredSearchPath As Boolean = True) As Object
>
> Public Property Get New_c() As cConstructor
> Static statConstructor As cConstructor
>    If statConstructor Is Nothing Then
>      Set statConstructor = GetInstanceEx( _
>                            StrPtr(App.Path & "\dhRichClient3.dll"), _
>                            StrPtr("cConstructor"))
>    End If
>    Set New_c = statConstructor
> End Property
>
> Then you can use the above New_c-Helper throughout
> your whole App, to create additional instances of
> all kind of RC3-Classes regfree.
>
> e.g. instead:
>
> Set MyCnn = New cConnection
> ...
>
> you would use
> Set MyCnn = New_c.Connection
> ...
>
> to create an instance over New_c, the already
> regfree created Constructor-Helper-Instance.
>
> Just do a projectwide search for the term:
> 'New c' to find all instantiation lines for
> RichClient-Classes... and then replace all
> of them with 'New_c.' appropriately.
>
> In case you have a Sub Main() already in place
> in your project, then there's no need to provide
> New_c over a global, "*.bas-module Property-Definition" -
> a normal gobal Variable would also work of course -
> as for example:
>
> Public New_c as cConstructor '<- define a global Variable
>
> Sub Main()
>    If RunningInIDE Then 'when in IDE use the registered Binary
>      Set New_c = New cConstructor 'create the Helper-instance normally
>
>    Else 'use a non-registered Binary from your Exes App.Path
>      Set New_c = GetInstanceEx( _
>                  StrPtr(App.Path & "\dhRichClient3.dll"), _
>                  StrPtr("cConstructor"))
>    End If
>
>    '...
> End Sub
>
> Olaf

I'm away this weekend so can't try anything out, but one question in
the meantime: Do I have to include DirectCOM.DLL alongside
dhRichClient3.dll and sqlite36_engine.dll? I didn't include it because
MMM didn't find any dependencies when it added dhRichClient3.dll.

MM

Schmidt

10/24/2011 9:51:00 AM

0

Am 21.10.2011 19:39, schrieb MM:
> Do I have to include DirectCOM.DLL alongside
> dhRichClient3.dll and sqlite36_engine.dll?

DirectCOM.dll contains regfree Functions
and Threading-Support for VB.

You don't need to ship it alongside, when
you don't need any of the above (for example
when you only need SQlite-DB-support).

To be on the safe side, better to include it -
it's not a large file - and normally belongs
to this "mini-framework" for "full functionality".


Olaf

(Mike Mitchell)

10/27/2011 9:39:00 AM

0

On Mon, 24 Oct 2011 11:51:18 +0200, Schmidt <sss@online.de> wrote:

>Am 21.10.2011 19:39, schrieb MM:
>> Do I have to include DirectCOM.DLL alongside
>> dhRichClient3.dll and sqlite36_engine.dll?
>
>DirectCOM.dll contains regfree Functions
>and Threading-Support for VB.
>
>You don't need to ship it alongside, when
>you don't need any of the above (for example
>when you only need SQlite-DB-support).
>
>To be on the safe side, better to include it -
>it's not a large file - and normally belongs
>to this "mini-framework" for "full functionality".
>
>
>Olaf

I've got it working without all that New_c constructor stuff, using
MMM.

The mistake was including these lines in the manifest:

<file name="sqlite36_engine.dll" loadFrom="Deps\sqlite36_engine.dll">
</file>

As soon as I took them out, the application ran fine.

It doesn't need DirectCOM.dll, so I've removed it.

Cheers!

MM

Mike Williams

10/27/2011 11:35:00 AM

0

"MM" <kylix_is@yahoo.co.uk> wrote in message
news:169ia710jor4k4qdf0oijeb570lff6ibce@4ax.com...

> I've got it working without all that New_c constructor
> stuff, using MMM . . .

I've noticed from recent posts that you seem to use MMM quite a lot and I
wonder if you know about the problem it has with the DPI Aware section of
the manifest it produces, which does not work on either Vista or Win7
machines that are running at greater than the standard 100% (96 dpi) setting
unless the user has specifically set his machine to use the old WinXP DPI
Scaling (a setting which is not the default setting at 150% or greater), or
unless you instruct all your users to make manual changes to the
compatibility settings for your app. This is a problem with all versions of
MMM that have a DPI Aware setting available, including the latest version 9
which I believe is the final version and which includes the VB source code.
The failure of the DPI Aware section on such machines can in some cases
cause problems with the positioning or size of some elements of your
graphical output, and in all cases it will make your text and other
graphical output look quite fuzzy. It is however fairly easy to fix that
problem by modifying the MMM source code and recompiling so that the DPI
Aware section it produces does work on such machines. Post again if you
would like further details.

Mike




(Mike Mitchell)

10/27/2011 12:54:00 PM

0

On Thu, 27 Oct 2011 12:34:30 +0100, "Mike Williams"
<Mike@WhiskyAndCoke.com> wrote:

>"MM" <kylix_is@yahoo.co.uk> wrote in message
>news:169ia710jor4k4qdf0oijeb570lff6ibce@4ax.com...
>
>> I've got it working without all that New_c constructor
>> stuff, using MMM . . .
>
>I've noticed from recent posts that you seem to use MMM quite a lot and I
>wonder if you know about the problem it has with the DPI Aware section of
>the manifest it produces, which does not work on either Vista or Win7
>machines that are running at greater than the standard 100% (96 dpi) setting
>unless the user has specifically set his machine to use the old WinXP DPI
>Scaling (a setting which is not the default setting at 150% or greater), or
>unless you instruct all your users to make manual changes to the
>compatibility settings for your app. This is a problem with all versions of
>MMM that have a DPI Aware setting available, including the latest version 9
>which I believe is the final version and which includes the VB source code.
>The failure of the DPI Aware section on such machines can in some cases
>cause problems with the positioning or size of some elements of your
>graphical output, and in all cases it will make your text and other
>graphical output look quite fuzzy. It is however fairly easy to fix that
>problem by modifying the MMM source code and recompiling so that the DPI
>Aware section it produces does work on such machines. Post again if you
>would like further details.
>
>Mike

Thanks, that's useful to know. I have in the past done basic testing
on Vista and W7 to verify that the app works and haven't noticed
anything strange so far. But I'll look into this DPI Aware stuff and
see if it could be a problem.

The latest problem I have with MMM is that it generates TWO comClass
entries for every control, e.g.

<comClass clsid="{1EFB6596-857C-11D1-B16A-00C0F0283628}"
tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"
threadingModel="Apartment" progid="MSComctlLib.TabStrip.2"
description="Microsoft TabStrip Control" />

<comClass clsid="{24B224E0-9545-4A2F-ABD5-86AA8A849385}"
tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"
threadingModel="Apartment" progid="MSComctlLib.TabStrip.2"
description="Microsoft TabStrip Control" />

The above duplication (with different clsid but same tlbid) is
repeated for every control in the manifest, e.g. Microsoft Toolbar
Control, Microsoft StatusBar Control, Microsoft ProgressBar Control,
TreeCtrl.2 (i.e. TreeView), ListViewCtrl.2, ImageListCtrl.2, Slider.2,
ImageComboCtl.2, and TabDlg.SSTab.1.

I then have to remove the second entry in each case, and then the
application loads okay. One day I'll get around to looking at the MMM
source code and seeing how it works.

MM

Mike Williams

10/27/2011 5:48:00 PM

0

"MM" <kylix_is@yahoo.co.uk> wrote in message
news:ehkia71cuf583dgtgg9o8pss2ob9ga4o9e@4ax.com...

> The latest problem I have with MMM is that it generates
> TWO comClass entries for every control, e.g.
> <comClass clsid="{1EFB6596-857C-11D1-B16A-00C0F0283628}"
> tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"
> threadingModel="Apartment" progid="MSComctlLib.TabStrip.2"
> description="Microsoft TabStrip Control" />
> <comClass clsid="{24B224E0-9545-4A2F-ABD5-86AA8A849385}"
> tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"
> threadingModel="Apartment" progid="MSComctlLib.TabStrip.2"
> description="Microsoft TabStrip Control" />
> The above duplication (with different clsid but same tlbid) is
> repeated for every control in the manifest, e.g. Microsoft Toolbar
> Control, Microsoft StatusBar Control, Microsoft ProgressBar Control,
> TreeCtrl.2 (i.e. TreeView), ListViewCtrl.2, ImageListCtrl.2, Slider.2,
> ImageComboCtl.2, and TabDlg.SSTab.1.
> I then have to remove the second entry in each case, and then the
> application loads okay. One day I'll get around to looking at the MMM
> source code and seeing how it works.

I don't know which version of MMM you are using but I've just tried a number
of different versions of MMM on my own machine, including the latest version
9, and I cannot reproduce your problem, regardless of how many of the
various Windows Common Controls ocx files I select in Project / Components.
No matter what I try I always get a MMM manifest which shows only the one
correct reference to the various controls. For example, in the specific case
of the TabStrip control in Microsoft Windows Common Controls 6.0 (SP4) I get
one entry in the MMM manifest, as follows:

<comClass clsid="{1EFB6596-857C-11D1-B16A-00C0F0283628}"
tlbid="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"
threadingModel="Apartment" progid="MSComctlLib.TabStrip.2"
description="Microsoft TabStrip Control" />

As you can see, the clsid and the tlbid are both exactly the same as the
clsid and the tlbid in the first of the two TabStrip.2 entries that you have
in your own manifest produced on your own machine and I can (of course) find
both of those IDs when I use RegEdit to search for them in the Registry on
my machine. The second TabStrip2 entry which appears in your own manifest
does not appear at all in the manifest produced on my machine, and when I
perform a RegEdit search for the second clsid
24B224E0-9545-4A2F-ABD5-86AA8A849385 it does not appear at all in my
Registry.

I wonder if you have somehow ended up with two copies of the ocx installed
and registered on your machine, perhaps one for one user and another for
another user or something like that, and if MMM is picking them both up? If
I search my Registry for the clsid 1EFB6596-857C-11D1-B16A-00C0F0283628 (the
one which we get in the MMM manifest on both our machines) it turns up about
three times in HKEY_CLASSES_ROOT and about the same number of times in
various keys in HKEY_CURRENT_USER and in HKEY_LOCAL_MACHINE and in
HKEY_USERS (I am the only User on this machine). However, when I search the
Registry for the clsid 24B224E0-9545-4A2F-ABD5-86AA8A849385 (the clsid which
turns up in your own MMM manifest but does not turn up in mine) then, as
expected, it is not found in the registry at all. What happens when you
search your own registry for those two entries. Presumably both of them will
show up in the various places I have mentioned. Perhaps you can draw some
clues from where they show up?

Also, if you do a normal full search for the file mscomctl.ocx, how many
copies of that file do you find on your machine, and do they all have the
same version numbers? Perhaps somehow two slightly different versions have
both managed to get themselves registered, perhaps to different users or
something? Then try the same thing for comctl32.ocx.

Mike




Mike Williams

10/28/2011 4:58:00 AM

0

"MM" wrote in message news:ehkia71cuf583dgtgg9o8pss2ob9ga4o9e@4ax.com...

> Thanks, that's useful to know. I have in the past done basic
> testing on Vista and W7 to verify that the app works and
> haven't noticed anything strange so far. But I'll look into
> this DPI Aware stuff and see if it could be a problem.

You won't notice anything strange on most Vista and Win7 machines, just on
the small but growing number of Vista and Win7 machines that are running at
high dpi settings, particularly those that are running at 150% (144 dpi). On
such machines when they are actually running the Aero glossy desktop, which
will of course be almost all the time, certain things in a standard VB6 app,
particularly text, will look a bit 'fuzzy' (unless the user has specifically
told either his machine or your own app to use WinXP dpi scaling, which is
rare for a user to do). This includes text that you Print to the Form and
text in ListBoxes and TextBoxes and Command Buttons etc and also in fully
system controlled text such as the text in Menus.

On such machines you'll also find that the system will 'lie' to your program
about how many dpi there are on that machine, always telling your program
that there are 96 dpi even when there might actually be 144 dpi. For
example, on such a machine running a 1600 x 900 pixels display, code such as
ScaleX(Screen.Width, vbTwips, vbPixels) and the equivalent ScaleY code will
tell you that the screen is 1067 x 600 pixels, even though it is actually
1600 x 900 pixels. The 'lie' is done very convincingly and even the API
functions, such as SystemParametersInfo(SPI_GETWORKAREA . . . etc ) will lie
to your program about it.

The fuzzy text is caused because on such machines the system draws your
entire Form to an offscreen buffer at a smaller pixel size than it would
otherwise be and it then stretches the buffer onto the actual display at a
144 / 96 size ratio (or whatever ratio is applicable to that machine
depending on its actual dpi setting).

You can fix these problems and stop them happenning on such machines by
declaring your compiled VB6 app as DPI Aware. For various reasons, calling
the SetProcessDPIAware function is not reliable and so it really needs to be
done in a manifest. The problem I mentioned in my earlier post is that if
you use MMM to create your manifest and if you ask MMM to include the DPI
Aware section in the manifest then you will find that the DPI Aware Section
produced by MMM does not work, although that can be fixed by editing the MMM
source code so that it creates a DPI Aware section which does work.

Mike