Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

bassdscho

Alter Hase

  • »bassdscho« ist der Autor dieses Themas

Beiträge: 1 056

Wohnort: Heuchlingen

Beruf: Student - Technische Informatik

  • Private Nachricht senden

11

28.08.2005, 11:42

Bei mir gibts die C++ beispiele nicht. ich hab das kapitel schon gefunden, aber nur mit C# un VB code. Ich hab mir auch extra das SDK von d MS Seite nochmal runter geladen aber da fehlen wieder die C++ Cde beispiele.
Wegen den Einstellungen, ich hab halt ein neues Projekt angelegt vom Typ "Windows Forms Application". Was muss ich da noch extra Einstellen?
Verlierer jammern immer von wegen ihr bestes!
Sieger gehen nach Hause und vögeln die Ballkönigin!

Dave

Alter Hase

Beiträge: 757

Wohnort: Berlin

  • Private Nachricht senden

12

28.08.2005, 15:14

du musst in deinen projekteinstellungen angeben, dass du managed code erzeugen willst. velches visual c++ verwendest du?
das könnte hilfreich sein: http://www.ondotnet.com/pub/a/dotnet/2003/03/03/mcppp.html, http://www.ondotnet.com/pub/a/dotnet/2003/03/03/mcppp2.html

außerdem steht zu dem thema ne menge in der msdn. kleiner auszug:

Zitat


For .NET Programming, C++ supports the creation of three distinct types of components and applications: mixed, pure, and verifiable. All three are available through the /clr (Common Language Runtime Compilation) compiler option. Depending on the sub-setting used, the resulting assembly (.exe or DLL) has distinct qualities, abilities, and restrictions. This topic discusses the merits of each type.

Mixed (/clr)
Mixed assemblies (compiled with /clr), contain both unmanaged and managed parts, making it possible for them to use .NET features, but still contain unmanaged code. This allows applications and components to be updated to use .NET features without requiring that the entire project be rewritten. Using C++ to mix managed and unmanaged code in this fashion is called C++ Interop. For more information, see Mixed Assemblies and Native and .NET Interoperability.

Pure (/clr:pure)
Whereas mixed assemblies (compiled with /clr) excel at interfacing with unmanaged code, pure assemblies excel at interfacing with .NET code. Pure assemblies (compiled with /clr:pure) can contain both native and managed data types, but only managed functions. Like mixed assemblies, pure assemblies allow interop with native DLLs through P/Invoke (see Using PInvoke in C++), but the C++ Interop features described in Using C++ Interop Features are not available for pure assembiles. Moreover, pure assemblies cannot export functions that are callable from native functions. This is because the entry points in a pure assembly use the __clrcall calling convention, which native functions cannot invoke. For guidance on porting code to pure MSIL compilation, see How to: Migrate to /clr:pure.

Advantages of /clr:pure
Better Performance: Because pure assemblies contain only MSIL, there are no native functions, and therefore no managed/unmanaged transitions are necessary. (Function calls made through P/Invoke are an exception to this rule.)


AppDomain Awareness: Managed functions and CLR data types and exist inside Application Domains, which affects their visibility and accessibility. Pure assemblies are domain-aware (__declspec(appdomain) is implied for each type) so accessing their types and functionality from other .NET components is easier and safer. As a result, pure assemblies interoperate more easily with other .NET components than mixed assemblies.


Non-disk loading: Pure assemblies can be loaded in-memory and even streamed. This is essential for using .NET assemblies as stored procedures. This differs from mixed assemblies, which, due to a dependency on the Windows loading mechanisms, must exist on disk in order to execute.


Reflection: Because mixed assemblies must be loaded the Windows loading system, and multiple executables cannot be loaded into the same process, using reflection (the programmatic discovery and/or creation and invocation of types in external assemblies) on mixed assemblies is limited. For example, it is not possible to reflect over mixed executables. In contrast, pure assemblies provide full reflection support.


Host Controllability: Because pure assemblies contain only MSIL, they behave more predictably and flexibly than their mixed counterparts when used in applications that host the CLR and modify its default behavior.


Limitations of /clr:pure
This section covers features and functionalities that are not supported by /clr:pure in this release for Visual Studio .NET.

