Click here to Skip to main content
15,917,632 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fastest, easiest XML library, C++ Pin
Stephane Rodriguez.22-Jan-03 19:02
Stephane Rodriguez.22-Jan-03 19:02 
QuestionDoes anyone know of universal naming convention (UNC) path? Pin
Anthony_Yio22-Jan-03 16:46
Anthony_Yio22-Jan-03 16:46 
AnswerRe: Does anyone know of universal naming convention (UNC) path? Pin
Chris Richardson22-Jan-03 19:10
Chris Richardson22-Jan-03 19:10 
Generalhelp needed Pin
BORICUA22-Jan-03 16:30
BORICUA22-Jan-03 16:30 
GeneralRelative Path not available in startup Pin
fordge22-Jan-03 15:21
fordge22-Jan-03 15:21 
GeneralRe: Relative Path not available in startup Pin
Chris Richardson22-Jan-03 19:16
Chris Richardson22-Jan-03 19:16 
GeneralRe: Relative Path not available in startup Pin
fordge23-Jan-03 14:08
fordge23-Jan-03 14:08 
GeneralRe: Relative Path not available in startup Pin
Chris Richardson24-Jan-03 6:47
Chris Richardson24-Jan-03 6:47 
Well, no matter which route you go, you will almost undoubtably end up using GetModuleFileName (directly or indirectly). CWinApp is even using it to format the m_pszHelpFilePath (take a look in MFC sources).

Why isn't the relative path recognized at startup? Well, it is being recognized. It's just that it's being recognized as being relative to the "C:\" path, instead of the path your app resides in. Putting relative paths in your program and depending on Windows to set your directory for you is never a good idea, and the best way to not do it, is probably to use GetModuleFileName. It will be all of 6 lines of code, and you will remove the risk of not finding your database (unless the database gets deleted).

fordge wrote:
there must be something where the path is stored so that the exe can refer to it when a relative path is called

Refer to the documentation on CreateFile or the Open method of the database connection object for a list of paths that are searched when you use a relative path name.

Chris Richardson

Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
GeneralRe: Relative Path not available in startup Pin
jimNLX24-Jan-03 10:44
jimNLX24-Jan-03 10:44 
GeneralWhy does the following code call the same Dialog box twice? <Long> Pin
VanHlebar22-Jan-03 13:52
VanHlebar22-Jan-03 13:52 
GeneralRe: Why does the following code call the same Dialog box twice? <Long> Pin
Christian Graus22-Jan-03 14:02
protectorChristian Graus22-Jan-03 14:02 
GeneralRe: Why does the following code call the same Dialog box twice? <Long> Pin
Chris Losinger22-Jan-03 14:03
professionalChris Losinger22-Jan-03 14:03 
GeneralRe: Why does the following code call the same Dialog box twice? <Long> Pin
VanHlebar22-Jan-03 16:07
VanHlebar22-Jan-03 16:07 
GeneralRe: Why does the following code call the same Dialog box twice? <Long> Pin
Roger Allen23-Jan-03 2:25
Roger Allen23-Jan-03 2:25 
GeneralRe: Why does the following code call the same Dialog box twice? <Long> Pin
VanHlebar24-Jan-03 1:32
VanHlebar24-Jan-03 1:32 
GeneralRe: Why does the following code call the same Dialog box twice? <Long> Pin
Roger Allen24-Jan-03 1:57
Roger Allen24-Jan-03 1:57 
QuestionPossible with shell extensions? Pin
Anonymous22-Jan-03 13:49
Anonymous22-Jan-03 13:49 
AnswerRe: Possible with shell extensions? Pin
Lim Bio Liong22-Jan-03 17:27
Lim Bio Liong22-Jan-03 17:27 
GeneralRe: Possible with shell extensions? Pin
Anonymous23-Jan-03 4:34
Anonymous23-Jan-03 4:34 
GeneralMemory Management & Windows Messenger Pin
Mike.NET22-Jan-03 11:39
Mike.NET22-Jan-03 11:39 
GeneralRe: Memory Management & Windows Messenger Pin
John M. Drescher22-Jan-03 13:04
John M. Drescher22-Jan-03 13:04 
GeneralRe: Memory Management & Windows Messenger Pin
Mike.NET22-Jan-03 15:14
Mike.NET22-Jan-03 15:14 
GeneralResizable Property Sheets under XP Pin
Member 8408522-Jan-03 11:26
Member 8408522-Jan-03 11:26 
GeneralUser authentication Pin
lvguy197222-Jan-03 11:12
lvguy197222-Jan-03 11:12 
GeneralHelp me to Release Resources! Pin
Ehsan Baghaki22-Jan-03 11:08
Ehsan Baghaki22-Jan-03 11:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.