web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

[Solved]How to get a file path

(0) ShareShare
ReportReport
Posted on by 1,099

Hi,

Is there any way to get file path using file name in dexterity?

In my case I have to find the path of a dll file registerd in my local machine at run time and have to use this path. Please guide.

Thanks,

Sri

 

*This post is locked for comments

I have the same question (0)
  • MG-16101311-0 Profile Picture
    26,225 on at

    You can use Dexterity's extern function to call the GetModuleFileName function available in the Kernel32.dll.

  • Sridhar Narayanan Profile Picture
    1,099 on at

    Thanks for the reply.

    I tried using extern statement but I am getting compile error. I even tried compling sample script given in GP help file but still getting compile error. I think Iam missing something in using extern statement.

    Let me explain in detail what I am looking for.

    We use COM dll (which intern call our service) as a part of our connector. Our connector is tightly integrated with GP tax engine. Initially we register the dll in C:\Program Files\Our Product Name\Bin folder and generate xml log file in the same path.

    But now, during our product installation we haven given an option to user to select the path. Now I donot know how can I get the dll path during runtime.

    For Eg:- if the user select D:\Work during our product installation the dll gets registerd in that path. I have to find this path to generate xml logfile.

    Kindly guide me.

    Thanks,
    Sri

  • MG-16101311-0 Profile Picture
    26,225 on at

    The easiest way to accomplish what you are looking for is to create a key in the Dex.ini that stores the path selected by the user, something like this:

    XMLLogPath= D:\Work

    Then you can use the Defaults_Read() function to get the value stored for that key, for example:

    local string xmllogpath;

    xmllogpath = Defaults_Read("XMLLogPath");

     

    Hope this helps.

  • Sridhar Narayanan Profile Picture
    1,099 on at

    Thank You.

    To make it simple I am using Great Plains application path itself and creating our log file.

  • Sridhar Narayanan Profile Picture
    1,099 on at

    Hi Mariano Gomez,

    Your solution (editing Dex.ini during installation)is very good and it worked.  

    Thanks

    Sri

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans