Click here to Skip to main content
15,899,825 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: How to call a static libray in a dll? Pin
Richard MacCutchan21-Jan-13 22:32
mveRichard MacCutchan21-Jan-13 22:32 
Questionfrom unmanaged c++ to managed: passing int& parameter Pin
acastrucc19-Dec-12 4:30
acastrucc19-Dec-12 4:30 
QuestionCompilation Problem Pin
tcnm12-Dec-12 9:18
tcnm12-Dec-12 9:18 
QuestionRe: Compilation Problem Pin
Richard MacCutchan12-Dec-12 22:56
mveRichard MacCutchan12-Dec-12 22:56 
Answer-Re: Compilation Problem Pin
tcnm14-Dec-12 6:42
tcnm14-Dec-12 6:42 
GeneralRe: -Re: Compilation Problem Pin
Richard MacCutchan14-Dec-12 21:43
mveRichard MacCutchan14-Dec-12 21:43 
QuestionWhy c is so important? Pin
riceshoots10-Dec-12 4:47
riceshoots10-Dec-12 4:47 
AnswerRe: Why c is so important? Pin
Richard MacCutchan10-Dec-12 5:52
mveRichard MacCutchan10-Dec-12 5:52 
QuestionPlease vote for C++/CLI debug visualizer support Pin
John Schroedl7-Dec-12 4:25
professionalJohn Schroedl7-Dec-12 4:25 
QuestionHow to use NTGraph3D Activex Control in Visual Studio 2010. Pin
DhrumilS23-Nov-12 0:47
DhrumilS23-Nov-12 0:47 
AnswerRe: How to use NTGraph3D Activex Control in Visual Studio 2010. Pin
Richard MacCutchan23-Nov-12 1:44
mveRichard MacCutchan23-Nov-12 1:44 
Question'J' Character printed on empty fields on dialogs Pin
cnuis2kool18-Nov-12 22:29
cnuis2kool18-Nov-12 22:29 
Questionhow to get programettically a registered DLL's Version information? Pin
litu kumar7-Nov-12 21:32
litu kumar7-Nov-12 21:32 
AnswerRe: how to get programettically a registered DLL's Version information? Pin
Richard MacCutchan7-Nov-12 21:43
mveRichard MacCutchan7-Nov-12 21:43 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
litu kumar7-Nov-12 21:52
litu kumar7-Nov-12 21:52 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
Richard MacCutchan8-Nov-12 0:04
mveRichard MacCutchan8-Nov-12 0:04 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
H.Brydon1-Jan-13 9:46
professionalH.Brydon1-Jan-13 9:46 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
Richard MacCutchan1-Jan-13 22:14
mveRichard MacCutchan1-Jan-13 22:14 
GeneralRe: how to get programettically a registered DLL's Version information? Pin
H.Brydon2-Jan-13 5:03
professionalH.Brydon2-Jan-13 5:03 
AnswerRe: how to get programettically a registered DLL's Version information? Pin
H.Brydon1-Jan-13 9:44
professionalH.Brydon1-Jan-13 9: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 16:10
Michael_Tan4-Nov-12 16:10 
QuestionAny C++/CLI Experts wanted to become book author? Pin
vivekthangaswamy4-Nov-12 16:08
professionalvivekthangaswamy4-Nov-12 16:08 
QuestionConvert 24-bit bmp capture to 8-bit capture in VC++, is it possible? Pin
lucky_122129-Oct-12 1:23
lucky_122129-Oct-12 1:23 
AnswerRe: Convert 24-bit bmp capture to 8-bit capture in VC++, is it possible? Pin
jschell29-Oct-12 8:44
jschell29-Oct-12 8:44 
QuestionCurrently i am abel to capture the 24-bit screens capturerin. Pin
lucky_122129-Oct-12 1:09
lucky_122129-Oct-12 1:09 

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.