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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
V

VFaul

@VFaul
About
Posts
24
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Set Caret Position in a TextBox
    V VFaul

    How do I set the caret position in a textbox?

    Visual Basic question

  • Unsigned Integers and Marshal.ReadInt32()
    V VFaul

    Yes, I understand why the exception is occurring. What baffles me is that there aren't unsigned marshaling methods: Marshal.ReadUInt16(), ReadUIn32(), and ReadUInt64()!? I'm being forced to do four ReadByte() calls when one call to ReadUInt32() is all I would need.

    Visual Basic question

  • Unsigned Integers and Marshal.ReadInt32()
    V VFaul

    I'm calling a function in an unmanaged DLL. It is returning data as unsigned integers. I am using Marshal.ReadInt32() to marshal the data. I am getting an "Arithmetic overflow" exception when it trys to put the signed integer data into the managed unsigned integer variable: Dim uiData as UInt32 = Marshal.ReadInt32(ipBuffer) The exception only happens when the data has the most significant bit set (the "sign" bit). If Marshal.ReadUInt32() existed, obviously I would use that. Since it does not exist, I am marshaling the four bytes individually using Marshal.ReadByte() and constructing the unsigned integer. Is there a better way to do this?

    Visual Basic question

  • Set ListView Item to Selected
    V VFaul

    Here's how you do it: For Each item As ListViewItem In lv.Items item.Selected = True Next lv.Focus() Note that you need need to set the focus back to the ListView control, because the items won't be highlighted when the control does not have focus (by default, lv.HideSelection = true). Instead of giving focus back to the control, you could set the lv.HideSelection to false, but the highlight will be gray instead of blue (when the control does not have focus).

    Visual Basic question

  • Set ListView Item to Selected
    V VFaul

    I have a ListView control in a form. I want to add a "Select All" button on the form that selects all items in the ListView control. I cannot find a way to do this. The "SelectedIndices" and "SelectedItems" are readonly properties. How do I programatically select an item in the ListView?

    Visual Basic question

  • Convert binary string to integer
    V VFaul

    How do I convert a binary string to an integer? For example, "10100101" is the number 165. I know I could right my own routine, but is there already a built-in way to do this in .NET?

    Visual Basic question csharp tutorial

  • Exception at address
    V VFaul

    No, no, no... My app did not catch the exception. So I don't have any idea where to look in my app. The OS, or whatever catches unhandled exceptions, caught the exception and that dialog tells me the address of the where the exception occurred. Now I'm trying to determine where in my app that address is.

    Visual Basic csharp question

  • Exception at address
    V VFaul

    The exception is an "invalid typecast". I'm sure it is in my code. I don't believe it has anything to do with COM. Is there some sort of map file that that I can look at to find the method that contains the offending address. I don't have the debugger on the target machine. An I'd rather not put it on the target. What if the exception happens out in the field? I'd like to be able to find the problem given the offending address.

    Visual Basic csharp question

  • Exception at address
    V VFaul

    My VB .NET app is causing an unhandled exception. When I look at the exception details, it shows me the hex address where the exception is occurring. How I determine where in my code this is happening given an address? Thanks

    Visual Basic csharp question

  • Synchronization in a DLL
    V VFaul

    I'm writing a DLL that can be accessed by multiple applications. The DLL talks to hardware (through a third-party driver). I need to block all other calls to the DLL while the DLL is talking to the hardware. What is the best synchrounization method - critical section, mutex,...? Also, I think the synchronization object in the DLL needs to be global so it can be accessed by multiple processes. How do I do that? Thanks, VF

    C / C++ / MFC question hardware

  • How do I put user control in toolbox
    V VFaul

    Still doesn't work. At least I can add it manually. Do you know how I can modify the icon that shows up in the toolbox? Doesn't seem to be an Icon property for the user control.

    Visual Basic question visual-studio

  • How do I put user control in toolbox
    V VFaul

    "Choose Items..." and browsing to the dll also works. Next question: How do I modify the icon for the user control that is displayed in the toolbox. I looked for an Icon property for my user control, but there doesn't seem to be one.

    Visual Basic question visual-studio

  • How do I put user control in toolbox
    V VFaul

    There isn't an "Add" when I right-click on the toolbox. However, I used the "Add tab", and entered an appropriate name. Then I dragged my dll file into the area in the new tab. Now it shows up.

    Visual Basic question visual-studio

  • How do I put user control in toolbox
    V VFaul

    I'm using VS 2005 with SP1. I created a user control. In the same solution I created a new project to test the control. In the test project, I added a reference to the user control project. My user control does not show up in the toolbox. What do I have to do to have it show up? Thanks, VF

    Visual Basic question visual-studio

  • Image File Transparency
    V VFaul

    MakeTransparent works great! Thanks.

    Visual Studio graphics question

  • Marshalling Variable-Size Array
    V VFaul

    I'm calling an unmanaged native WLAN API method, WlanEnumInterfaces, that returns a pointer to a structure (WLAN_INTERFACE_INFO_LIST). There are three components to the structure. The third component is an array (WLAN_INTERFACE_INFO) of variable size. The first component in the structure is the number of items in the array. I'm having trouble marshalling the data. I am using Marshal.PtrToStructure. I get the following exception: "Cannot marshal field 'InterfaceList' of type "WLAN_INTERFACE_INFO_LIST": Invalid managed/unmanaged type combination (Arrays fields must be paired with ByValArray or SafeArray)." Since the array size is variable, I marshal using UnmanagedType.LPArray and SizeParamIndex. Below is my code. The call to WlanEnumInterfaces() is successful and I can view the contents of the structure in memory. The exception occurs at Marshal.PtrToStructure. _ Public Structure WLAN_INTERFACE_INFO Public InterfaceGuid As GUID Public strInterfaceDescription() As String Public isState As WLAN_INTERFACE_STATE End Structure _ Public Structure WLAN_INTERFACE_INFO_LIST Public NumberOfItems As UInteger Public Index As UInteger Public InterfaceList() As WLAN_INTERFACE_INFO End Structure Dim pTemp As IntPtr Dim WlanInterfaceList As WLAN_INTERFACE_INFO_LIST ui32Status = WlanEnumInterfaces(WlanHandle,IntPtr.Zero, pTemp) WlanInterfaceList = Marshal.PtrToStructure(pTemp, GetType(WLAN_INTERFACE_INFO_LIST)) Any help is appreciated. VF

    Visual Basic c++ database data-structures json performance

  • Image File Transparency
    V VFaul

    I am loading a bitmap image into a picturebox that resides on a panel. I would like certain pixels of the image to be transparent so that the panel's color shows through the transparent pixels. Is there any way to set pixels in a bitmap, jpeg, etc. so that they are transparent? Thanks VF

    Visual Studio graphics question

  • Repaint causes CPU loading and failed test
    V VFaul

    You were correct! I was doing everything inside the UI thread. I redesigned the app to use threads for each of my tests. Now the test never fails, even when the CPU is maxed at 100%!!!

    Visual Basic help question

  • Repaint causes CPU loading and failed test
    V VFaul

    I have a form with a tab control with several tabs. The main tab has many controls on it. The app is performing various "tests" and displaying pass/fail in the main tab. One of the tests is a communication test. It sends out a message and expects an asynchronous reply within a certain timeout. When I click on a tab and then go back to the main tab, it takes almost a second for all the controls to be repainted. This causes the CPU to peg at 100% usage and will occasionally cause my communication test to timeout (the timer expires before the reply is received). Does anyone have any ideas to get around this problem? I have already increased the timeout period as much as I want to. I also do not want to disable the test when I switch tabs. Thanks VF

    Visual Basic help question

  • Returning LRESULT in DefWindowProc()
    V VFaul

    I have a DefWindowProc() function to catch unhandled messages. This function returns an LRESULT. I have a switch statement and in some cases I call CWnd::DefWindowProc(). So I simply return the result of the call to CWnd::DefWindowProc(). In other cases, I handle the message. What should the value of LRESULT be when I handle the message?

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