Skip to content

Managed C++/CLI

Discussions on Managed Extensions for Visual C++ .NET

This category can be followed from the open social web via the handle managed-c-cli@forum.codeproject.com

4.4k Topics 14.9k Posts
  • c++

    c++ help
    5
    0 Votes
    5 Posts
    3 Views
    Richard DeemingR
    DON'T SHOUT! :mad: Typing everything in upper-case on the Internet is considered extremely rude. This is now the second time you've posted exactly the same instruction - presumably from your homework assignment - in this forum. Whilst the unpaid volunteers who answer questions here will be happy to help if you encounter a specific problem with code you've written, nobody here is going to write your code for you. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Is C++/CLI also open source with the new open source .Net?

    csharp c++ question
    5
    0 Votes
    5 Posts
    3 Views
    L
    :thumbsup: You can lead a developer to CodeProject, but you can't make them think. The Theory of Gravity was invented for the sole purpose of distracting you from investigating the scientific fact that the Earth sucks.
  • Add a dll file to using VC++ and use its functions

    csharp c++ dotnet com help
    2
    0 Votes
    2 Posts
    2 Views
    Richard Andrew x64R
    The error message is telling you the reason. The DLL created in VC6 is not a .NET assembly. If you want to use it in your project, you will have to use P/Invoke. EDIT: Since this is the C++/CLI forum, I forgot to mention that you can also call the DLL functions directly from C++. But there is no way to add it as a .NET reference. The difficult we do right away... ...the impossible takes slightly longer.
  • c++

    c++ help
    2
    0 Votes
    2 Posts
    2 Views
    OriginalGriffO
    Did you mean to post this here? If it's intended as a comment to an existing message, then use the "Reply" feature, not "New Message" - that way the conversation "flows" and the person you are replying to gets an email to let them know (just like you did to this comment) Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
  • Is there any change to C++\CLI is Visual Studios 2012 and beyond?

    c++ question
    2
    0 Votes
    2 Posts
    2 Views
    L
    Check the Microsoft documentation: https://msdn.microsoft.com/en-us/library/aa187916.aspx[^].
  • delete all label in windows form CLI

    question tutorial
    12
    0 Votes
    12 Posts
    4 Views
    L
    I have not tried this but you should be able to use the GetType method[^] and compare it against the same result from a known object of that class, something like: Label ll = new Label(); if (control.GetType() == ll.GetType()) // ...
  • remove all label in windows form c++

    question c++
    2
    0 Votes
    2 Posts
    2 Views
    L
    You can iterate through all the controls on the form and check their type, thus identifying the labels. You can then decide whether to remove them or not.
  • 0 Votes
    4 Posts
    2 Views
    S
    XOR swap algorithm[^] X := X XOR Y Y := X XOR Y X := X XOR Y But you cannot do this with pointers as compiler does not allow XOR operation on pointers, you have to cast pointer to integer(32bit ptr to 32bit integer and 64bit ptr to 64bit integer) beforehand. This is a favourite interview question among some interviewers (who apparently read the same interview book).
  • How do I convert an .mp3 file to an .sty (style file) - C/C++?

    question c++ help
    2
    0 Votes
    2 Posts
    3 Views
    L
    What have you tried and where are you stuck?
  • 0 Votes
    3 Posts
    5 Views
    Richard Andrew x64R
    Thanks for posting the result. This is valuable information. :) The difficult we do right away... ...the impossible takes slightly longer.
  • Convert From c# - For Report Viewer Report save as PDF format

    csharp c++
    4
    0 Votes
    4 Posts
    2 Views
    P
    THANKS:thumbsup:
  • OOP - Error | Unhandled exception at 0x0FD2CCC8 (msvcp110d.dll)

    c++ ios help
    2
    0 Votes
    2 Posts
    2 Views
    L
    1. This does not look like managed code. 2. Please use <pre> tags round your code to make it more readable. 3. What is the structure of the teacher type? 4. How is the data file created? 5. What does the Display method do?
  • Inheritance tricky question

    question c++ oop help
    4
    0 Votes
    4 Posts
    4 Views
    S
    Hi Amrit, I'll try to explain it with some diagrams. First, the simple case - you probably know this, but I'll show it for completeness. The class Foo has a single member of type int (int32), so it has a size of 4 bytes. # 3 instances of Foo in memory with a Foo* pointer pointing to it: Foo myFoo[3]; // in _tmain(..) Foo* ptr = myFoo; // calling display(..) (I renamed *obj to *ptr here) ptr ptr+1 ptr+2 // the loop in display(..) (100) (100+4) (100+8) | | | v v v Memory address: 100..103 104..107 108..111 // (artificially chosen address) Instance: --Foo1-- --Foo2-- --Foo3-- Members: ---i---- ---i---- ---i---- Now with the class Bar (8 bytes) and your original approach: # 3 instances of Bar in memory with a Foo* pointer pointing to it: Bar myBar[3]; // in _tmain(..) Foo* ptr = myBar; // calling display(..) ptr ptr+1 ptr+2 // the loop in display(..) (100) (100+4) (100+8) // here's why it doesn't work: | | | // ptr is Foo* so ptr+1 still means adding the size of Foo (4) ! v v v Memory address: 100........107 108........115 116........123 Instance: -----Bar1----- -----Bar2----- -----Bar3----- Members: ---i---___j___ ---i---___j___ ---i---___j___ Value: 0 1 0 // and there's your strange output! ;-) And now with pointers to pointers. Let's say we're on a 32bit-system here, then a pointer has the size of 4 bytes (32 bit). So, when doing pointer arithmetic with pointers to pointers, adding 1 means always increasing its pointed-to-address by 4 bytes. It doesn't have anything to do with the size of the class that's being pointed to by the pointer that's being pointed to :-D # 3 instances of Bar in memory with a Foo** pointer pointing to Bar* pointers: Bar myBar[3]; // in _tmain(..) Foo *myBaz[3] = { &myBar[0], &myBar[1], &myBar[2] }; Value: 100 108 116 Foo** pptr = myBaz; // calling display2(..) (for clarity, I named it pptr here) pptr pptr+1 pptr+2 (200) (200+4) (200+8) // see explanati
  • Enabling ListControl pane in MFC (C++)

    c++ tutorial
    2
    0 Votes
    2 Posts
    2 Views
    L
    That sounds like a bit more that a 'simple' window. What type of control is in each pane?
  • english language implementation

    c++ com help question learning
    2
    0 Votes
    2 Posts
    2 Views
    M
    All the resource files and dlls are changed to English but cannot find the reason of displaying the Chinese language. Peer.rc code is now that compiles fine. #ifdef string ID IDS_ENUMSTRTEST#error Microsoft Visual C++ #endif //APSTUDIO_INVOKED Thanks
  • multiple

    question
    2
    0 Votes
    2 Posts
    3 Views
    L
    You cannot, unless you create the directories across different root paths. In any directory each file name must be unique.
  • 0 Votes
    2 Posts
    2 Views
    L
    Your declaration of the producer function, does not match the definition required by pthread_create, see http://man7.org/linux/man-pages/man3/pthread_create.3.html[^].
  • how to migrate CORBA to Web Service in C++

    c++ java wcf sysadmin business
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • int **p = (int**)new int(5); Confusing !!!

    help question
    3
    0 Votes
    3 Posts
    3 Views
    Z
    here, p is a pointer to int*.that means p can point to an int pointer and that pointer will point an int type of data. when you do this , (int**) new int (5) ; you are actually forcing (casting) p to point to an int pointer (memory address) with value 5 ..(It actually should not be done because you don't know anything about memory address 0x5 )... however and as you made p to store something(a memory address with value 5) you also allocated memory for that purpose ...... and the typecasting was necessary as first case is very different than the second case.... in the second case --- ap is an int pointer and with new command you allocated 4 bytes of memory for ap .. and ap is now pointing to that memory location and as you passed 20 in the constructor so now that memory address is storing 20.... But, p is not an int pointer ..it's a pointer to int pointer ...so it should be passed a valid memory address in the constructor call .. not an int(what you did -- by passing 5)..that's why you had to cast... and the answer to your last question is ... p is just a pointer (it maybe a pointer to another pointer but it still is a pointer)..and when we want to know what value a pointer is pointing to we put * (deference op.) before that pointer (only once)! Hope,you got that :-D
  • solitaire game

    help c++ game-dev data-structures question
    2
    0 Votes
    2 Posts
    2 Views
    L
    That is not a simple question to answer in a forum like this. You should start with a couple of classes: Card - contains properties such as value and suit. Player - contains a List of cards. Some general methods: A randomiser that deals the cards around. Play that selects a card and figures out where it can be placed etc. Quite a lot to think about before you start coding, or worrying about the UI.