A .NET assembly can be exported as a COM dll, by using the regasm.exe tool provided in the .NET SDK (or tlbexp.exe + regsvr32.exe). Once created and registered, the type library can be used like any other COM object.
Of course, the COM object itself is only an entry-point to the .NET EE. As a consequence you need to distribute the .NET run-time (dotnetfx.exe) along with your MFC app.[/edit]
Alright, I was going to respond with a smartass answer, but I won't. First of all, the code you've shown will indeed work if it's running on some special embedded device created by you. However, acessing the address of 0 (NULL) is usually a really bad idea (in usual circumstances, i.e. almost every operating system), and it's why most programmers set pointer addresses to zero when they initialize them: So it will cause a fault when you access an invalid address. So, what you need to do, is allocate your node pointer on the heap. Do this:
a * node = new a;
Don't forget to delete it when you are done with it:
Also, since you are using C++, why not use the std::list? It would provide you with all the cool stuff like storage, traversal, etc.
I want to implement a mini-gateway on Windows platform.
Where can I get some sample codes for it? I need a gateway
that can implement basic functions, for example, check whether
a package from a certain IP address can pass through.
I am using SetDialogBkColor to change the background color of our dialogs. Unfortunately CPropertySheet does not apply this setting. I have been able to change the property sheets background color via WM_CTRLCOLOR, but I can't seem to do this for the tab control embedded on the property sheet. I have tried subclassing the tab control, but I don't get WM_CTRLCOLOR messages for some reason. I have also tried overriding WM_DRAWITEM and WM_ERASEBGND with no success. Any ideas short of writing my own property sheet class? Thanks
I want to "replace" the 3d border around a CEdit with a simple rectangle ( that I can change color when the CEdit gets and looses the focus ).
How, Where (and maybe when), should I do this ?
I try overriding the WM_PAINT, but that doesn't go well,
// this is only an example, and I know it's not what I want at the end ...void CCustomEdit::OnPaint()
CPaintDC dc(this); // device context for painting
GetWindowRect( rect );
brush.CreateSolidBrush( RGB( 200, 0, 0 ) );
dc.FillRect( rect, &brush );
I was expecting to have at least a redish rectangle drawn somewhere, or at least a red flicker... but I only get a badly redrawn CEdit.
Thanks for you input!
Maximilien Lincourt For success one must aquire one's self
Try using GetWindowDC() instead of GetDC(). also, do not call CEdit::OnNCPaint() because that will simply cause the OS to draw over any drawing you have just done. also, (part two) be sure to call ReleaseDC().