Results 1 to 19 of 19

Thread: Telling program were reqired DLL or OCX is located

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    65

    Telling program were reqired DLL or OCX is located

    How can i change the programs defult location of any reqired ocx , like if my program needs winsock it willlook in the system32 folder, how do i make it use the one in its directory {APP.PATH} ?

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Telling program were reqired DLL or OCX is located

    There is a Browse button in Components.

  3. #3
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Telling program were reqired DLL or OCX is located

    It doesn't work like this.
    You need to register an Active-X server before using it.
    When registering it the path the server is located in will be saved to the registry.

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Telling program were reqired DLL or OCX is located

    VB IDE automatically registers the OCXs your Project uses, it's not needed when programming, it's needed when packaging, your App installer has to do it.

  5. #5
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Telling program were reqired DLL or OCX is located

    Quote Originally Posted by jcis
    VB IDE automatically registers the OCXs your Project uses, it's not needed when programming, it's needed when packaging, your App installer has to do it.
    Sometimes you just don't want to use an installer.
    For example when you have a 20 KB executable and a 140 KB control.

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Telling program were reqired DLL or OCX is located

    It doesnt matter if you want to use an installer or not - it's the only way to ensure that a VB application will work.

    The extra components that you aren't installing (such as the VB runtimes) are required for your program to work.. so if they aren't installed then the program wont work. If an old version is already installed (say SP2 when you are using SP6) then your program will seem to work, but you are likely to have 'random' bugs.


    If you don't want an installer for your programs, the only safe thing to do is to not use VB to make them.
    Last edited by si_the_geek; Jan 20th, 2007 at 01:50 PM.

  7. #7
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Telling program were reqired DLL or OCX is located

    Quote Originally Posted by si_the_geek
    It doesnt matter if you want to use an installer or not - it's the only way to ensure that a VB application will work.

    The extra components that you aren't installing (such as the VB runtimes) are required for your program to work.. so if they aren't installed then the program wont work. If an old version is already installed (say SP2 when you are using SP6) then your program will seem to work, but you are likely to have 'random' bugs.


    If you don't want an installer for your programs, the only safe thing to do is to not use VB to make them.
    Add a Sub Main() to your app and register your components from there.
    ActiveX Servers are not hard-linked to your executable, they will be loaded
    when they're needed.

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Telling program were reqired DLL or OCX is located

    It is not just the components/references that matter - there are extra files (like the VB runtimes) that you need too.

    It doesn't matter how much code you write to register files etc (or how well you have written it), if you don't use an installer then there is no guarantee that your program will run at all.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    65

    Re: Telling program were reqired DLL or OCX is located

    yeah i guess my answer here is an installer , but i heard this kind of installer takes money and stuff , and my project is only 45kb at the momment , will be around 100kb , and do i realy need to add a 15mb installer just to install a 100kb file?

    i am currently using a register program , that registers all of the componenta used right befour lounching the actual file , so what would i have to do exactly.

  10. #10
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Telling program were reqired DLL or OCX is located

    An installation package may not be as big 15MB (it could be more), but if you want to be sure that your program will work, you do need to make one.

    There are many free installer programs.. one of them is Package & Deployment Wizard (P&DW) which is inlcuded with VB, and many others can be found in our Application Deployment FAQ.

  11. #11
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Telling program were reqired DLL or OCX is located

    otherwise you could use classes and User controls ..
    thats the only way around it .. if they are common controls then best to install it .. also Vbruntimes come on XP so no worries there, but let them know or provide a link to download them. .. i have quite a few non installed exe's out there for specific tasks, specifically for XP, and have been used by many people .. never had one single issue. BUT, none of them use external controls, and they are really just small programs such as fixes etc, that run off a jump drive or similar.

    that said I did test a program where i put winsock ocx into the exe itself, and when run it extracted it to its own folder and registered, and thats where it was referenced for the app ... other programs i used that already used winsock still worked .. but in the development mode with other programs, and switching back and forth, there were some issues .. so i wouldnt use that method. Put them in the system32 or specific folder where they belong.

    And if you're worried about cost of an installer, check out Inno ..
    its really inexpensive.
    Last edited by rory; Jan 20th, 2007 at 05:02 PM.

  12. #12
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Telling program were reqired DLL or OCX is located

    Quote Originally Posted by si_the_geek
    It is not just the components/references that matter - there are extra files (like the VB runtimes) that you need too.

    It doesn't matter how much code you write to register files etc (or how well you have written it), if you don't use an installer then there is no guarantee that your program will run at all.
    All I'm saying is just that if you're a free/shareware author and you have
    programmed a little program which has one or two dependencies,
    you don't have to build a whole installer for it (assumed you know what you do).
    You can expect that most Windows users who have access to the internet
    will also already have the VB runtime installed. If not, link it in the readme.

    I did not say an installer is not needed generally.

  13. #13
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Telling program were reqired DLL or OCX is located

    I don't know about you, but if I tried to use a shareware program and it failed to run (or seemed to run, but sometimes gave random errors) I would not be happy with it - I'd rather spend a few seconds installing it to start with.

    Having to search thru a readme file to find out where to download the required files wouldn't make me happy either - especially as it would mean re-connecting to the web (and having to download & run two files instead of one).

    Like many non-technical people I know, I would not consider buying shareware from a person/company that has tried to save themselves a few seconds by passing the work on to me.

    (rory's situation is different, as he is already in contact with his users).

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    65

    Re: Telling program were reqired DLL or OCX is located

    what i know about installers is that all they do is they register a component needed and making a copy in system32 folder, why cant that be done in simple VB code ?

    sounds simple to me.
    register to the registry

    copy file to system32

    i dont see why it could have bugs since it does the exact same thing with payed installer/unpackers .

    what i do is use IExpress.exe and just make it run a [checker.exe] befour running the actual project , anbd the checker will check if the components are installed , if not shell(register.exe) and register will register them and copy them to the directory , and then ends. when it ends iexpress will run the porgram , simple and effective so far.

    i tested it on one friends computer and it worked .

  15. #15
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: Telling program were reqired DLL or OCX is located

    With regards to your original query: Dynamic-Link Library Redirection. It doesn't specifically mention OCXs, but I've tried this and it seems to work ok.

    Quote Originally Posted by IQAB
    what i know about installers is that all they do is they register a component needed and making a copy in system32 folder, why cant that be done in simple VB code ?

    sounds simple to me.
    register to the registry

    copy file to system32

    i dont see why it could have bugs since it does the exact same thing with payed installer/unpackers .

    what i do is use IExpress.exe and just make it run a [checker.exe] befour running the actual project , anbd the checker will check if the components are installed , if not shell(register.exe) and register will register them and copy them to the directory , and then ends. when it ends iexpress will run the porgram , simple and effective so far.

    i tested it on one friends computer and it worked .
    If you look at the P&D wizards's code, you'll see it does a lot more than that, such as checking for disk space and version information. The last thing you want is to overwrite a system dll with an older version. (IExpress probably does the same). How many complaints do you want ? Yes, you could write your own installer - but why bother when you already have a FREE one ?

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    65

    Re: Telling program were reqired DLL or OCX is located

    i wont overwrite any file that already exists becouse my [checker] will check if any of the components used exist , if they exist it ends and moves on , if not it creates one.

    and the reason why i dont want a free version is becous ei dont want to make it too complicated , or too large in size. and my file is not going to go over 150kb so i dont worry about the disk space.

  17. #17
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Telling program were reqired DLL or OCX is located

    Quote Originally Posted by IQAB
    i dont see why it could have bugs since it does the exact same thing with payed installer/unpackers .
    No it doesn't, which is why you decided to do this..

    Apart from the version issues, there is a big problem... not with files you are registering, but the ones you are not bothering with. A proper package would install all of the required files (and any extra files they require), not just the ones that you think are important.

    If any required files you've ignored/missed aren't installed on the computer already, your program wont run.

    If older versions are installed then your program may not run. If it does run, that is when you are likely to get random bugs - as corrections/fixes are added in later versions (especially with the SP's of the VB runtimes).
    i tested it on one friends computer and it worked .
    Ah yes.. it worked in one situation, so that somehow means it will definitely work in all!

    and the reason why i dont want a free version is becous ei dont want to make it too complicated , or too large in size.
    "Free" or "Paid" is irrelevant - there are several excellent installation makers that are Free.

    The way I see it, the only real issue you have is the package size.. many of the programs will let you remove files, but doing so is a dubious idea - the files are in the package because your program needs them.

    The actual program that does this installation is typically small, so adds very little to the package size. Also of course the package is generally compressed - so it can be much smaller than the original files.

    Try building a package (with P&DW, or InnoSetup etc if you prefer) and see how big/complex it is.. you may be pleasantly surprised. If using P&DW you can alter the installation process if you want, as the source code is provided.

  18. #18
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Telling program were reqired DLL or OCX is located

    you can also create a setup package with P&D then look at the files it deals with. Thats actually how i make my Inno setups most of the time. You could create your own installer, but its easier to use some of the ready made ones, or just customize the P&D source.
    Last edited by rory; Jan 21st, 2007 at 05:51 PM.

  19. #19
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Telling program were reqired DLL or OCX is located

    Quote Originally Posted by Arne Elster
    I did not say an installer is not needed generally.
    The problem is that you didn't say that an installer is always needed for a VB program.

    It might not be needed to install the program on a particular computer (like one that has the same SP-level VB already installed), but the app itself should always be packaged. There's no way to write a VB app that doesn't use routines found in files that aren't your .exe file. Just loading forms, (almost every program has to load at least 1 before it can run) is external to your .exe.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

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