managed-c++

Creating a System::String object from a BSTR in Managed C++ - is this way a good idea???

My co-worker is filling a System::String object with double-byte characters from an unmanaged library by the following method: RFC_PARAMETER aux; Object* target; RFC_UNICODE_TYPE_ELEMENT* elm; elm = &(m_coreObject->m_pStructMeta->m_typeElements[index]); aux.name = NULL; aux.nlen = 0; aux.type = elm->type; aux.leng = elm->c2_length; aux....

how to put a pin_ptr into a generic list?

I've got a managed C++ method that takes as a parameter a list of String^ the method needs to populate an unmanaged structure with pointers to the memory in the String^ extracting the WCHAR* is simple enough with PtrToStringChars however I dont know the number of pin_ptr's to allocate at design time I'd like to add the pinned ptr to ...

Keeping VB.NET vs learning C++

EDITED... I posted a similar question about VB and C#. The question here is slightly different, considering the differences between VB.NET and C++ are greater than those between VB.NET and C#. Do I stick with my sort-of working knowledge of VB.NET and learn it thoroughly or skip to C++? EDIT 2: I am familiar with Actionscript syntax...

converting Byte to bit..

I am currently working on visual c++ 2008 express edition. My project is based on reading satellite images and applying image processing on them. Each image file has an ".0FM" format and is of 8Mb size. Until now I have been able to read the file (i.e., "*.0FM" ) using a FileStream and into a Byte array, the size of the byte array is 8...

How do I build BugTrap?

I am trying to build the Intellesoft BugTrap source using Visual Studio 2008. I have downloaded and unziped the BugTrap source and the zlib source. I navigated down to ./BugTrap/Win32/BugTrap and opened BugTrap.sln (suggest by the author here). I used Build->Build Solution and the build failed with a compiler error: fatal error ...

What is the difference between Managed C++ and C++/CLI?

What is exactly the difference between the "old" Managed C++ and the "new" C++/CLI? ...

ASP.Net 2.0 Web application cannot find specified module.

Recently my ASP.NET application quit working. It is local to my machine. It quit working after installing and uninstalling some third party developer tools. (I believe) I emptied out my directory and started adding modules until I narrowed it down to a managed C++ dll. When I load the dll into Dependency Walker it says that "c:\windows...

How to GetGuiResources for all system processes?

Hello, I need to measure all used GDI objects in a Windows xp system. I found a GetGuiResources(__in HANDLE hProcess, __in DWORD uiFlags) method (with the GR_GDIOBJECTS flag). I call it for the process which I get from the method GetCurrentProcess() defined in WinBase.h. I don't know how to call it for other system processes, which ...

Are Inherited Forms And/Or Inherited Controls possible in Managed C++

Hello everyone The question is actually pretty self explanatory but I will further clarify it. I am building a simple application to show a load [file] for 5 different types of [files]. So all these 5 forms will have similar GUI elements such as a listbox and a load button with a small textbox/label to show the summary of the [file]'s ...

Managed c++ cross threading

I got a thread: static void TestThread(System::Object ^obj) { Bot ^ob = (Bot^) obj; while( ob->Threads[0]->IsAlive ){ ob->textBox->text = "test"; // Cross threading error... Thread::Sleep(100); } } Dont know what to do i read about InvokeRequired and Invoke but didnt understand it.. Please...

Intellisense broken in 64 bit Windows when using mixed-mode (i.e. managed C++) assemblies

This is annoying more than anything, but I have no working Intellisense when I use any of my custom web controls in .aspx/.ascx pages. Intellisense in standard <asp:...> controls are fine, as it is in all code-behind files etc. I'm pretty sure this is caused by Visual Studio attempting to analyse the website's bin folder for custom web ...

How do I get started writing a .Net-wrapper around C++ Omniorb-stubs

Hello there, my job is to access a CPRBA-server-application from .NET 3.5. After evaluating projets like IIOP.Net (undefined state) and products like VisiBroker (expensive) I'd like to do it "by myself" and write a .Net-Wrapper around C++-Stubs generated my Omniidl (the Omniorb IDL to C++ generator). This means writing some kind of laye...

WTSVirtualChannelRead Only reads the first letter of the string.

I am trying to write a hello world type program for using virtual channels in the windows terminal services client. public partial class Form1 : Form { public Form1() { InitializeComponent(); } IntPtr mHandle = IntPtr.Zero; private void Form1_Load(object sender, EventArgs e) { mHandle = NativeMet...

Managed C++ Error 2504 Error

I'm new to managed c++ and I'm attempting to design a program for a presentation. I am attempting to have a class inherit from an ABC and I'm getting the Error C2504. The code in question is as follows: ref class Item : Auction //Error C2504 here { //More code for the class Auction is defined in a different .h file. Let me know if the...

Unmanaged Struct Instance in Managed Class

Hi, I've got a fairly specific problem i've been struggling with for a couple of days. I'm using a native C++, one of the methods takes a ptr to a struct containing fixed size char arrays. e.g. struct userData { char data1[10]; char data2[10]; }; method: short AddItem(long id, userData* data); I'm trying to call to c...

Close if no active threads, or if any active, then wait till it's complete and close

My application overview is ASP.Net webservice entertains requests from various applications for digital signing and verification via a client. The webservice will then route these requests to a smart card When the system date changes, I want the following to happen. New request from the clients are made to wait Current work between...

Problems upgrading VS2008 to VS2010 with Managed and Unmanaged C++

I have a VS2008 Professional solution that I tried to convert to VS2010 Professional (RTM from MSDN download) today and I am experiencing some problems with some unmanaged and managed C++ DLLs that are referenced by a C# application. The C# application is set to target .NET 3.5 (as it was in the VS2008 version) but when I try and compil...

Performance of C++ calls to Java code vs C# code

I am exploring a solution at my client where we have to call an API that is available in both C# and Java from our C++ application. We would like this to be a cross platform application (PC & Mac), so Java is preferred, but performance is more important. I've been trying to do some research on the performance of C++ calls to C# vs Java...

Are there any code analysis tools that will make my job easier?

I have recently inherited a program written in Managed C++ from some guy who just retired. After spending some time digging through it, I can honestly say that at least 95% of it belongs on thedailywtf. However, I am now tasked with modifying it and porting it over to a language I'm comfortable with. The program itself takes in many m...

BadImageFormatException when using native DLLs from ASP.NET

Hi Iam referencing in my ASP.NET application a managed C++ project which makes use of a native dll named "libmmd.dll". If I run the ASP.NET application with visual studio I get an BadImageFormatException which tells me "The module was expected to contain an assembly manifest" (translated from german). What is the preferred way to includ...