|
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
|
|
|
|
|
you can get it here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
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:
virtual void derivedFoo() = IFoo::foo
{
Console::WriteLine("FooDerived");
}
};
int main(array<System::String ^> ^args)
{
FooBase^ fb = gcnew FooBase();
fb->foo();
FooDerived^ fd = gcnew FooDerived();
fd->foo();
IFoo^ iface = dynamic_cast<IFoo^>(fb);
iface->foo();
iface = dynamic_cast<IFoo^>(fd);
iface->foo();
return 0;
}
|
|
|
|
|
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
|
|
|
|
|
Yes. This seem to be what I was looking for. It's curious that out of all my attempts, this one I missed.
BTW, there is a little error in your sample.
FooDerived^ fd = gcnew FooDerived();
fd->foo();
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.
|
|
|
|
|
Actually, that's not a error in the output, that's a direct paste from running the code and the output.
There is also no compile error for me (this was directly from running code). Notice the function name in FooDerived; it's "derivedFoo()" not "foo()".
FooDerived can only print "FooDerived" when fd->derivedFoo() is called OR when called via an IFoo^. So, calling fd->foo() does call the base class implementation.
virtual void derivedFoo() = IFoo::foo
|
|
|
|
|
It doesn't work in MFC apps with /clr support.
1>.\mfc_mm_2008.cpp(38) : error C2059: syntax error : 'string'
1>.\mfc_mm_2008.cpp(38) : error C2091: function returns function
1>.\mfc_mm_2008.cpp(39) : warning C4569: 'IFoo::foo' : no members match the signature of the explicit override
1>.\mfc_mm_2008.cpp(39) : error C3671: 'FooDerived::foo' : function does not override 'IFoo::foo'
The reason is MFC is rewriting the new operator with
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
So anyone wanting to do this in MFC, make sure you don't have that replacement of new before your declaration of the new function definition.
|
|
|
|
|
Good tip about the DEBUG_NEW screwing up the new keyword.
I tried the code in my MFC + /clr application but we've had to remove those DEBUG_NEW defines for other reasons so I didn't run into this issue. Good to know!
John
|
|
|
|
|
BTW, my kids have spent many hours playing your 'Alchemy' game so thanks for that
|
|
|
|
|
Hi,
I want to make only one file as /clr supported instead of whole project. But if i do the same i'm getting compilation error as -
Command line error D8016: '/ZI' and '/clr' command-line options are incompatible
My intention is to invoke managed API from unmanaged code.
I googled but not good result i found till now.
So kindly guide me how to avoid above error or any substitute Project-setting i need to do .
If possible please suggest(sample code)if any for my requirement.
Thanks
|
|
|
|
|
There is no sample code for your problem. The message is quite clear you cannot mix managed and unmanaged code in the same project this way. You need to split it into two projects, one which is normal unmanaged C++ and one which is managed and uses the /clr option. Calling Managed Code from Unmanaged Code and vice-versa[^] is a CodeProject article that will help you.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi Richard,
I got error when i tried as below -
- I created a COM Dll. Then i made it as CLR supported (whole project). But requirement is to make only required file as CLR supported.
It can be possible.
Because i observed,one of our existing COM dll contains only one file as CLR supported. And there is know issue with that COM Dll.
I think there is some project-setting or in code, we need to do for achieving the same.
That i'm trying to find out by comparing my project with that existing COM DLL. Unfortunately i didn't get any new thing till now.
Hence if any area i'm skipping while comparing ,Kindly advice .
Or any other way to achieve the same ,please guide
|
|
|
|
|
You may need to create a mixed mode wrapper dll. Create a new CLR class library. Inside that create a new unmanaged class (without the ref keyword) containing static functions. Expose it to your COM dll with the usual unmanaged __declspec macro declaration. Add a Framework reference to the managed dll you want to use.
Make sure the wrapper cpp file uses clr (should be default for managed dll, but check via right-click on cpp file, Properties, C/C++, General, Common Language Runtime support).
You could try to set the same option for one of the cpp files in your COM dll, if it's built in one of the newer VS versions. But chances are it won't work that way because of the incompatibilities you initially mentioned.
|
|
|
|
|
Hi, this is my first post.
Work flow is like this:
i open child dialog from a dialog( which is launched from a toolbar of a window) after editing i close the child dialog, after closing child dialog shadow is retained on window but not on the parent dialog. Later when i close the parent dialog the child dialog shadow disappears.
(issue exist only when i edit in child dialog)
Thanks a lot,
Shivaraj
|
|
|
|
|
That's because your main window does not receive a WM_PAINT message until the main dialog terminates. Cascading dialogs in this way is not the best design pattern.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi, I tried to use GetAncestor() method to get main window handle & REPAINT with RedrawWindow() or UpdateWindow(). Neither of which is working.
|
|
|
|
|
That's because, as I said before, your main window will not be able to action a WM_PAINT , or any other, message, until the dialog returns from DoModal() . You need to consider whether your design is the right way of doing things.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks for reply, I have seen same design patterns(using child dialog)in the same application but there is no issue there. I compared the code, am not finding any difference in RePainting aspects.
here i have sample code..
Below used OnModifyview dialog is child dialog of a dialog.
void CSelectColumnViewDlg::OnModifyview()
{
int iIndex = m_ctrlColumnViewList.GetCurSel();
if (iIndex < 0)
return;
double dViewId = m_ctrlColumnViewList.GetItemDataDouble(iIndex);
if (dViewId == 0.0)
return;
CWaitCursor wait;
CComPtr<idispatch> pDispColumnView;
CComPtr<itrackingdatamanager> pManager;
pManager.CoCreateInstance(CLSID_TrackingDataManager);
if (pManager)
pManager->GetColumnView(dViewId, &pDispColumnView);
CComQIPtr<itrackingcolumnview> pColumnView(pDispColumnView);
if (pColumnView == NULL)
return;
CModifyColumnViewDlg dlg;
dlg.SetColumnView(pColumnView);
dlg.SetType(m_lSolution, m_lListType);
dlg.SetTrackGroupCd(m_dTrackGroupCd);
std::set<cstring>* pExistingNames = GetExistingNames(iIndex);
dlg.SetExistingNames(pExistingNames);
if (dlg.DoModal() == IDOK)
{
HWND hWndAncestor = ::GetAncestor(GetSafeHwnd(), GA_ROOT);
m_ctrlColumnViewList.DeleteString(iIndex);
CComBSTR bstrName;
pColumnView->get_Name(&bstrName);
int iIndex = m_ctrlColumnViewList.AddString(CString(bstrName));
m_ctrlColumnViewList.SetItemDataDouble(iIndex, dViewId);
m_ctrlColumnViewList.SetCurSel(iIndex);
}
if (pExistingNames)
delete pExistingNames;
Invalidate();
//OnPaint(); //not working
//RedrawWindow();// not working
}
modified 7-Oct-12 0:04am.
|
|
|
|
|
I don't know what more I can say except to repeat my earlier comment: as long as you have a dialog open (called via DoModal() ) the main window cannot respond to messages and thus will not repaint itself.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
I have a C++ application & I know the assembly which contains the managed API. But i unable to access from my un-managed code.
Kindly help me using a simple program.
Please note only .net dll (assemblies)has been provided but not any .tlb file.
So we want, with out using .tlb file we need to invoke .net API.
Thanks
modified 4-Oct-12 10:05am.
|
|
|
|