Click here to Skip to main content
       

Managed C++/CLI

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
AnswerRe: How to use NTGraph3D Activex Control in Visual Studio 2010.mvpRichard MacCutchan23 Nov '12 - 1:44 
http://www.codeproject.com/Messages/2922875/HOW-TO-ASK-A-QUESTION.aspx[^].
One of these days I'm going to think of a really clever signature.

Question'J' Character printed on empty fields on dialogsmembercnuis2kool18 Nov '12 - 22:29 
Hi,
 
We are seeing some strange behavior with our applications recently.
 
We have developed a VC++ application (dll) which will be loaded by another application (exe, core product). The dll is developed in VC++ 2005 with MFC.
 
When we open any dialog from the exe, we could see some junk   character (luckily 'J' all the time) populated in all the empty fields on the dialog.
 
Customer is very annoyed with this behavior but we could not figure out the solution. They are saying the issue is caused by the dll.
 
Hope someone will help me.
Questionhow to get programettically a registered DLL's Version information?memberlitu kumar7 Nov '12 - 21:32 
Hi,
I want to get a dll's version detail ,which is registered.
And want to get this data programmetically.
 
I think ,One way we can make our code to search in Registry-entries & get the information from there.
 
But unfortunately, i'm not fully aware, what will be the code for this.
 
PLease advice Smile | :)
AnswerRe: how to get programettically a registered DLL's Version information?mvpRichard MacCutchan7 Nov '12 - 21:43 
Why have you posted this question here? It has nothing to do with C++/CLI, and I have already answered it in this thread[^].
One of these days I'm going to think of a really clever signature.

GeneralRe: how to get programettically a registered DLL's Version information?memberlitu kumar7 Nov '12 - 21:52 
Hi Richard,
It's related to C++ ,I thought we can put here
GeneralRe: how to get programettically a registered DLL's Version information?mvpRichard MacCutchan8 Nov '12 - 0:04 
This forum is for C++/CLI issues.
One of these days I'm going to think of a really clever signature.

GeneralRe: how to get programettically a registered DLL's Version information?memberH.Brydon1 Jan '13 - 9:46 
I don't disagree with your chiding but you answered a different question in that message. He was looking for info on how to get the DLL version info here. The question/answer you refer to in the other thread was how to get the DLL file location...
 
... both worthy questions but, yeah, should have been asked in a different forum.
--
Harvey

GeneralRe: how to get programettically a registered DLL's Version information?mvpRichard MacCutchan1 Jan '13 - 22:14 
Since this question is nearly two months old your comments and answer are largely irrelevant.
One of these days I'm going to think of a really clever signature.

GeneralRe: how to get programettically a registered DLL's Version information?memberH.Brydon2 Jan '13 - 5:03 
Perhaps for the original author but not for someone reading the thread who might be looking for the answer to the question.
--
Harvey

AnswerRe: how to get programettically a registered DLL's Version information?memberH.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?memberMichael_Tan4 Nov '12 - 16:10 
Here is the MSDN information for Threadpool of I/O Completion Objects. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682464(v=vs.85).aspx
But I can not use them to create my threadpool and do asyn read and write operation.Is anyone have experience of using these functions?
CancelThreadpoolIo CloseThreadpoolIo StartThreadpoolIo Thread Pools WaitForThreadpoolIoCallbacks
Would you give me a code example for these use?
Thank you!
I/O Completion, Threadpool

QuestionAny C++/CLI Experts wanted to become book author?membervivekthangaswamy4 Nov '12 - 16:08 
Any C++/CLI Experts wanted to become book author?
 
Please do contact author@darkcrab.com,
 
Darkcrab Press new book publishing company offering opportunity for fresh authors. Grab this opportunity and become an author soon. All the best friends.
QuestionConvert 24-bit bmp capture to 8-bit capture in VC++, is it possible?memberlucky_122129 Oct '12 - 1:23 
Hi All,
 
Convert 24-bit bmp capture to 8-bit capture in VC++, is it possible?
 
Possible,
 
Can any provide the solution.
 

Thanks,
Lucky.
AnswerRe: Convert 24-bit bmp capture to 8-bit capture in VC++, is it possible?memberjschell29 Oct '12 - 8:44 
lucky_1221 wrote:
is it possible?

 
Yes.
 

lucky_1221 wrote:
Can any provide the solution.

 
Presumably you want someone to give you the code rather than just wanting to know if anyone could figure it out.
 
I won't be providing the code.
 
Presuming that no one else will either then you would need to do the following.
1. Learn basic programming
2. Learn basic IO (presumably you want to do this to files.)
3. Learn what image formats exists, and find the specifications for each. This includes 24 bit and 8 bit.
4. Write code to read a 24 bit image - using 1/3
5. Write code to write a 8 bit image - using 1/3
6. Put 2, 4 and 5 together into a program.
QuestionCurrently i am abel to capture the 24-bit screens capturerin.memberlucky_122129 Oct '12 - 1:09 
Hi All,
 
Currently i am able to capture the 24-bit screens capturerin.
 
at the same process i am unable to capture the 8-bit screens and 16-bit screens.
 
Can any one have this solution provide please.
 
Thanks,
lucky.
QuestionCurrently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version.memberlucky_122126 Oct '12 - 2:15 
Hi All,
 
Currently I am using the log4cplus 1.0.2 version in vc++ 6 version, Now i want to use the 1.1.0 version of log4cplus in vs2010 with windows 7.
 
Can any one provide the steps, what is the correct process.
 
Tell me please.
 
Thanks,
Manojkumar.U
AnswerRe: Currently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version.mvpRichard MacCutchan26 Oct '12 - 3:12 
you can get it here[^].
One of these days I'm going to think of a really clever signature.

GeneralRe: Currently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version.memberlucky_122127 Oct '12 - 0:52 
Any way thanks for your reply.
 
Now i have the everything in my side. How to merge the latest log4cplus 1.1.0 in my application.
 
What is the process.
 
Past my senior employees did this job, i wan not here.
 
That's why i am stuck using the log4cplus application.
 

Thanks,
Manojkumar.U
GeneralRe: Currently I am using the log4cplu 1.0.2 version, Now i want to use the 1.1.0 version.mvpRichard MacCutchan27 Oct '12 - 3:11 
lucky_1221 wrote:
What is the process.
I don't know, either you add the source code to your project, or build it as a stand-alone library which you link to your application. I would guess that reading the documentation would be a good starting point.
One of these days I'm going to think of a really clever signature.

QuestionexceptionsmemberEmmos201116 Oct '12 - 5:10 
HI
 
I am a newbie to c++/CLI and I am adding code to an existing code.
 
The code has a thread that has a try {} catch {} (for exceptions)
 
my problrm is that the thread runs fine then it develops an exception after it calls a couple of routines.
 
Why does this happen?
 
How do I know which exception happened?
How to fix it?
 
Thanks
Emmos2011
AnswerRe: exceptionsmvpRichard MacCutchan16 Oct '12 - 8:22 
Emmos2011 wrote:
How do I know which exception happened?
Since you are catching it you just need to display the details there. Or are you falling into the trap of having a null catch block?
One of these days I'm going to think of a really clever signature.

Questionc++/cli define new explicit implementation of a sealed methodmemberMarius Bancila10 Oct '12 - 23:21 
Let's say I have this code:
 
    interface class IFoo
    {
    public:
       void foo();
    };
    
    ref class FooBase : public IFoo
    {
    public:
       virtual void foo() sealed = IFoo::foo
       {
       }
    };
 
I need to define a new explicit foo() in a derived class, that overrides the sealed method in the base class. How do I do that? I tried a lot of things and none compiled.
 
    ref class FooDerived : public FooBase
    {
    public:
       virtual void foo() 
       {
       }
    };
 
results in
 
