Click here to Skip to main content
12,250,675 members (38,363 online)

ATL / WTL / STL

 
GeneralRe: C++ Delegate/Events Pin
Edward G Dana15-Nov-12 13:35
memberEdward G Dana15-Nov-12 13:35 
GeneralRe: C++ Delegate/Events Pin
Richard MacCutchan15-Nov-12 23:45
mvpRichard MacCutchan15-Nov-12 23:45 
AnswerRe: C++ Delegate/Events Pin
pasztorpisti20-Nov-12 2:53
memberpasztorpisti20-Nov-12 2:53 
GeneralRe: C++ Delegate/Events Pin
EDanaII20-Nov-12 16:23
memberEDanaII20-Nov-12 16:23 
QuestionReturn FALSE in InitInstance causes crash in 64Bits Pin
khaliloenit8-Nov-12 1:01
memberkhaliloenit8-Nov-12 1:01 
AnswerRe: Return FALSE in InitInstance causes crash in 64Bits Pin
Albert Holguin10-Dec-12 4:30
memberAlbert Holguin10-Dec-12 4:30 
QuestionHow to get used dll's path information programetically? Pin
litu kumar6-Nov-12 19:38
memberlitu kumar6-Nov-12 19:38 
AnswerRe: How to get used dll's path information programetically? Pin
Richard MacCutchan6-Nov-12 21:40
mvpRichard MacCutchan6-Nov-12 21:40 
GeneralRe: How to get used dll's path information programetically? Pin
litu kumar6-Nov-12 23:27
memberlitu kumar6-Nov-12 23:27 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan7-Nov-12 4:54
mvpRichard MacCutchan7-Nov-12 4:54 
GeneralRe: How to get used dll's path information programetically? Pin
litu kumar7-Nov-12 17:11
memberlitu kumar7-Nov-12 17:11 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan7-Nov-12 21:34
mvpRichard MacCutchan7-Nov-12 21:34 
GeneralRe: How to get used dll's path information programetically? Pin
litu kumar7-Nov-12 22:35
memberlitu kumar7-Nov-12 22:35 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan8-Nov-12 0:16
mvpRichard MacCutchan8-Nov-12 0:16 
litu kumar wrote:
why it was still printing the application's Exe path
I have already explained twice. If the DLL has not been loaded into your application's address space then the call to GetModuleHandle() will return NULL; something that you have not catered for in your code. If the module handle is NULL then GetModuleFileName() will return the path of your executable program. The sequence you should follow is:
HMODULE hmod = LoadLibrary(TEXT("MyApp.dll"));
if (hmod != NULL)
{
    TCHAR szPath[MAX_PATH + 1];
    DWORD dwLen = GetModuleFileName(hmod, szPath, MAX_PATH);
    if (dwLen > 0)
    {
        wprintf(L"CURRENT DIRECTORY: %s\n" ,szPath);
    }
    else
    {
        // check GetLastError() for reason
    }
}
else
{
// display error message
}
One of these days I'm going to think of a really clever signature.

