Results 1 to 13 of 13

Thread: Question for fafalone

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,422

    Question for fafalone

    https://www.vbforums.com/showthread....acement-dialog

    Your Msg#2 - i get User-defined type not defined on FileOpenDialog.
    I think that means it needs a reference, bur what is its name ? Wasn't able to find it with Google.
    Thanks.

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    4,927

    Re: Question for fafalone

    You need a reference to oleexp.tlb. For recent versions the name shows up as 'OLEEXP - Modern Shell Interfaces for VB6' plus the version.

    This is only for the IDE, you don't need to include this file with your exe or have it present on systems your exe runs on.

    FileOpenDialog is the Windows-provided implementation of IFileOpenDialog.

    PS- In the post you linked, it's not noted, but you need the following version of SysReAllocString... oleexp.tlb has a different version that won't work with the code posted...

    Public Declare Function SysReAllocString Lib "oleaut32" (ByVal pBSTR As Long, Optional ByVal pszStrPtr As Long) As Long

  3. #3
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,245

    Re: Question for fafalone

    Quote Originally Posted by AlexanderBB View Post
    https://www.vbforums.com/showthread....acement-dialog

    Your Msg#2 - i get User-defined type not defined on FileOpenDialog.
    I think that means it needs a reference, bur what is its name ? Wasn't able to find it with Google.
    Thanks.
    FYI, if you want to reply to someone within a thread you started, instead of creating a new thread that simply says "Question for SoSo", you can reference the person by first selecting "Reply With Quote" and then use the "@" before their alias, like @AlexanderBB or @fafalone.

    :-)

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,422

    Re: Question for fafalone

    I found the reference to OLEEXP but still having trouble. I had to move from Sub Main to form load for .Show Me.hwnd.
    That gave an error on Public Declare Function... so I put that back to the declarations in the (now empty) module.
    But after that I get Run-time error '429':ActiveX component can't create object on the line With pChosenDir
    I'm in the dark with this advanced stuff, so any tips appreciated.
    OK @webbiz, will do.

  5. #5
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    4,927

    Re: Question for fafalone

    If you can post or PM me the code I'd be happy to take a look at it for you, but I can't tell from that brief description unless you just mean you took .Show out of the With block, which is just a general syntax issue not specific to this; when you start with a . it's an implicit reference to whatever is in the With statement, so in the linked snippted .Show has to be inside With pChooseDir.

    One other thing to verify, you're on Windows Vista or newer, right? IFileDialog is not available on Windows XP or older.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,422

    Re: Question for fafalone

    Ahhh apologies, it is XP where my Vb6 is.

  7. #7
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    4,927

    Re: Question for fafalone

    Yes in that case you'll have to stick to one of the older methods. The GetOpenFileName/GetSaveFileName APIs are the most modern option you have there; you can find numerous VB6 examples for these, though I'd recommend just using an existing class or module wrapping it like this one by LaVolpe.

    Realllly need to think about at least moving to Win7 instead of XP though

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,422

    Re: Question for fafalone

    Thank you, nice to have a recommendation and will check that out.
    I do have Win 10 on another computer, but really like XP still... seems more instinctive.

  9. #9
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,634

    Re: Question for fafalone

    stay in XP if you have people with XP that u share your applications.
    otherwise upgrade to windows 7.
    I did wait as long possible before I did the move myself, but eventually I did.
    and 7 is an improvement. I did like XP but 7 is really good.

    I share my game to 10k+ people and nobody complained that they can't run it. (sure bugs and all that, but not about below windows 7 issues)
    I think most people uses 10/11, but I also have a bunch in 7. not sure theres anybody left in XP.

    also I did move from GDI/GDI+ to Direct2D and the requirement is 7 (sure u can use Vista with Platform Update but I dont know anybody that uses Vista)
    so to be able to use Direct2D and (a lot of other typelibs) 7 is kind of the minimum. not sure how many years I have left with 7. but I will move when Im forced to do that.
    Last edited by baka; Sep 25th, 2023 at 04:34 AM.

  10. #10
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    4,927

    Re: Question for fafalone

    I'd still be on 7 but Microsoft colludes with hardware manufacturers so my new motherboard won't let me install it. Lots of other people said they could on this chipset, and I even bought the previous generation, z490 instead of 590, just for that reason, but after a week I gave up and settled for 10 Enterprise LTSC, which is still a downgrade in most ways but tolerable.

    7 is really the best OS ever made.

  11. #11
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,634

    Re: Question for fafalone

    yeah. unfortunately its what they decided to do.
    the next computer I buy will need 10/11 to function.
    what I dont like is all those hardware-protection stuff that are not beneficial to me, but to the manufacturers.
    I never asked for it. the same with w10/11, they force all those "protections" that I don't want. hopefully this trend to control us will go away in the future.

  12. #12
    Hyperactive Member
    Join Date
    Mar 2019
    Posts
    395

    Re: Question for fafalone

    Interesting conversation re versions. We develop on steam engines that run XP because our monitoring agent software has to coexist on clients platforms that are running real work. Slow hardware makes us super careful about efficiency and it is much easier to test performance and measure gains on slower clock speeds.

    One day we will have to move it to something other than VB6 but VB6 made deployment so much simpler and smaller in the days when .net was not installed everywhere.

  13. #13
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,300

    Re: Question for fafalone

    Quote Originally Posted by fafalone View Post
    If you can post or PM me the code I'd be happy to take a look at it for you, but I can't tell from that brief description unless you just mean you took .Show out of the With block, which is just a general syntax issue not specific to this; when you start with a . it's an implicit reference to whatever is in the With statement, so in the linked snippted .Show has to be inside With pChooseDir.

    One other thing to verify, you're on Windows Vista or newer, right? IFileDialog is not available on Windows XP or older.
    Can add a function to detect the system version, the system is too old to prompt

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