Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Select directory in Borland Turbo

LundinLundin Member Posts: 3,711
I'm sitting here trying to get a simple dialog box working, where the user can select a directory rather than a file.

I'm using the cheap Borland Turbo, which doesn't seem to be compatible with older versions of Builder... I fail to get the SelectDirectory() function working. I know I need to include one .lib or another for it, but I can't find it. Tried vclx.lib but it ain't working.

So anyway, I decided to skip the Borland functions and use the Win API instead. The right function to use seems to be SHBrowseForFolder(). However, I can't get this working either... I don't know what header to use. Simply using windows.h isn't enough. If I include I get linker errors... seems it is already included from somewhere else in Turbo's messy headers.

Does anyone know what to do to get this working? Good old Dev C++ doesn't seem to have any problems with it at all. I'm about to throw out Turbo and go plain API right now...

Comments

  • LundinLundin Member Posts: 3,711
    Got it working now when I'm using this [link=http://www.codeproject.com/KB/dialog/XBrowseForFolder.aspx]wrapper class[/link]. I have no idea why that file is allowed to include shlobj.h while my file isn't... seems some h-files need to be included in a certain order to work... Header guards ftw, library-writing people!
  • luckyboyluckyboy Member Posts: 105
    : Got it working now when I'm using this
    : [link=http://www.codeproject.com/KB/dialog/XBrowseForFolder.aspx]wrap
    : per class[/link]. I have no idea why that file is allowed to include
    : shlobj.h while my file isn't... seems some h-files need to be
    : included in a certain order to work... Header guards ftw,
    : library-writing people!

    Please make it more clear, i wanna learn that from you.
    and by the way, i remember that i read in CBuilder Help that some files should be included in certain order, but i thought it is for vcl.h only
    i.e vcl.h should be your last file to include
    i think it checks for some macros to see whether it is defined.

    again, explain what did you do exactly please.
  • LundinLundin Member Posts: 3,711
    Means some newbie programmer wrote one of those h-files...

    This is a header-guard:

    #ifndef BLABLA_H
    #define BLABLA_H
    ...
    #endif
Sign In or Register to comment.