GeneralRe: How to get used dll's path information programetically? Pin
litu kumar8-Nov-12 2:58
memberlitu kumar8-Nov-12 2:58 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan8-Nov-12 4:03
mvpRichard MacCutchan8-Nov-12 4:03 
GeneralRe: How to get used dll's path information programetically? Pin
litu kumar15-Nov-12 19:53
memberlitu kumar15-Nov-12 19:53 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan15-Nov-12 23:50
mvpRichard MacCutchan15-Nov-12 23:50 
AnswerRe: How to get used dll's path information programetically? Pin
hacker240union22-Nov-12 23:41
memberhacker240union22-Nov-12 23:41 
Questiondetect close event with CAsyncSocket Pin
bkelly135-Nov-12 10:32
memberbkelly135-Nov-12 10:32 
QuestionIntermediate GUI Techniques Pin
bkelly132-Nov-12 3:21
memberbkelly132-Nov-12 3:21 
AnswerRe: Intermediate GUI Techniques Pin
Richard MacCutchan2-Nov-12 6:20
mvpRichard MacCutchan2-Nov-12 6:20 
Questionproblem with sprintf_s() on win 7 Pin
Member 93537761-Nov-12 21:34
memberMember 93537761-Nov-12 21:34 
AnswerRe: problem with sprintf_s() on win 7 Pin
Richard MacCutchan1-Nov-12 22:50
mvpRichard MacCutchan1-Nov-12 22:50 
GeneralRe: problem with sprintf_s() on win 7 Pin
bkelly132-Nov-12 3:16
memberbkelly132-Nov-12 3:16 
GeneralRe: problem with sprintf_s() on win 7 Pin
Richard MacCutchan2-Nov-12 6:15
mvpRichard MacCutchan2-Nov-12 6:15 
GeneralRe: problem with sprintf_s() on win 7 Pin
Member 93537764-Nov-12 16:34
memberMember 93537764-Nov-12 16:34 
GeneralRe: problem with sprintf_s() on win 7 Pin
Richard MacCutchan4-Nov-12 21:26
mvpRichard MacCutchan4-Nov-12 21:26 
AnswerRe: problem with sprintf_s() on win 7 Pin
H.Brydon26-Nov-12 19:36
memberH.Brydon26-Nov-12 19:36 
Questionwsageterror() Pin
bkelly131-Nov-12 15:28
memberbkelly131-Nov-12 15:28 
AnswerRe: wsageterror() Pin
Richard MacCutchan1-Nov-12 22:48
mvpRichard MacCutchan1-Nov-12 22:48 
QuestionSTL map issue in VS2010 Pin
Subhash Madhukar30-Oct-12 3:47
memberSubhash Madhukar30-Oct-12 3:47 
AnswerRe: STL map issue in VS2010 Pin
Richard MacCutchan30-Oct-12 6:04
mvpRichard MacCutchan30-Oct-12 6:04 
Questionhow do i copy a CImage DIB to clipboard Pin
Member 951640015-Oct-12 11:15
memberMember 951640015-Oct-12 11:15 
AnswerRe: how do i copy a CImage DIB to clipboard Pin
Andrew Cherednik15-Oct-12 11:41
memberAndrew Cherednik15-Oct-12 11:41 
QuestionWhy does this fail - CFile / SeekToEnd? Pin
charlieg10-Oct-12 6:43
membercharlieg10-Oct-12 6:43 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg10-Oct-12 9:31
membercharlieg10-Oct-12 9:31 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
Andrew Cherednik10-Oct-12 11:23
memberAndrew Cherednik10-Oct-12 11:23 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 2:20
membercharlieg11-Oct-12 2:20 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
Richard MacCutchan10-Oct-12 21:45
mvpRichard MacCutchan10-Oct-12 21:45 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 2:30
membercharlieg11-Oct-12 2:30 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 4:53
membercharlieg11-Oct-12 4:53 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
Richard MacCutchan11-Oct-12 11:19
mvpRichard MacCutchan11-Oct-12 11:19 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg11-Oct-12 11:34
membercharlieg11-Oct-12 11:34 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
Richard MacCutchan11-Oct-12 12:01
mvpRichard MacCutchan11-Oct-12 12:01 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg12-Oct-12 5:54
membercharlieg12-Oct-12 5:54 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
Stephen Hewitt11-Oct-12 12:58
memberStephen Hewitt11-Oct-12 12:58 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg18-Jan-13 1:47
membercharlieg18-Jan-13 1:47 
QuestionKeep program open and running Pin
Lucidation8-Oct-12 11:23
memberLucidation8-Oct-12 11:23 
AnswerRe: Keep program open and running Pin
Richard MacCutchan8-Oct-12 22:14
mvpRichard MacCutchan8-Oct-12 22:14 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 2 Mar 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid