how to get the application directory (where .exe is located)

I'm trying to get the directory(path) of the application 
where .exe file exist.
I'm sure there is a function for this purpose but just 
couldn't find the name of the function
thanks in advance
0
hsung (1)
9/4/2003 7:26:34 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
645 Views

Similar Articles

[PageSpeed] 0

GetModuleFileNameEx().

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"Han" <hsung@Energygraphics.com> wrote in message
news:21ba01c3731a$738780f0$a601280a@phx.gbl...
> I'm trying to get the directory(path) of the application
> where .exe file exist.
> I'm sure there is a function for this purpose but just
> couldn't find the name of the function
> thanks in advance


0
ajaykalra (6842)
9/4/2003 7:29:49 PM
Reply:

Similar Artilces:

How to get XML data out of an XML file
I am trying to retrieve the Parameters first or second (0, 1 ,2) node from the following XML file: <?xml version="1.0" encoding="utf-8" ?> <Robot xmlns="http://tempuri.org/RobotDefaults.xsd"> <Parameters> <Name>Decker</Name> </Parameters> <Parameters> <Name>A</Name> </Parameters> <Parameters> <Name>B</Name> </Parameters> </Robot> There will be more data than just a name for each Parameters node. Here is my code: Dim node As XmlNode = xmlDocument.SelectSingleNode("/P...

Baseball Stats question: How can I get the RBI's?
I have a data table that looks like this: Code ------------------- STR-S SNK-S STR-K STR-F SNK-S STR-3 STR-2 STR-F SNK-S SNK-4 SNK-S STR-3 SNK-F STR-4 STR-O ------------------- "STR", etc at the beginning are pitch types, SNK is Sinker for example The end character is the result of the pitch, a 4 would be a home run, 3 a triple, and so forth. O is out, F is foul, S is strike --- you ge it. How can I figure the amount of RBI's? I know that it's 5, but I can' think of any automated way to calculate this, anyone got any ideas? THANK YOU!! :confused -- AVER...

Get at messages in queue
Is it possible to get at the undeliverable messages that are held in a queue (eg to check the message body or redirect undeliverable messages). I would like to be able to selectively forward them to an alternate email address or to archive them to a PST etc rather than just deleting them? Thanks Alan ...

Money 2006 file repair application error
I cannot delete an old account because I get a "file may be courrupt" error so I am trying to repair my 2006 file. Following the deirections, when the progress bar almost completes, I get an application exception and send an error report to MS. My event log has 2 app errors 1) Event Type: Error Event Source: Application Error Event Category: None Event ID: 1001 Date: 4/12/2006 Time: 10:47:26 PM User: N/A Computer: xxx Description: Fault bucket 02266399. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Data: 0000: 42 75 63 6b 65 ...

How to get paper size from dmPaperSize returned from GetDevMode?
For example, dmPaperSize returns 1 which is DMPAPER_LETTER, how do I calculate the paper size like in this case 8.5"x11"? There are so many paper sizes, is there any function call to calculate based on the return value of dmPaperSize or mapping between the value of dmPapersize and actual size? Thank you. The reason I asked the question was because dmPaperLength and dmPaperWidth are 0 for some printers. Also, my HP laserjet returns as a color printer (dmColor = 2) from GetDevMode call. Anyone knows why? ...

does vista installed on virtual machine 2007 get wsus updates ?
It is searching for updates but it is not finding anything and saying that Windows is up to date. I have set the updates to install from the wsus server and assigned the updates to the same Vista virtual machine .. Thank you -- aconti ------------------------------------------------------------------------ aconti's Profile: http://forums.techarena.in/members/73272.htm View this thread: http://forums.techarena.in/active-directory/1290161.htm http://forums.techarena.in Hello aconti, If the machine is getting the correct GPO for the WSUS settings, check with rsop...

Application hanging on file load...
Okay, I'm having the strangest problem, and I'm hoping somebody here will be able to give me an idea of how to attack it... I have an MFC application that does some networked communication, multi-threading, fun stuff... I also load and save xml configuration files. Now, on most of the computers I've run my software on, I have absolutely no problems. On SOME boxes, however, whenever I use my menu to try to load or save a file... before the File Dialog box even comes up... the application hangs. All the boxes I've tried this on have been Windows 2000 boxes with Service Pack 4....

How do I get text to copy from one cell to another ?
Type = in the target cell. MouseClick the cell containing text. Pres Enter key -- Brian ----------------------------------------------------------------------- BrianB's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=5 View this thread: http://www.excelforum.com/showthread.php?threadid=27034 ...