error C4485: 'FooDerived::foo' : matches base ref class method 'FooBase::foo', but is not marked 'new' or 'override'; 'new' (and 'virtual') is assumed
1> .\Dlg.cpp(22) : see declaration of 'FooBase::foo'
1> Specify 'override' (and 'virtual') to override the ref class virtual method
1> Specify 'new' (and 'virtual') to hide the ref class virtual method with a new virtual method
1> Position for 'new' and 'override' keywords is after method parameter list
 
but if I add new
 
    ref class FooDerived : public FooBase
    {
    public:
       virtual void foo() new
       {
       }
    };
 
I get
 
Dlg.cpp(30) : error C2059: syntax error : 'string'
Dlg.cpp(31) : error C2091: function returns function
 
also
 
    ref class FooDerived : public FooBase
    {
    public:
       virtual void foo() new = FooBase::foo
       {
       }
    };
 
results in
 
1>.\Dlg.cpp(30) : error C2059: syntax error : 'string'
1>.\Dlg.cpp(30) : error C2091: function returns function
1>.\Dlg.cpp(31) : warning C4569: 'FooBase::foo' : no members match the signature of the explicit override
1>.\Dlg.cpp(31) : error C3671: 'FooDerived::foo' : function does not override 'FooBase::foo'
 
and
 
    ref class FooDerived : public FooBase, public IFoo
    {
    public:
       virtual void foo() new = IFoo::foo
       {
       }
    };
 
generates
 
1>.\Dlg.cpp(30) : error C2059: syntax error : 'string'
1>.\Dlg.cpp(30) : error C2091: function returns function
1>.\Dlg.cpp(31) : warning C4569: 'IFoo::foo' : no members match the signature of the explicit override
1>.\Dlg.cpp(31) : error C3671: 'FooDerived::foo' : function does not override 'IFoo::foo'
 
What I'm trying to do is overriding HwndSource.System.Windows.Interop.IKeyboardInputSink.TabInto[^]
 
Any help is appreciated.
AnswerRe: c++/cli define new explicit implementation of a sealed methodmemberJohn Schroedl11 Oct '12 - 3:19 
You could use Renamed Overriding which will work if you're always called through an interface handle.
 
interface class IFoo
{
public:
	void foo();
};
 
ref class FooBase : public IFoo
{
public:
	virtual void foo() sealed = IFoo::foo
	{
		Console::WriteLine("FooBase");
	}
};
 
ref class FooDerived : public FooBase
{
public:
	// derivedFoo is the implementation of IFoo::foo
	virtual void derivedFoo() = IFoo::foo
	{
		Console::WriteLine("FooDerived");
	}
};
 
int main(array<System::String ^> ^args)
{
	FooBase^ fb = gcnew FooBase();
	fb->foo();					// Prints "FooBase"

	FooDerived^ fd = gcnew FooDerived();
	fd->foo();					// Prints "FooBase"

	IFoo^ iface = dynamic_cast<IFoo^>(fb);
	iface->foo();					// Prints "FooBase"

	iface = dynamic_cast<IFoo^>(fd);
	iface->foo();					// Prints "FooDerived"

    return 0;
}

GeneralRe: c++/cli define new explicit implementation of a sealed methodmemberJohn Schroedl11 Oct '12 - 3:29 
Perhaps better. This seems to be what you're after to me.
 
ref class FooDerived : public FooBase
{
public:
	virtual void foo() new = IFoo::foo
	{
		Console::WriteLine("FooDerived");
	}
};
 
John
GeneralRe: c++/cli define new explicit implementation of a sealed methodmemberMarius Bancila11 Oct '12 - 10:12 
Yes. This seem to be what I was looking for. It's curious that out of all my attempts, this one I missed. Frown | :(
 
BTW, there is a little error in your sample.
 
FooDerived^ fd = gcnew FooDerived();
fd->foo();					// Prints "FooBase"
This obviously prints FooDerived.
 
And the first example, where you say virtual void foo() = IFoo::foo does not compile.
 
But thanks again for the help.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid