Hi,
I have invoked BeginInvoke on 10 delegates in a loop. Instead of using 10 threads, the threadpool uses only two/three threads for executing the delegates. Can somebody please explain the reason for this?. The delegate execution takes only a few ms (less than 10ms).
When I logged threadpool parameters before invoking BeginInvoke it...
According to this question it's possible to seamlessly combine managed and unmanaged code using C++/CLI. I don't quite get it - shouldn't there be marshalling between managed and unmanaged anyway?
For example, I have InnerLibrary that is compiled as a native C++ .dll with a header published and C++/CLI OuterLibrary that calls code from ...
hi,
how do I read namespaces from the XML document?
<fx:FIBEX xmlns:fx="http://www.asam.net/xml/fbx" xmlns:can="http://www.asam.net/xml/fbx/can" xmlns:flexray="http://www.asam.net/xml/fbx/flexray"
xmlns:ho="http://www.asam.net/xml" xmlns:ni="http://www.ni.com/xnet"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
I've recently been tasked with porting a large codebase of C++ code to XNA, specifically .Net v4 Client Profile. My hope was to use C++/CLI rather than translating all the code to C#, but in my feasibility tests, it looks like you can't reference non-XNA projects from XNA, and there's no way to create a C++/CLI XNA project.
I've set the...
I have a function that I want to use as an event handler:
void singleFrameEventHandler(void) {
SetEvent(g_hSingleFrameArrived);
}
However, when I try to register for the event:
iaframe->OnNewFrame += gcnew newFrame(&singleFrameEventHandler);
The following exception is raised:
An unhandled exception of type 'System.NotSuppor...
Hello
I know that the C++/CLI code
void foo(Bar^% x);
transforms into
Void foo(ref Bar x);
What is the C++/CLI code that becomes
Void foo(out Bar x);
?
...
class array {
int * ptr ;
int length ;
void realloc (int) ;
public :
// all public functions declarations
};
and the main( ) function :
int main( )
{
const int dim = 5 ;
array a;
a.initialize(dim);
a.print();
for ( int I = 0; I < a.get_length() ; i++)
a.store(i , i);
a.print();
a.increment();
a.append(6);
a.print();
a.reve...
Alright, I know how you normally would declare a pointer:
void SomeFunction(array<float> ^managedArray)
{
pin_ptr<float> managedArrayPtr = &managedArray[0];
}
This works fine except when managedArray contains no elements. In that case, it throws an IndexOutOfRangeException.
In C# you can do this:
void SomeFunction(float[] managedA...
I have a class defined in C++/CLI as such:
literal Int32 BufferLength = 4000;
Message()
{
num1 = 0;
num2 = 0;
str1 = String::Empty;
buffer = gcnew array<System::SByte>(BufferLength);
};
[ProtoMember(1)]
property double num1
{
double get() { return _num1; }
void set(double value) { _num1 = value; }
}
[ProtoMember(2)]...
Is there any Visual C++ compiler for linux supporting most of VS Visual C++?
If there is no such what is best alternative for porting\adapting your visual C++ code to?
...
I am using Visual Studio 2005 where my code is a mix of C++-CLI and C#. I would like to be able to view the members of a BindingList at a breakpoint while debugging. Currently, I cannot find where the actual elements are stored via the watch browser. Is this possible?
...
Hello,
I am using Inline asm in C++/CLI. Horrible problem infact could be a bug I obsereved.
I passed vector from one function call to another. If I comment the whole code snippet of _asm{....some assembly code here} inside the called function where vector used which are provided to it from other function, then no problem whole vector...
Hi,
I need to work on converting a very huge c++ project to clr safe. The current c++ project has a lot of stuff from c++ like templates, generics, pointers, storage/stream, ole apis, zlib compression apis, inlines etc. Where can I find the datiled document for this type of conversion? Can you suggest some good book to refer to? If anyo...
I have a CLI/C++ based install application which needs to close another app I've written, replace the application's .exe and dlls and the re-run the executable.
First of all I need to close that window along the following lines:
HWND hwnd = FindWindow(NULL, windowTitle);
if( hwnd != NULL )
{
::SendMessage(hwnd, (int)0x????, 0, NULL...
Wanted for property grid, in the PropertyType function of the class derived from PropertyDescriptor, but I don't want an actual DateTime object - I'll just convert it to and from String in SetValue and GetValue.
...
I have a windows forms project. It has a main form derived from System::Windows::Forms::Form which I can open in designer without any problems. If I try and close designer though, it kills Visual Studio (v2008 with SP1).
The form includes a tab control which has pages with various System::Windows::Forms::UserControl derived forms. So I'...
I derived a class from ICustomTypeDescriptor, and in the GetProperties method I return a PropertyDescriptorCollection collection of CustomProperty. Here is the relevant part of my CustomProperty class: (i know it's a bit crude, but everything else works including the DateTime picker)
ref class CustomProperty : PropertyDescriptor
{
...
I've been trying to debug why closing windows forms designer is crashing visual studio and have discovered by adding a series of message boxes that if my controls are nested inside a System::Windows::Forms::TabControl the destructor of those controls are called twice.
Is that expected behaviour and is there a way of avoiding it?
...
I've been using the Concurrency Runtime in a C++ static library, and recently wanted to use this library in a C++/CLI project, to take advantage of the Windows Form designer and avoid MFC. Unfortunately, the Concurrency Runtime is not compatible with the /clr switch required in C++/CLI. I tried surrounding the included header files that ...
What are main difrences between * ^ and & in visual-C++ 2010?
...