Results 1 to 11 of 11

Thread: [RESOLVED] Again about Olaf's SQLiteServerMode RC6

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    649

    Resolved [RESOLVED] Again about Olaf's SQLiteServerMode RC6

    Hello Olaf
    I was using RC5 RPC connection via CRpcConnection
    Regarding Olaf's advice.
    What you forgot in the above Project-list, is the 3rd-Project:
    - the Server-Dll-Project
    BackGround:
    - a loaded COM-Dll does not know about any "already regfree loaded instances in other binaries"
    - it runs (in this regard) kind of "isolated from the Executable"
    So, the same rules (regarding regfree-enabling) as for your Exes apply:
    - switch the COM-Dll-Project-Settings, to "use a Sub Main()"
    - introduce a *.bas Module which hosts Sub Main() in your Dll-Project
    - now place the same regfree initializer-code there as in your Exe-Projects Sub Main()
    So in order to take into account the regfree support, I added a module to the SQLiteServer.vbp with Sub Main that looks like this.
    Code:
    Set New_c = GetInstanceFromBinFolder("vbRichClient5", "cConstructor")
    Everything was OK both in IDE and exe modes.
    Now I'm using RC6.
    My problem is that in IDE mode, I'm getting error: couldn't pre-load DirectCOM.dll
    but after compilation everything is OK.
    I wonder why? since they they are referring to the same SQLiteServer.dll and the same DirectCOM.dll.
    What I "m doing now. I dropped the sub Main from the SQLiteServer.vbp and Kept just the cDBAccess.cls.
    Everything works fine both in IDE and exe modes.
    My question to Olaf and experts of RC6.
    Are there any serious pitfalls for doing so
    thank you
    Last edited by newbie2; Jan 26th, 2021 at 09:27 AM.

  2. #2
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,703

    Re: Again about Olaf's SQLiteServerMode RC6

    On thing you will need to do is change the "vbRichClient5" string in your GetInstanceFromBinFolder call to "RC6":

    Code:
    Set New_c = GetInstanceFromBinFolder("RC6", "cConstructor")
    Also, make sure that RC6.dll, DirectCOM.dll, and cairo_sqlite.dll are all located in your Bin folder.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    649

    Re: Again about Olaf's SQLiteServerMode RC6

    thank you sir
    On thing you will need to do is change the "vbRichClient5" string in your GetInstanceFromBinFolder call to "RC6":
    In fact this is the 1st thing I did.
    I also change reference to RC6

    Also, make sure that RC6.dll, DirectCOM.dll, and cairo_sqlite.dll are all located in your Bin folder.
    yes, they are there.
    Everything is working without problem.
    My concern is this:
    I dropped the sub Main from the SQLiteServer.vbp and Kept just the cDBAccess.cls.
    This means the SQLiteServer is not making use of the regfree.
    thank you

  4. #4
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,703

    Re: Again about Olaf's SQLiteServerMode RC6

    That's fine as long as you register the RC6.dll on any target computers, otherwise it won't work when you distribute your application. Regfree makes distribution to other users' computers easier, but it's not a requirement.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    649

    Re: Again about Olaf's SQLiteServerMode RC6

    Thank you sir
    That's fine as long as you register the RC6.dll on any target computers
    I think what you mean by target machine is the maching on which I'm developing my application?

    So you confirm that no harm if both the SQLiteServer and the FileServer.vbp are not making use of the regfree.
    Currently only the Main project is using the regfree support via the Sub Main.
    Code:
    Set New_c = GetInstanceFromBinFolder("RC6", "cConstructor")

  6. #6
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,703

    Re: Again about Olaf's SQLiteServerMode RC6

    No, the target machine is any user machine where you will be deploying the application - if you aren't using regfree then you will have to register RC6.dll on those machines.

    You should always register RC6.dll on your development machine regardless of whether or not you are using the regfree approach.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    649

    Re: Again about Olaf's SQLiteServerMode RC6

    I'm sorry sir if I'm not clear enough
    Thanks to you and Olaf I'm quite aware of all the requirements of the regfree approach.
    My worry is about the SQLiteServer and FileServer (with which you have helped me some days ago)
    Do they have to make use of the regfree? or just it is a requirement for the main project?

    Regarding Olaf's note here, it is a requirement.
    What you forgot in the above Project-list, is the 3rd-Project:
    - the Server-Dll-Project
    BackGround:
    - a loaded COM-Dll does not know about any "already regfree loaded instances in other binaries"
    - it runs (in this regard) kind of "isolated from the Executable"
    So, the same rules (regarding regfree-enabling) as for your Exes apply:
    - switch the COM-Dll-Project-Settings, to "use a Sub Main()"
    - introduce a *.bas Module which hosts Sub Main() in your Dll-Project
    - now place the same regfree initializer-code there as in your Exe-Projects Sub Main()
    However this was when I was using RC5.
    Now I'm using RC6. And if I apply this approach, I get error of loading DirectCOM.dll.
    In exe mode, there is no error.
    I can only avoid the error in IDE if I ignore regfree initializer-code in the sub Main of both SQLiteServer and FileServer.
    My question: Is there any harm for doing that?
    thank you sir

  8. #8
    PowerPoster
    Join Date
    Jun 2013
    Posts
    5,248

    Re: Again about Olaf's SQLiteServerMode RC6

    Quote Originally Posted by newbie2 View Post
    My worry is about the SQLiteServer and FileServer ...
    Do they have to make use of the regfree?
    Regfree-mode is generally optional (only needs to be applied when you want it in your deployed binaries).

    You have to decide yourself, whether you want to make a certain (compiled) Project work in a regfree manner.

    Usually this is, when you want to ship "the compiled result of a certain project" to other machines.
    ("not on your premises", or "not your current dev-machine").

    So, if both your SQLiteServer- and FileServer-Apps run permanently on an "InHouse-machine" you have easy access to,
    then regfree mode for these two Server-Apps (on your InHouse-Server-machine) is not required...
    (because you can ensure a registered version of the RC5/RC6 there yourself "by hand").

    If that is the case (that your potential Clients don't want to install their own Server-Apps on their own machines),
    then you will only have to make your Client-App work regfree.

    And as for "regfree doesn't work in the IDE" - you can easily make an If-switch for IDE- and ExeMode...

    If App.LogMode Then 'here we have "compiled mode" (Exe or Dll)

    '... A New_c-instance should be loaded regfree

    Else 'the Projet runs in IDE-Mode

    '... no need to make any regfree loading-attempts for "New_c"

    End If

    HTH

    Olaf

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    649

    Re: Again about Olaf's SQLiteServerMode RC6

    thank you sir very much.
    English is not my mother tongue language.
    So prerhaps google translate may misleads me.
    I just want to confirm this statement:
    Can I compile the SQLiteServer and FileServer dlls without initializing regfree?
    Code:
    Set New_c = GetInstanceFromBinFolder("RC6", "cConstructor")
    I apolologize for my insistance.

  10. #10
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,703

    Re: Again about Olaf's SQLiteServerMode RC6

    The short answer is YES it is OK to compile without using regfree.

    BUT we're trying to make sure you are aware of possible problems when you don't use the regfree approach. IF you are giving your program to other people using computers outside of your control THEN RC6.dll will need to be registered on their computers (using regsvr32 or a deployment app that can register DLLs). If RC6.dll is not registered on you users' computers, then your users will get errors and your software will not function properly.

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    649

    Re: Again about Olaf's SQLiteServerMode RC6

    Thank you jpbro
    thank you Olaf
    very clear

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width