Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

bollwerj

@bollwerj
About
Posts
7
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • conversion form String type to int type
    B bollwerj

    ADARSH Try int x = Convert::ToInt32(str); or int x = Convert::ToInt16(str); Convert has several conversions available. Cheers John

    Managed C++/CLI xml help question

  • STRING* to LPTSTR
    B bollwerj

    Nik Thanks for the tip Actually, the only method that worked for me was method 2. Method 3 would not compile. The include altstr.h produced IServiceProvider error. Method 1 compiled OK, but I had to use a LPSTR cast to get it to compile. However, it produced a number (34") regardless of the value of the String* that I fed it. Perhaps there are ways to get methods 1 & 3 to work, but I don't know enough about .Net to figure out how. Cheers and best wishes in your PhD effort. John

    Managed C++/CLI question

  • STRING* to LPTSTR
    B bollwerj

    Dirk, Thanks for the response. I seem to be a bit thick headed, I don't understand what you are suggesting. What data type is pStr? The compiler does not recognize GetBuffer as a member of LPTSTR or of .Net String class. It is a member of .Net MemoryStream class. How do you propose that I do this? What I am doing now to convert a String* variable named line to a LPTSTR (char*) is: char* chars = new char[line->length+1]; for (register i = 0; i < line->length; i++) { chars[i] = (char)line->Chars[i]; } //Add the NULL at the end chars[line->length] = '\0'; The above seems to work but it just seems like a lot of processing to just convert from one data type to another. I'm thinking that there must be a more straightforward way. Thanks John B

    Managed C++/CLI question

  • STRING* to LPTSTR
    B bollwerj

    Anyone know a simple way to convert a String* variable to a LPTSTR variable?

    Managed C++/CLI question

  • ListView Item Selection Problem
    B bollwerj

    Here is what seems to be happening: The first time an item is selected, the SelectedIndexChanged event is called and a SelectedListViewItemCollection is returned containing the selected item. Subsequent item selections seem to cause the SelectedIndexChanged event to be fired TWICE, the first time returning an empty collection but the second time returning selected items. Is this the way it is supposed to work??????? John B:confused:

    Managed C++/CLI help question

  • ListView Item Selection Problem
    B bollwerj

    Problem is in getting the selected item in a ListView. The view property is Details and MultiSelect is set to false. listView Here is the code I use: Void Form1::lvMain_SelectedIndexChanged(System::Object * sender, System::EventArgs * e) { ListView::SelectedListViewItemCollection* lvc = lvMain->get_SelectedItems(); IEnumerator* ie = lvc->GetEnumerator(); ie->MoveNext(); ListViewItem* lvi = __try_cast(ie->Current); . . . } The first time a selection is made in the listbox by clicking on an item, the selected item is returned in the SelectedListViewItemCollection which has a count of 1. without a problem. HOWEVER, the next time an item is clicked, the SelectedListViewItemCollection that is returned has a count of 0. Naturally, attempting to move the iterator causes an exception to be thrown. Does anyone know why nothing is returned in the SelectedListViewItemCollection when the selection is changed the second time??? Also, what is the solution??? Appreciate any help. John B

    Managed C++/CLI help question

  • Messageboxes in managed C++
    B bollwerj

    Had the same problem and found the solution in one of Microsoft's articles. At the beginning of the.cpp file, after the includes, I put the following: #ifdef MessageBox #undef MessageBox #endif The problem seems to be caused by a confliction in MessageBox declarations between the .Net declaration and the one in the windows.h file. Cheers

    Managed C++/CLI c++ visual-studio tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups