473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

_ATLModule and GetModuleFileName

I need to get the DLL name in my ATL COM Server project in the .NET environment. I am not using MFC and also not using Managed C++ extensions.

In previous versions of ATL the following worked fine:
char sz[_MAX_PATH];
GetModuleFileName(_Module.m_hInst, sz, _MAX_PATH);

But _Module is now replaced by _ATLModule and this no longer works (no m_hInst).

Can anyone offer a solution? Thanks

Paul.


Nov 22 '05 #1
2 4338
"Paul" <an*******@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com
I need to get the DLL name in my ATL COM Server project in the .NET
environment. I am not using MFC and also not using Managed C++
extensions.

In previous versions of ATL the following worked fine:
char sz[_MAX_PATH];
GetModuleFileName(_Module.m_hInst, sz, _MAX_PATH);

But _Module is now replaced by _ATLModule and this no longer works
(no m_hInst).


_AtlBaseModule.GetModuleInstance()

--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Nov 22 '05 #2
"Paul" <an*******@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com
I need to get the DLL name in my ATL COM Server project in the .NET
environment. I am not using MFC and also not using Managed C++
extensions.

In previous versions of ATL the following worked fine:
char sz[_MAX_PATH];
GetModuleFileName(_Module.m_hInst, sz, _MAX_PATH);

But _Module is now replaced by _ATLModule and this no longer works
(no m_hInst).


_AtlBaseModule.GetModuleInstance()

--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Yves | last post by:
Hello, Using VB6, i am trying to get the module filename from the cursor positioned on any windows, with the following code (modified from Article ID: Q112649 in MSDN LIBRARY for Visual Studio...
1
by: Paul | last post by:
I need to get the DLL name in my ATL COM Server project in the .NET environment. I am not using MFC and also not using Managed C++ extensions. In previous versions of ATL the following worked...
4
by: Aryeh Katz | last post by:
How can I determine the full name of a c# executable, like the c GetModuleFileName? Thanks. Aryeh
1
by: cashdeskmac | last post by:
I have written a short program which reads from XML and flat text files. I have deployed the apllication wwith the files included but the app can no longer find the files. In the code, I read...
12
by: ORC | last post by:
Hi, I have an application in which I need information of the path to the exe file. The application must run on both compact and full framework and on the Internet I found this code snip that...
5
by: Steve McLellan | last post by:
Hi, Probably an easy one if you know how, but I'm stumped... I've got a function in a DLL and I need to be able to find out the application path of the application that's called it. From my...
2
by: academic | last post by:
This is from something I wrote 15 years ago. Haven't use c since then Wanted to use it now so I cut and pasted into VS2005 on WinXP Now I can't seem to get the types OK GetModuleFileName...
11
by: Mike C# | last post by:
Hi all, Probably a really simple answer to this, but so far I'm having trouble locating the answer. I'm writing an unmanaged VC++ app and I need to grab the currently executing filename and...
4
by: roto23 | last post by:
I wrote a complied c# class (SpulClass). In that class I use this to get the directory it resides in.. System.IO.Directory.GetCurrentDirectory(); When I call this this class (dll) from a c#...
3
by: xoinki | last post by:
hi all, I am trying to fetch the name of the binary.. i.e, for eg, I am running sql.exe doin some operation.. in that I want to fetch the name 'sql.exe' i.e name of the running application.. how do...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.