c++-cli

Why doesn't Graphics::DrawImage stretch images as expected?

I'm making an overloaded TableLayoutPanel which draws some fancy borders, but for some reason the call to Graphics::DrawImage isn't working as expected. It seems to fade out my 1x10 pixel source image when I stretch it: This is the function which does the rendering: void GTableLayoutPanel::RenderSides(Graphics^ g, array<Drawing::Imag...

Why can't I load an image resource from my resx file?

I have a controls library which I've added a .resx file to (ImageResources.resx). It contains two .png images which I subsequently added. In that same library I have a control which loads a couple of images to do some custom drawing, but I don't seem to be able to load the resources: void GTableLayoutPanel::SetBorderImagesFromManifest(...

use stlport in managed c++

Is it possible to use stlport within a Managed C++ DLL? In my project i get several 'unresolved token'-errors from the linker for stlport stuff. e.g.: 1>moc_ParentWidget.obj : error LNK2020: unresolved token (0A000819) "public: __thiscall stlp_std::allocator<unsigned short>::~allocator<unsigned short>(void)" (??1?$allocator@G@stlp_std@...

Tracking - and correctly ending - native and managed threads in a C# - C++/CLI - C++ Windows forms application prior to exit

This is a follow-on from: http://stackoverflow.com/questions/3264245/debugging-a-multithreaded-c-c-cli-c-solution-in-visual-studio-2008-what Please excuse the format, I've just repeated some of the description of the application here: I've inherited a project consisting of three levels of code. The lowest layer is native C++ that inte...

what are the use of interfaces and diffrences with respect to interfaces

What are the major advantages of interfaces in designing application and the differences with respect to inheritance. can any body provide me with the brief example. ...

Unmanaged C++ template in managed C++ throws bad image?

I have a Managed C++ dll which dynamically links with an unmanaged C++ dll. The managed C++ derives several unmanaged classes from abstract interfaces in the unmanaged dll. This works fine. ---------- // uses macro __declspec(dllexport) class EXPORT_API ICustomer { public: virtual void PlaceOrder() = 0; // }; -----< LocalCustomer...

How can I provide a delegate in a managed interface class

Hello all, I am working on a project containing parts of C#, managed C++ as well as unmanaged C++ code. I am working with .NET 3.5. My programming experience lies more on the unmanaged C++ side an I am not that familiar with the concepts of .NET. My question is: How can I hide / provide a delegate behind a managed interface class. Su...

How to specify CppCodeProvider on command line of svcutil.exe?

I am trying to use svcutil to generate managed C++ code from XSD. The command line I am using is "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\xsd.exe" MyTest.xsd /classes /language:"Microsoft.VisualC.CppCodeProvider7, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /namespace:MyTestApp ...

Why switch expressions of type 'System::Guid' are illegal?

void Foo(Type^ type) { System::Guid id = type->GUID; switch (id) { case System::Byte::typeid->GUID: ... break; ... } Obviously case expressions are not constant. But I'd like to know why GUIDs cannot be known at compile time? (silly question I guess). At the end of the day it looks you have to use imbricated if the...

How would i use a C++/CLI dll that wraps native code with multiple dependent libraries in C#?

I am wondering how I would go about correctly setting up a C++/CLI library that wraps native c++ code that has several dependencies. I have tried both statically and dynamically linking the native library to its dependent libraries with no luck. The Managed C++/CLI dll builds just fine and can be added as a reference to a C# project....

What approach can I take to calling into a non c-style native c++ interface which from just the dll from .NET ?

I've been browsing the web for over 48 hours reading up on interoperability and playing around with Pinvoke and C++/Cli (very limited the latter). There is an unmanaged c++ api (a namespace containing a lot of exported structs which contain methods, all pure virtual and implemented across several cpp files as classes and what not) and I ...

Mixed mode assembly not loading symbol for native C++ pdbs

Hello, I am working with mixed mode assemblies in C++/CLI. All managed mode assemblies pdb's get loaded when successfully in mixed mode assembly. But native dll's pdb's not getting loaded even no information shown of native pdb in Modules pane (i.e in VS Debug->Windows->Modules). Note: I am using native dll and calling its exported fu...

Handling a Struct native to C# in C++.

Here is my call in C cli::array<mercurial::fileItem>^ tmp = mercFlowCLR::merc::getFolderList(gcnew System::String(remotePath)); Here is my C# Structure: public struct fileItem { public string fileName; public bool isFolder; } My getFolderList is returning of type in C#: List<mercurial::fileItem> The C++ DL...

C++/CLI: SIGFPE, _control87, _fpreset, porting ancient unmanaged Watcom C app to .NET

I have a several-thousand-line application that relies on SIGFPE (handled by a function pointer passed to signal()) to change state and have the code run correctly when certain floating point conditions happen. However, under C++/CLI in managed-mode, _control87 generates a System.ArithmeticException executing in a static lib written in ...

Powershell and enums defined in C++/CLI assembly

I have an assembly written in C++/CLI that contains a heap of enum defined like the following, one after the other in a single header file. namespace Fix { public enum class Side { SideBuy = '1', SideSell = '2' }; } I can reference these types in other C# projects, and in IronPython, I can reflect the assembly and see them a...

XmlSerializer throws InvalidOperationException when having a namespace prefix in the attribute

I try to read an XML file that contains the following element: <ho:CODED-TYPE ho:BASE-DATA-TYPE="A_UINT16" CATEGORY="STANDARD-LENGTH-TYPE" ENCODING="UNSIGNED"> My class to describe this node looks like that: public ref class FIBEXCodedType { public: [XmlAttribute("ho:BASE-DATA-TYPE")] property String^ BaseDataType; [XmlAttr...

Issue with Includes, Visual Studio 2008

Okay, here's my issue (and my first question on SO!), and no, as much as i would like, i don't have a lot of say in how things are structured. One of those inherited farms that management won't let me change too much. I'm in Visual Studio 2008 in a WinForms solution. My solution contains 5 Visual C++ Projects, some managed, some nativ...

C++/CLI interface class vs. interface struct

What is the difference between the following declarations (in C++/CLI): public interface class IC {}; public interface struct IS {}; Similar situations: public enum class EC {}; public enum struct ES {}; ? ...

HashMap : Dealing with Managed objects C++

Hi, I guess it's kind of a stupid question but here is my problem : I want to have a hash_map<int, Object^> as an attribute of my object BigObject, which is written in managed C++. So I have to declare a pointer, hash_map<int, Object^>* hash because I cannot declare explicitely native object in managed code. How can I insert an objec...

where can i declare class obj

i have windows form app 2 text box1,2 2 button1,2 i have class person {have get, set (string ,int)} and i want to declare person p; to see it in both two push button1,2 my problem is i declare person p; inside buttons when buttons end p.~person();is called so i cant save value and when i call p.get i get initial value code private: S...