Click here to Skip to main content
14,768,146 members
Home » Discussions » Managed C++/CLI
   

Managed C++/CLI

 
Questionhow to get programettically a registered DLL's Version information? Pin
litu kumar7-Nov-12 22:32
Memberlitu kumar7-Nov-12 22:32 
AnswerRe: how to get programettically a registered DLL's Version information? Pin
Richard MacCutchan7-Nov-12 22:43
mveRichard MacCutchan7-Nov-12 22:43 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
litu kumar7-Nov-12 22:52
Memberlitu kumar7-Nov-12 22:52 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
Richard MacCutchan8-Nov-12 1:04
mveRichard MacCutchan8-Nov-12 1:04 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
H.Brydon1-Jan-13 10:46
professionalH.Brydon1-Jan-13 10:46 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
Richard MacCutchan1-Jan-13 23:14
mveRichard MacCutchan1-Jan-13 23:14 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
H.Brydon2-Jan-13 6:03
professionalH.Brydon2-Jan-13 6:03 
AnswerRe: how to get programettically a registered DLL's Version information? Pin
H.Brydon1-Jan-13 10:44
professionalH.Brydon1-Jan-13 10:44 
I think you are looking for the DLLVERSIONINFO data. Here is a class that loads a dll and pulls that info from it:

class CLoadLibrary
{
public:
	CLoadLibrary(LPCTSTR lpszLibFileName);
	virtual ~CLoadLibrary();
	operator HINSTANCE();
	DWORD GetModuleVersion();

protected:
	HINSTANCE m_hLibModule;
};



CLoadLibrary::CLoadLibrary(LPCTSTR lpszLibFileName)
{
	m_hLibModule = ::LoadLibrary(lpszLibFileName);
	ASSERT(m_hLibModule != NULL);
}

CLoadLibrary::~CLoadLibrary()
{
	::FreeLibrary(m_hLibModule);
}

CLoadLibrary::operator HINSTANCE()
{
	return m_hLibModule; // cast operator
}

DWORD CLoadLibrary::GetModuleVersion()
{
	typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO*);

	DLLGETVERSIONPROC pDllGetVersion =
		(DLLGETVERSIONPROC)::GetProcAddress(*this, _T("DllGetVersion"));

	DWORD dwVersion = 0L;
	if (pDllGetVersion != NULL)
	{
		DLLVERSIONINFO dvi;
		ZeroMemory(&dvi, sizeof(dvi));
		dvi.cbSize = sizeof(dvi);
		
		HRESULT hr = (*pDllGetVersion)(&dvi);
		if (SUCCEEDED(hr))
		{
			ASSERT(dvi.dwMajorVersion <= 0xFFFF);
			ASSERT(dvi.dwMinorVersion <= 0xFFFF);
			dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion);
		}
	}
	
	return dwVersion;
}


Clearly you can simplify it for your needs...
--
Harvey

QuestionHow to use Threadpool of I/O Completion Objects? Pin
Michael_Tan4-Nov-12 17:10
MemberMichael_Tan4-Nov-12 17:10 
QuestionAny C++/CLI Experts wanted to become book author? Pin
vivekthangaswamy4-Nov-12 17:08
professionalvivekthangaswamy4-Nov-12 17:08 
QuestionConvert 24-bit bmp capture to 8-bit capture in VC++, is it possible? Pin
lucky_122129-Oct-12 2:23
Memberlucky_122129-Oct-12 2:23 
AnswerRe: Convert 24-bit bmp capture to 8-bit capture in VC++, is it possible? Pin
jschell29-Oct-12 9:44
Memberjschell29-Oct-12 9:44 
QuestionCurrently i am abel to capture the 24-bit screens capturerin. Pin
lucky_122129-Oct-12 2:09
Memberlucky_122129-Oct-12 2:09 
QuestionCurrently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version. Pin
lucky_122126-Oct-12 3:15
Memberlucky_122126-Oct-12 3:15 
AnswerRe: Currently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version. Pin
Richard MacCutchan26-Oct-12 4:12
mveRichard MacCutchan26-Oct-12 4:12 
GeneralRe: Currently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version. Pin
lucky_122127-Oct-12 1:52
Memberlucky_122127-Oct-12 1:52 
GeneralRe: Currently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version. Pin
Richard MacCutchan27-Oct-12 4:11
mveRichard MacCutchan27-Oct-12 4:11 
Questionexceptions Pin
Emmos201116-Oct-12 6:10
MemberEmmos201116-Oct-12 6:10 
AnswerRe: exceptions Pin
Richard MacCutchan16-Oct-12 9:22
mveRichard MacCutchan16-Oct-12 9:22 
Questionc++/cli define new explicit implementation of a sealed method Pin
Marius Bancila11-Oct-12 0:21
professionalMarius Bancila11-Oct-12 0:21 
AnswerRe: c++/cli define new explicit implementation of a sealed method Pin
John Schroedl11-Oct-12 4:19
professionalJohn Schroedl11-Oct-12 4:19 
GeneralRe: c++/cli define new explicit implementation of a sealed method Pin
John Schroedl11-Oct-12 4:29
professionalJohn Schroedl11-Oct-12 4:29 
GeneralRe: c++/cli define new explicit implementation of a sealed method Pin
Marius Bancila11-Oct-12 11:12
professionalMarius Bancila11-Oct-12 11:12 
GeneralRe: c++/cli define new explicit implementation of a sealed method Pin
John Schroedl12-Oct-12 3:29
professionalJohn Schroedl12-Oct-12 3:29 
GeneralRe: c++/cli define new explicit implementation of a sealed method Pin
Marius Bancila11-Oct-12 22:35
professionalMarius Bancila11-Oct-12 22:35 

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.