Thread View: borland.public.cppbuilder.nativeapi
11 messages
11 total messages
Started by patrickartaud
Fri, 22 Jun 2007 17:02
SHBindToParent problem.
Author: patrickartaud
Date: Fri, 22 Jun 2007 17:02
Date: Fri, 22 Jun 2007 17:02
11 lines
1518 bytes
1518 bytes
Hello, I have take an example to find the APPDATA directory in vista and XP but in it there is this function.I have include the shlobj.h header, and add the .lib in ADDLIB in the .bpr file.(BCB6Pro) But the linker said "unresolved external"SHBindToParent"referenced from....... I don't know where to look I have tried with the microsoft SDK on the net but nothing it is to use SHGetSpecialFolderLocation function I thank you by advance very much Patrick
Re: SHBindToParent problem.
Author: Bob Gonder
Date: Fri, 22 Jun 2007 17:30
Date: Fri, 22 Jun 2007 17:30
13 lines
1427 bytes
1427 bytes
patrickartaud wrote: >But the linker said "unresolved external"SHBindToParent"referenced >I have include the shlobj.h header, and add the >.lib in ADDLIB in the .bpr file.(BCB6Pro) Which .lib did you add? >I don't know where to look I have tried with the microsoft SDK on the net The proper .lib is listed here http://msdn2.microsoft.com/en-us/library/ms647661.aspx
Re: SHBindToParent problem.
Author: patrickartaud
Date: Sat, 23 Jun 2007 07:32
Date: Sat, 23 Jun 2007 07:32
26 lines
2002 bytes
2002 bytes
Thank you very much I have add the good shell32.lib, I have the path in the directories and lib options,"�(BCB)\lib the file is here but now it says to me that it can't open this file!!!! I don't understand what I'm doing wrong I thank you again Patrick "Bob Gonder" <notbg@notmindspring.invalid> a �crit dans le message de news:fl1o73tka3i9em1qc6e8259qj5inidost9@4ax.com... > patrickartaud wrote: > >>But the linker said "unresolved external"SHBindToParent"referenced > >>I have include the shlobj.h header, and add the >>.lib in ADDLIB in the .bpr file.(BCB6Pro) > > Which .lib did you add? > >>I don't know where to look I have tried with the microsoft SDK on the net > > The proper .lib is listed here > http://msdn2.microsoft.com/en-us/library/ms647661.aspx > > >
Re: SHBindToParent problem.
Author: Bob Gonder
Date: Sat, 23 Jun 2007 13:27
Date: Sat, 23 Jun 2007 13:27
9 lines
1374 bytes
1374 bytes
patrickartaud wrote: >Thank you very much >I have add the good shell32.lib, I have the path in the directories and lib >options,"�(BCB)\lib the file is here but now it says to me that it can't >open this file!!!! What does it say? ALWAYS cut and paste the full actual error message.
Re: SHBindToParent problem.
Author: patrickartaud
Date: Mon, 25 Jun 2007 15:27
Date: Mon, 25 Jun 2007 15:27
16 lines
1672 bytes
1672 bytes
Thank you very much it says "[linker error]Unresolved external "StrRetToBufA" referenced from C:\ProgPerso\Aoptiessai\MENUINTER.OBJ" Like I said it was trying to use the example for ShGetSpecialFolderLocation given on microsoft site. If you have an example working for BCB6..... I thank you very much Patrick > What does it say? > ALWAYS cut and paste the full actual error message. > >
Re: SHBindToParent problem.
Author: Bob Gonder
Date: Mon, 25 Jun 2007 19:03
Date: Mon, 25 Jun 2007 19:03
6 lines
1374 bytes
1374 bytes
patrickartaud wrote: >"[linker error]Unresolved external "StrRetToBufA" referenced from The library for that funcction is listed here http://msdn2.microsoft.com/en-us/library/ms538677.aspx
Re: SHBindToParent problem.
Author: patrickartaud
Date: Tue, 26 Jun 2007 14:31
Date: Tue, 26 Jun 2007 14:31
25 lines
2645 bytes
2645 bytes
> The library for that funcction is listed here > http://msdn2.microsoft.com/en-us/library/ms538677.aspx > > Thank you for your answer, I have "shlwapi.h" in my .cpp file and I have this error I don't understand, because I really read in microsoft developper network!! (i think I must be a little bit stupid),because I have my application must creates, writes and read files in its own directory(or other,but for XP it is in its own),and for Vista I don't arrive to transpose from XP where it runs very well,I don't know how to find the good Folder for my folder files's application;I have tried many things,but with no result!!! The Folder is created and the files but after when my application wants to make calculs with them I have always "the file don't exists" or something like it,and the files exist because I can open them with other applications like Excell they are .dbf files. And also my English is not absolutly good!!! I read than we must have "shlwapi.lib"but must I add in ALLlib of .bpr files too?the lib and the dll is already in "Windows\" for vista?or must I put them ,and other .lib and .dll necessaries from windows in the application directory? I thank you in advance I work with BCB6Pro Thank you again for your help Patrick
Re: SHBindToParent problem.
Author: patrickartaud
Date: Tue, 26 Jun 2007 14:38
Date: Tue, 26 Jun 2007 14:38
12 lines
1538 bytes
1538 bytes
Suite to my previous mail, I have had "shlwapi.lib" in the .bpr and I obtain "unable to open "SHLWAPI.LIB" Excuse me but I have ackehead! Vista is hard with animals!!!! Thank again Patrick > The library for that funcction is listed here > http://msdn2.microsoft.com/en-us/library/ms538677.aspx > >
Re: SHBindToParent problem.
Author: Bob Gonder
Date: Tue, 26 Jun 2007 15:28
Date: Tue, 26 Jun 2007 15:28
8 lines
1433 bytes
1433 bytes
patrickartaud wrote: >I have had "shlwapi.lib" in the .bpr and I obtain "unable to open >"SHLWAPI.LIB" It should be located in the (BCB)\lib\psdk folder make sure you have the \psdk folder listed in your library search paths ( or maybe change the library to psdk\SHLWAPI.LIB )
Re: SHBindToParent problem.
Author: patrickartaud
Date: Tue, 26 Jun 2007 17:49
Date: Tue, 26 Jun 2007 17:49
34 lines
2853 bytes
2853 bytes
> It should be located in the (BCB)\lib\psdk folder > make sure you have the \psdk folder listed in your library search paths > ( or maybe change the library to psdk\SHLWAPI.LIB ) > > Thank you very much it was the path in the directories options. It compiles and links very well but when I launch it stop. But now I have an error for StrRetToBuf(&str, pidlItem, szDisplayName, ARRAYSIZE(szDisplayName)); I obtain acces violation at the address 770FE18D.Write at the adress 00000008 The declaration of "buffer" is: char* szDisplayName;//[MAX_PATH];//= L""; // The display name's string for Favorites char* szPath;//[MAX_PATH] = L""; // The path for Favorites. yes I have looked and changed the WCHAR typedef of the example because I had an error "improper use of typedef "WCHAR" and I have looked in the help that was equivalent. I'm not very lucky with this example : http://msdn2.microsoft.com/en-us/library/aa930230.aspx I don't know what I'm doing wrong,I have copied and pasted the example and then done the changes of WCHAR and CSIDL_FAVORITE in CSIDL_APPDATA (I think it is here I could read mine files after create my folder application)Because in ShGetSpecialFolderLocation I have not see CSIGL_COMMON_APPDATA and I ask to me if this is good too for me........... Thank you again Patrick PS: if I bore you,say to me,I would understood . I'm not used with the WinApi
Re: SHBindToParent problem.
Author: Bob Gonder
Date: Wed, 27 Jun 2007 14:12
Date: Wed, 27 Jun 2007 14:12
33 lines
2527 bytes
2527 bytes
patrickartaud wrote:
>But now I have an error for
>StrRetToBuf(&str, pidlItem, szDisplayName, ARRAYSIZE(szDisplayName));
>I obtain acces violation at the address 770FE18D.Write at the adress
>00000008
>
>The declaration of "buffer" is:
>char* szDisplayName;//[MAX_PATH];//= L""; // The display name's string for
>Favorites
>char* szPath;//[MAX_PATH] = L""; // The path for Favorites.
That is NOT what the example shows.
The function is going to write to the memory that you point at, but your pointers are
garbage (apparently one of them currently holds an 8).
>yes I have looked and changed the WCHAR typedef of the example because I had
>an error "improper use of typedef "WCHAR" and I have looked in the help that
>was equivalent.
NOT evquivalent at all.
WCHAR is a wchar_t, not a char (see wtypes.h)
Fix the Syntax, not the Type,
and certainly don't throw away the place you are going to get the information into.
WCHAR szDisplayName[ MAX_PATH ] = {0};
WCHAR szPath[ MAX_PATH ] = {0};
>I'm not very lucky with this example :
>http://msdn2.microsoft.com/en-us/library/aa930230.aspx
Mostly because you are trying to change it too much.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads