Hi, after using PB for a while iv gotten fairly used to it and with help held within the forums and support sites iv always managed to achieve the task in hand without making any posts ... until now
I am writing a dll plug-in for another application and iv hit a situation where I need to retrieve the full path to the dll file as its called from the host application, all information i can find points to various ways of retrieving the path to the exe that called the dll but nothing to retrieve the actual path of the dll file.
I really hope someone can point me in the right direction
Path to dll file (not exe)
never mind, i figured it out in the end.
Code: Select all
Procedure.s GetPluginPath()
Protected Result.s
Protected *Buffer=AllocateMemory(255)
If *Buffer
GetModuleFileName_(GetModuleHandle_("APT.lmd"), *Buffer, 255)
Result=GetPathPart(PeekS(*Buffer))
FreeMemory(*Buffer)
EndIf
ProcedureReturn Result
EndProcedure
MessageRequester("",GetPluginPath())If you want to know your path from within your DLL, you can use ProgramFilename(). I tried this in the past and it worked.
PB 4.30
Code: Select all
onErrorGoto(?Fred)Yeah, you are right.
But I didn't understand your first post, so I didn't know if you are the DLL or the host process that wants to know the DLL-path. But it seems that you are the DLL.
But I didn't understand your first post, so I didn't know if you are the DLL or the host process that wants to know the DLL-path. But it seems that you are the DLL.
PB 4.30
Code: Select all
onErrorGoto(?Fred)