How do I view all Global Catalog Servers in Active Directory
Guys, Is there a way to view and confirm all the Global Catalog Servers in Active Directory? I'll appreciate your help.Regards. -- Buchi On Sat, 6 Aug 2005 08:21:01 -0700, "Buchi" <Buchi@discussions.microsoft.com> wrote: >Guys, >Is there a way to view and confirm all the Global Catalog Servers in Active >Directory? I'll appreciate your help.Regards. You could in the DNS (dnsmgmt.msc) under the _msdcs folder for your AD domain. or nslookup (ls -t SRV ADdomain.com) or look via Sites and Services or use repadmin: (repadmin /showreps YourDC). The result wi...

Getting Cell Value from the Concatenate formula
I built a concatenate formula that returns the following result: =Jul! $D27 I am looking for the cell contents of Sheet: July Column D Row 27. I tried to use offset, but I am stumped. Can I add something to the front of the concatenate to not only build the reference to the cell, but also return the value instead of the =Jul!$D27 ? Thanks John =indirect(yourformulahere) Don't include the equal sign in your formula. And match the name correctly (Jul or July???). Depending on the name of the worksheet, you may need to have a string that looks like: 'Sheet 99'!d27 =indirec...

Can't get rules to run.
I can't get Outlook 2003 rules to run. I am getting my mail from a pop3 account and would like to have new mail sorted to specific folders when it arrives. I set up the rules as I did in previous versions of outlook, but they do not run automatically. I can run the rules manually and they will move the mail. I have this rule (for example Apply this rule after the message arrive from some@email.address and on this machine only move it to the somefolder folde I have tried deselecting on this machine only Thanks. Do you have an Exchange service in this profile? Are you using Cache...

Getting same number to appear over and again
Hi. I'm trying to change the E's I have entered in a column to 1's. However, in lieu of changing them one by one, I would like to do them all in one fell swoop. Any suggestions? John Hi John You could use find and replace. Select all of your data. Goto Edit>Find Find what:- E Replace with:- 1 HTH Martin John Do NOT multipost. See your answer in Excel group. And do a google search for newsgroup etiquette!! John Do NOT multipost. See your answer in Excel group. And do a google search for newsgroup etiquette!! John Do NOT multipost. See your answer in Excel ...

Why do my questions get deleted sometimes?
Apologies, I have posted this on the worksheet functions group too... I love the feedback I get from these groups, but every now and then, my messages get deleted. I'd like to know what I'm doing wrong. Many of my messages ARE posted and answered, and I'm grateful for that, but one or two get removed - regardless of how often I post them. I don't swear or say anything bad about Excel - I love it. So why don't they get posted are there some words or subjects that I should avoid? Will this one get deleted - it's a bit off subject? But I'd love to have an ans...

Getting right date value
I setup my DTPicker control to be used only as a date control, yet I'm noticing that sometimes it will give back a date AND a time all in the same "value" variable. Since it appears that a variable of type "Date" can give back both a date and time, how can I eliminate the time half of a date value??? I might not be able to exactly control the DTPicker control to give me JUST a date, so I'm just curious what to do if it gives me back both a date & time. thank u Hi, Try this : Dim x as date x = cdate(clng(DTPicker1.value)) &qu...

