unmanaged

Does VB6 have linq expressions?

I'm arguing with one guy about linq in visual basic.He shows linq expressions in vb,but I can't be sure if it's managed or unmanaged(vb6),because I've never used any of them. Does VB6 have linq expressions? ...

How to run unmanaged executable from memory rather than disc

I want to embed a command-line utility in my C# application, so that I can grab its bytes as an array and run the executable without ever saving it to disk as a separate file (avoids storing executable as separate file and avoids needing ability to write temporary files anywhere). I cannot find a method to run an executable from just it...

Register a C# COM component?

I have developed a C# com component which I am using from managed c++. On my dev machine when everything works fine. However when I distribute the files, I received an error that the component has not been registered. When I try a regsvr32 on the dll it gives me an error (C# dlls cannot be registered). How do I properly register this COM...

coclass in .idl import interface defined elsewhere?

I have an IDL file that defines a few interfaces followed by a coclass. Can I make this class import interfaces that are not defined in this class? ...

Pass Bitmap object to unmanaged code

I have the following function in C++ managed (ref) class: public static void Transform(Bitmap^ img); I want to call it from C# managed code. What I do is this: Bitmap image = new Bitmap(100, 100); MyClass.Transform(image); Is this correct, or do I need to use fixed statement? If so, then how? Thank you. ...

How do I check the destination that a socket is connected to?

If,for example,The socket in my compiled application is designed to connect to 123.456.789.0. How do I check if its connected to 123.456.789.0? Is there a way to do this? The idea is this:I want to prevent other people editing my program and changing the address to,for example, 127.0.0.1 and make it connect through a proxy. Is there a...

Marshaling a pointer to an array of types (managed C# -> unmanaged C++)

I am having some trouble settling on a way to represent a structure that contains a pointer to an array of shorts in my managed code. The struct looks like this: typedef struct { short size; unsigned short** shortValues; } UnmanagedStruct; memory for 'shortValues' is allocated inside unmanaged code -- therefore even though th...

Marshaling pointer to an array of strings

I am having some trouble marshaling a pointer to an array of strings. It looks harmless like this: typedef struct { char* listOfStrings[100]; } UnmanagedStruct; This is actually embedded inside another structure like this: typedef struct { UnmanagedStruct umgdStruct; } Outerstruct; Unmanaged code calls back into managed co...

Find out what a random number generator was seeded with in C++

I've got an unmanaged c++ console application in which I'm using srand() and rand(). I don't need this to solve a particular problem, but was curious: is the original seed passed to srand() stored somewhere in memory that I can query? Is there any way to figure out what the seed was? ...

Unmanaged memory and Managed memory

what exactly these unmanaged and managed memory is? can anybody explain me in brief? ...

Using C# extension methods from managed C++/CLI

Forgive me if my terminology is a little off. My knowledge of managed C++/CLI is very limited. I have an MFC application that uses a dll with the /clr option enabled. This dll uses a couple of C# dlls to communicate with a server using WCF. For the most part this works fine. In one of the C# dlls, I've added an extension method to t...

Marshaling a Byte array to a C# structure.

Hello, I'm working on a C# project for reading FAT32 Boot Sector and BPB, The problem is that I'm using a marshaling mechanism to convert a byte array to a Custom FAT32 data structure. I get a message error saying : Could not load type 'FAT32Management.Fat32BootSector' from assembly 'FAT32Management, Version=1.0.0.0, Culture=neutral, Pub...

Unmanaged base class with Managed subclass

Is it possible to have: A pure abstract class (basically an interface) in (unmanaged) C++ Have managed implementations of this class in <insert .net language of your choice> Consume these managed implementations from (unmanaged) C++ Using SWIG or some C++/CLI glue? ...

How can I in C# stream.Read into unmanaged memory stream?

I can read unmanaged memory in C# using UnmanagedMemoryStream, but how can I do the reverse? I want to read from a managed stream directly into unmanaged memory, instead of first reading into a byte[] and then copying. I'm doing async stream reading on a large number of requests, so the added memory is significant (not to mention the a...

Memory usage of DotNET app

My application (DotNET) runs as a plug-in inside a C++ standalone app that exposes a C++/CLI SDK. It is very easy for my users to generate large amounts of data and I'd like to offer an abort option if the memory consumption of my plug-in + the base application reaches -say- 90% of the legal maximum. How can I measure the total memory ...

How can I use Enum::GetName in unmanaged C++

I am using managed extensions in VS 2008 I want to print the name of an en enum value This code used to be fine VS 2003 Enum::GetName(__typeof(COMMAND_CODES),__box(iTmp)) but now I get a comile error here is my enum typedef enum { /* Command codes */ UMPC_NULL = 0, } COMMAND_CODES Any clues ? ; ...

Class Not Registered.... when trying to call a managed C# library from unmanaged C++

Hey everyone, I have a C# library that I am using for a COM object in unmanaged C++ code. I registered the library using Visual Studio's checkbox "Register For Com Interop" and set ComVisible to true. imported the tlb to the C++ app..... when I run it, I get a "Class Not Registered".... This has worked before, but this started happen...

Scheduled Task Communication (using ITask interface)?

Is there anyway using the ITask interface to communicate with a scheduled task? I have tasks that users can cancel, pause, etc and a main console that displays information about the tasks. Right now I can only tell if they are running or not via the GetStatus method. What I would like to do is connect to the task and pass a string (poten...

How do I tell what an UnsafeNativeMethods.DispatchMessageA call is doing using windbg?

I have tracked down my deadlock to this thread not pumping messages anymore, but how do I take it one step further and figure out what the thread is currently doing? I'm using windbg and random walks using !do hasn't given me anuthing so far many thanks Oskar 0:057> !clrstack OS Thread Id: 0x17f8 (57) ESP EIP 1393f1ac 2070a...

Unmanaged C++ Unit testing in Visual Studio 2008

I want to create a managed C++ unit test project to test an unmanaged MFC project. I have read msujaws's procedural and followed it. I implemented a test method to test the return string of a function like so: #include "stdafx.h" #include "TxStats.h" #include <cstdlib> #include <atlstr.h> #pragma managed #using <mscorlib.dll> #using <...