- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I have a dll that contains the following code:
use dfwin
Character(256) path,path1
integer(4) pathln
pathln = GetModuleFileName (NULL, path1, pathln)
I am using Intel Fortran 9.0
On one computer, the call is fine. We find the path & pathlength. On 2 other development machines we get nothing. I am told that originally the path was indeed returned.
Does anyone have any ideas of what I should/could look for that would cause the API to return nothing. Note: it does not give any sort of errors and such, it simply returns and empty string & a 0 for the length.
Having asked the all important question "What changedd?" did not help. Also of note, I replaced the non functioning code with the funtioning (project files and all, literally everything that is contained in the parent folder) and still the API doesn't return an answer.
HELP!
use dfwin
Character(256) path,path1
integer(4) pathln
pathln = GetModuleFileName (NULL, path1, pathln)
I am using Intel Fortran 9.0
On one computer, the call is fine. We find the path & pathlength. On 2 other development machines we get nothing. I am told that originally the path was indeed returned.
Does anyone have any ideas of what I should/could look for that would cause the API to return nothing. Note: it does not give any sort of errors and such, it simply returns and empty string & a 0 for the length.
Having asked the all important question "What changedd?" did not help. Also of note, I replaced the non functioning code with the funtioning (project files and all, literally everything that is contained in the parent folder) and still the API doesn't return an answer.
HELP!
링크가 복사됨
7 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
What is the value of pathln passed into GetModuleFileName?
Les
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
ahh, theres the rub JugoslavDujic, I actually am more interested in the path itself (hence the API call). I am indeed using the value of the length but it is the path that I am in search of.
Thanks
Thanks
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Jugoslav is correct - the third argument is an input that is the size of the path buffer argument. It is not an output parameter. Since you're passing an uninitialized variable, the API routine may or may not decide that the buffer overflows.
If you want the length of the returned path you look at the function result.
If you want the length of the returned path you look at the function result.
Message Edited by Steve_Lionel on 04-18-2006 12:58 PM