modify contact address when account address gets modified
Hi, How do I ripple my changes from company level to the related contacts ? For example the main company phone number and the main address ? Do I need a product like Scribe for this, or can this be done with the workflow ? Thanks for any advice Wim You can't do this with workflow, and I don't believe Scribe can do this (though I may be wrong - I've only used Scribe for one project). I would think that you'd need to create a post callout using the SDK. There is more info at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/CrmSdk1_2/htm/v1d2microsoftcrmversi...

Become MCSE Certified and get $43,000+ Salary per year
QmVjb21lIE1DU0UgQ2VydGlmaWVkIGFuZCBnZXQgJDQzLDAwMCsgU2FsYXJ5IHBlciB5ZWFyCkhp LApTdGFydCB5b3VyIGJyaWdodCBjYXJlZXIgd2l0aCBNQ1NFIENlcnRpZmljYXRpb24gYW5kIGdl dCAkNDMsMTIyLjUwCihhY2NvcmRpbmcgdG8gYWJvdXQuY29tIHNhbGFyeSBzdXJ2ZXkpLiBWaXNp dCBodHRwOi8vd3d3LkZyZWVFeGFtS2luZy5jb20KZm9yIE1DU0UgQ2VydGlmaWNhdGlvbiwgRnJl ZSBQcmFjdGljZSBFeGFtcywgRnJlZSBTdHVkeSBNYXRlcmlhbCAvCkJvb2tzIGFuZCBGcmVlIER1 bXBzIIWFCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09Cg== ...

don't understand MkDir in Windoze, get runtime error
I want to create the "c:\test" directory if it isn't already created. If it is created I want it to do nothing. So the first time I run my sub procedure it does create the directory but the second time I run it, it does not do nothing it gives me a runtime error. "Path/file access error on the MkDir line. So I guess I need a better test than the one I have? Can you help? tia, If Dir(STR_DIRECTORY_PATH) = "" Then MkDir STR_DIRECTORY_PATH Else End If That is because the directory already exists..... so, try: ? dir("c:\oem",vbDirectory)...

LPAD Directory
I just upgraded from Outlook 2000 to 2002 and the LPAD Directory with user name/password comes up and user name says Null. Why does this do this. I have been pressing cancel. I have received but am having trouble sending mail. Any ideas how to bypass the LPAD thing. Are you using an LDAP directory for address lookup? If not, then use the Tools-Email accounts-Directories-View or Change to delete this option. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the Swen virus, all e-mails sent to my actual account will be deleted w/out r...

Changing IS Transaction Logs Location
I need to change the location of my Information Store Transaction Logs. Whoever set up my mail server put them on a 1GB drive which is filling up every 10 days. I have plenty of room on another drive. Can I simply use the Database Paths Tab and change the location there? Will the system transfer the old logs to that location? Are they any dangers in doing this? Thanks in advance. what version Exchange? for 5.5, use the Optimizer wizard to move your Transaction log files... "jim treitman" <dtc@softprowest.com> wrote in message news:18f1e01c44cae$5de4e940$a601280a@phx....

I keep getting an error "Operation cannot be completed, one or mo.
I have just installed Office Professinal 2003. Every time I try to use any of the features in Outlook I get the following; "Operation cannot be completed, one or more parameter values are not valid" PLEASE advise! Here is Info from microsoft KB You receive the "One or more parameter values are not valid" error message when you update a task in Outlook 2000 or in Outlook 2002 http://support.microsoft.com/default.aspx?scid=kb;en-us;197036 This info for Outlook 2000, and Outlook 2002, but If this info match with your case, follow instruction. "BigMac" <...

Rounding generated on funds application
We are finding that an incorrect rounding entry is being created when we apply a cash receipt against a receivables invoice. The rounding amount generates an entry something like: DR AR 13,317.05 CR Rounding 13,317.05 We would have expected the rounding to be in the pennies, not thousands. The rounding amount almost equals the total amount of the invoice. The invoice & payment both balance in the functional currency without this additional rounding entry being created. Any idea how to prevent this from happening? We're having to do a journal entry to back this out each time it hap...

Adding button to Form, How to get the wizard?
Hello, I am adding a button to my form and I need the button to open, save or close other forms. I want the wizard to start directly after I add the button to the form. I started first time but than I have to changed someting and it is not running anymore. Can you help me? Thanks a lot Jan, When you have the form in design view goto the Toolbox toolbar and ensure that the Control Wizard (2nd button from the left) button is selected (highlighted). This button can be enabled or disabled. when enable the wizard will startup when disabled it leaves you to do all the worksetup yourself...

Common uses for XML in an asp web application
I recently created an application that used an xml file to define 4 different groups used for my app, and within each of those groups are <item></item> tags to declare different values that were used to lookup values in a database. This worked pretty well to allow me to dynamically create navigation buttons to perform operations etc.. Now i am trying to think of other common uses for xml that would make my apps even more scalable. I think I could have used xml again in my app for this operation althought i did not because of time constraints: Once records were grabbed from the d...

Services Invoices Get "DROP SHIP" box checked Automatically
This is a multi-part message in MIME format. ------=_NextPart_000_000A_01CA45AC.F9A0B1F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello Everybody, Here is another story. we are GP 10 SP3 and we also a Field Service (Depot Module) installed = for which we use an Invoice ( SVC000000) and our type is Service type = Invoice. At the time of posting the Service Charges being generated by the Depot = Module, the Drop ship box gets checked automatically for which we can't = charge the customer for shipping charges. Basically we eve...

Database support in my application
I have a Dialog based project, and I need to acces/query a database, a very simple situation, just get a string from a .dbf database. What do I need in terms of MFC classes? Can anyone give me an example please. Thank you. Take a look at CRecordSet. If you are using Visual Studio 6.0 add a class that inherits from CRecordSet through the classwizard and it will walk you through it. If you are using Visual Studio .NET go to add class, select MFC ODBC Consumer. AliR. "Ovidiu Blejdea" <blejdea.ovidiu@gmail.com> wrote in message news:ef5u4SRVHHA.1200@TK2MSFTNGP04.phx.gbl...