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

Bo Hunter

@Bo Hunter
About
Posts
152
Topics
34
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • exporting global operator+ function from DLL
    B Bo Hunter

    Is the __declspec( dllexport ) hard coded in the header? If so you might try forward declaring the prototype with dllimport and try that. Thank You Bo Hunter

    C / C++ / MFC csharp c++ json question

  • const type;
    B Bo Hunter

    Is it possible to find out if a type was declared const? Thank You Bo Hunter

    C / C++ / MFC question

  • Memory Management across DLLs
    B Bo Hunter

    I am with you on this. The guideline that I go by. objects that are instantiated inside a dynamically loaded library must be deleted inside the same library. If the object is deleted inside the program itself, the results are unpredictable. It may work fine, or it may cause a memory leak or even a program crash. If your program redefines new or delete, a program crash is almost guaranteed. Thank You Bo Hunter

    C / C++ / MFC question c++ performance help announcement

  • Compiling MSIL and c#
    B Bo Hunter

    Will ILASM not work? Thank You Bo Hunter

    C# csharp question

  • caveats when using _malloc_dbg
    B Bo Hunter

    the docs on msdn say that you must use _free_dbg. Thank You Bo Hunter

    C / C++ / MFC question

  • can't use "new" with gdiplus objects
    B Bo Hunter

    I beleave that this will do everything you need. #pragma push_macro("new") #undef new #include #pragma pop_macro("new") Thank You Bo Hunter

    C / C++ / MFC help graphics

  • Bits;
    B Bo Hunter

    That is exactly what I needed. Thank You Bo Hunter

    C / C++ / MFC question

  • Bits;
    B Bo Hunter

    I have used a bit mask before but how does one extract individual bits. Say I wanted to extract bit 28 from 32 bit int, how do I do that? Thank You Bo Hunter

    C / C++ / MFC question

  • How to access Radio Button with just ID
    B Bo Hunter

    Check out CheckRadioButton api on msdn. Thank You Bo Hunter

    C / C++ / MFC tutorial question

  • Diffrence between VC++ and managed
    B Bo Hunter

    IL is compiled to native code before it is executed. It is not like java byte code that is interpreted. Thank You Bo Hunter

    Managed C++/CLI c++ question

  • C++/CLI Array problem
    B Bo Hunter

    I believe mscorlib.dll is the only automatic import, but I have been wrong before. Thank You Bo Hunter

    Managed C++/CLI c++ help data-structures beta-testing question

  • disable the Task manager
    B Bo Hunter

    This is what I use to disable the task manager during games and such. Regsitry Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System Key DisableTaskMgr Thank You Bo Hunter

    C / C++ / MFC tutorial

  • C++/CLI Array problem
    B Bo Hunter

    #using using namespace stdcli::language; That may help. Thank You Bo Hunter

    Managed C++/CLI c++ help data-structures beta-testing question

  • Converting byte[] to Hex String;
    B Bo Hunter

    You know something Heath; don’t answer any more of my post. You have a big chip on your shoulder. I have never seen you correct someone's Spelling before, all you are doing is being a smart ass. It is because of me posting some of your previous posts when you start bashing people for not doing this and not doing that. What is your problem? I could understand that being vague or something but to start a post with ("Specific". "Pacific" is the world’s largest ocean.) Is nothing more than the arrogant, self absorbed, inconsiderate prick that you are. Now did I misspell anything this time? This is what Heath Stewart thinks about Certifications. Heath Stewart said "Personally, I am not certified because I really don't want to be. I know a large number of people with certifications that know crap. They studied for the tests, memorized a few things, took the tests (sometimes a couple times) and got their certs. They're still idiots."

    C# database data-structures help

  • Converting byte[] to Hex String;
    B Bo Hunter

    I should have been more pacific. What I ment by the part I am having trouble with is the last while loop is it does not work. These lines are the problem.

    *ch3++ = *( ch2 + ( 2 * (( *b2 & 240 ) >> 4 )));
    *ch3++ = *( ch2 + ( 2 * ( *b2 & 15 )));
    b2++;

    What I am going by is the hash returned for a certain byte[] does not match the result from the same function with the same byte[] in the BCL. Thank You Bo Hunter

    C# database data-structures help

  • Converting byte[] to Hex String;
    B Bo Hunter

    I know that this is possible.

    internal static string ByteArrayToHexString( byte[] buf )
    {
    StringBuilder sb = new StringBuilder( buf.Length );
    for ( int i = 0; i != buf.Length; ++i )
    {
    sb.Append( buf[i].ToString( "X2" ) );
    }
    return ( sb.ToString() );
    }

    But I found this code in the BCL and was just trying to make it work. The trouble I am having is in the lowwer while loop. From what I can see is it is supposed to index into the s_acharval array that contains the valid hex digits. But I have had no luck in figuring it out.

    internal unsafe static string ByteArrayToHexString( byte[] buf, int iLen )
    {
    char[] chs1 = s_acharval;
    if ( chs1 == null )
    {
    chs1 = new char[16];
    int i = (int)chs1.Length;
    while ( --i >= 0 )
    {
    if ( i < 10 )
    {
    chs1[i] = (char)( 48 + i );
    }
    else
    {
    chs1[i] = (char)( 65 + ( i - 10 ) );
    }
    }
    s_acharval = chs1;
    }
    if ( buf == null )
    {
    return null;
    }
    if ( iLen == 0 )
    {
    iLen = (int)buf.Length;
    }
    char[] chs2 = new char[(uint)(iLen * 2)];
    fixed ( char* ch1 = &chs2[0])
    {
    fixed ( char* ch2 = &chs1[0])
    {
    fixed ( byte* b1 = &buf[0] )
    {
    char* ch3 = ch1;
    byte* b2 = b1;
    while ( --iLen >= 0 )
    {
    *ch3++ = *( ch2 + ( 2 * (( *b2 & 240 ) >> 4 )));
    *ch3++ = *( ch2 + ( 2 * ( *b2 & 15 )));
    b2++;
    }
    }
    }
    }

    return new String( chs2 );
    

    }

    Any help would be greatly appreciated. Thank You Bo Hunter

    C# database data-structures help

  • MFC Help;
    B Bo Hunter

    I have this cd burning app that I have been working on. I added a dialog to show progress along the way. Now this dialog implements a interface and these methods are called during the burn. (These methods are callbacks that windows calls duriing the burn. So surely they are called from a different thread) I added some members to represent the controls on this dialog, 2 CStatics and a CProgressCtrl. I added the DDX_Control stuff. Now I know that I am not supposed to work with a control from different threads other than the one it was created with. If that is the case how do I set the window text and the progress step from these methods? Thank You Bo Hunter

    C / C++ / MFC question c++ help

  • How can I get a jpeg picture's array of pixels by using GDI+?
    B Bo Hunter

    Check out the Bitmap class on MSDN check out the LockBits method. Thank You Bo Hunter

    C / C++ / MFC question winforms graphics data-structures

  • ATL bug with CComPtr and VS2003 ?
    B Bo Hunter

    Could you show the lines that give the ambiguous conversion error? Thank You Bo Hunter

    ATL / WTL / STL help csharp visual-studio c++ question

  • Returning WCHAR* variable;
    B Bo Hunter

    I am trying to return a WCHAR* from a function. The WCHAR* variable will be Marshalled to managed code with Marshal.PtrToStringUni. If I don't new it then PtrToStringUni returns the wrong result or nothing. This does not work.

    WCHAR\* GetRecorderDriveLetter()
    {
    	WCHAR drive\[4\] = {0};
    	m\_hr = (\*this)->GetRecorderDriveLetter(drive, 4);
    	//TRACEHR(\_T("CCDBurn::GetRecorderDriveLetter"),m\_hr);
    	return (drive);
    }
    

    This does.

    WCHAR\* GetRecorderDriveLetter()
    {
    	WCHAR\* drive = new WCHAR\[4\];
    	m\_hr = (\*this)->GetRecorderDriveLetter(drive, 4);
    	//TRACEHR(\_T("CCDBurn::GetRecorderDriveLetter"),m\_hr);
    	return (drive);
    }
    

    What I am worried about is a memory leak. How does the memory get freed? Thank You Bo Hunter

    C / C++ / MFC performance 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