Pure assemblies cannot be called by unmanaged functions. Therefore pure assemblies cannot implement COM interfaces or expose native callbacks. Pure assemblies cannot export functions via __declspec(dllexport) or .DEF files nor can they import functions via __declspec(dllimport), as these mechanisms are require unmanaged code. Functions in a native module can be called from a pure assembly, but pure assemblies cannot expose native-callable functions, so exposing functionality in a pure assembly must be done through managed functions in a mixed assembly. See How to: Migrate to /clr:pure for more information.


ATL and MFC libraries are not supported by pure mode compilation in Visual C++ 2005.


Pure netmodules are not accepted as input to the C++ linker. For C++, this is a minor problem, since pure OBJ files are accepted by the linker, and OBJ files contain a superset of information contained in netmodules.


Global (per AppDomain) data is not supported in pure assemblies


Compiler COM support (#import) is not supported, as this would introduce unmanaged instructions into the pure assembly.


Floating point options for alignment and exception-handling are not adjustable for pure assemblies. As a result, __declspec(align) cannot be used. This renders some header files, such as fpieee.h, incompatible with /clr:pure.



Verifiable (/clr:safe)
The /clr:safe compiler switch generates .NET-enabled assemblies and applications like those written in Visual Basic and C#. These assemblies conform to requirements that allow the common language runtime (CLR) to guarantee that the code does not violate current security settings and--that if the code fails--it does so gracefully. Verifiable components allow the CLR, at run time, to determine if the code safely satisfies the security restrictions currently in effect. For example, if the current security settings prohibit the component from writing to disk, the CLR can determine whether a given verifiable component meets this criterion before executing any of the code. There is no CRT support for verifiable assemblies. (CRT support is available to pure assemblies through a Pure MSIL version of the C Runtime library.)

Verifiable assemblies offer these advantages over pure and mixed assemblies:

Increased security.


Some situations require it (SQL components, for example).


Future versions of Windows will increasingly require components and applications to be verifiable.


The downside is that no interop features are available. Verifiable assemblies cannot contain any unmanaged functions or native data types, even if they are not referenced by the managed code.

For more information about verifiable assemblies, see:

How to: Migrate to /clr:safe


How to: Create Verifiable C++ Projects


Using Verifiable Assemblies with SQL Server


Note: Despite the use of the word "safe", compiling applications and components with /clr:safe does not mean that they are bug free; it just means that the CLR can verify the security settings at run time.

Note: Regardless of assembly type, calls made from managed assemblies to native DLLs via P/Invoke will compile, but may fail at runtime depending on the security settings in effect.



lade dir einfach die visual c++ 2005 express edition runter und installier die msdn mit. da steht ne menge zu drin.

bassdscho

Alter Hase

  • »bassdscho« ist der Autor dieses Themas

Beiträge: 1 056

Wohnort: Heuchlingen

Beruf: Student - Technische Informatik

  • Private Nachricht senden

13

29.08.2005, 21:35

wo hast du denn dein SDK her? ich hätte auch gerne das wo überall auch c++ beispiele dabei sind.
Verlierer jammern immer von wegen ihr bestes!
Sieger gehen nach Hause und vögeln die Ballkönigin!

rewb0rn

Supermoderator

Beiträge: 2 773

Wohnort: Berlin

Beruf: Indie Game Dev

  • Private Nachricht senden

14

29.08.2005, 23:22

hm versuchs vielleicht mal bei der installation mit custom, da kannst du genau auswählen welche beispiele du willst (bei den alten versionen zumindest)

Dave

Alter Hase

Beiträge: 757

Wohnort: Berlin

  • Private Nachricht senden

15

30.08.2005, 18:25

Zitat von »"bassdscho"«

wo hast du denn dein SDK her? ich hätte auch gerne das wo überall auch c++ beispiele dabei sind.


wie gesagt ist das aus der 2005er msdn. wenn du dir eine der visual 2005er express beta-versionen herunterlädst, kannst du optional auch die msdn installieren, welche bei allen verisionen die gleiche ist und beispiele für alle sprachen enthält...
schau mal hier

Werbeanzeige