Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How To Get Current Module (dll) Handle

Posted on 2006-04-29
8
Medium Priority
?
4,711 Views
Last Modified: 2008-01-09
I need to get the name of current module (dll). I dont have the HMODULE or the name of the module.

Thanx n Advance
0
Comment
Question by:adnan562
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 

Author Comment

by:adnan562
ID: 16574051
Thanx Dan7el

But using GetModuleHandle() u need to know the name of module, which i mentioned i dont have.
0
 
LVL 2

Expert Comment

by:MechanTOurS
ID: 16575654
U can get the HMODULE with
BOOL WINAPI GetModuleHandleEx(  DWORD dwFlags,  LPCTSTR lpModuleName,  HMODULE* phModule);

this function retrieve the module from a function pointer contained into the dll:

void    *functionPtr = ...;
HMODULE  handle = NULL;
char     path[MAX_PATH] = "";
 
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, functionPtr, &handle );
GetModuleFileNameA(handle , path, __countof(path));

0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 

Author Comment

by:adnan562
ID: 16577751

GetModuleHandleEx is for XP.
Any solution for windows 2000
0
 
LVL 2

Accepted Solution

by:
MechanTOurS earned 300 total points
ID: 16595682
0
 

Author Comment

by:adnan562
ID: 16768595
Hi MechanTOurS

Thnx alot MechanTOurS

Although it dint work for me, caz I am hooking into another process memory but it was of great help thats why I am accepting your answer.

Adnan
0
 

Author Comment

by:adnan562
ID: 16783938
Hi all,

I found a solution many thanx to cmk.

See this forum at CodeProject

http://www.codeproject.com/script/comments/forums.asp?msg=1467646&forumid=1647#xx1467646xx

Adnan
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Introduction to Processes

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question