Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » VB   (RSS)

What is your computer doing with all that memory? Write your own memory browser

What is your computer doing with all that memory? There are various kinds of memory allocated and used in each process. These include: · Managed memory (VB.Net, C#, managed C++) · Heap memory · Stacks · Images (files loaded into a process) VirtualAlloc
Posted by Calvin_Hsia | 1 Comments
Filed under: , , , ,

Its easy to create a graph of memory use in Excel

In this post Examine .Net Memory Leaks I showed how to find a .Net managed memory leak. Now let’s create a graph of memory and resource use over time. Start Visual Studio 2008, File->New->Visual Basic (or C#) Windows, WPF application. Dbl click
Posted by Calvin_Hsia | 0 Comments
Filed under: , ,

Make your Task Switcher Window bigger

One of the best features of Windows is the ability to Cut and Paste data within an application or from one application to another. You can alt-tab or click on the task bar to switch between actively running applications, like Word and Visual Studio. When

Process Explorer and Process Monitor can help you understand a program

Process Explorer and Process Monitor are must-have free utilities that you can download from http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx For example you can use ProcExp to examine a particular behavior of Visual Studio. Start Visual
Posted by Calvin_Hsia | 0 Comments

You can use Visual Studio to debug itself!

How do you find out why your computer or a running program is so slow? Here’s one way. Let’s attach the VS debugger to VS itself. The main executable for VS is devenv.exe. Start Visual Studio 2008. This will be the “debugger” Choose File->Open Project
Posted by Calvin_Hsia | 2 Comments
Filed under: , ,

Stack overflow, expand your stack? Change your algorithm!

In the last post, Area fill algorithm: crayons and coloring book , I showed a program that emulates a kid drawing in a coloring book. However, the algorithm wasn’t very efficient, and would explode even if you had a simple drawing: it was using the stack
Posted by Calvin_Hsia | 1 Comments
Filed under: , ,

Area fill algorithm: crayons and coloring book

Kids know how to use crayons and a coloring book. How do you write such a program? In my last post ( Which pixels do you turn on when you draw a line? ) I showed how to draw a line. Now suppose you have some lines or shapes already drawn. How would you
Posted by Calvin_Hsia | 4 Comments
Filed under: , ,

Which pixels do you turn on when you draw a line?

When I wrote my cartoon animation program almost 30 years ago (see Cartoon animation program ) I needed to know how to draw a line. Of course, nowadays, we just call a library function that will draw a line given two points. If you think about it, the
Posted by Calvin_Hsia | 3 Comments
Filed under: , ,

Comment/Uncomment code to switch versions quickly without using macros

In a typical day, I write or debug programs in several languages: typically Foxpro, C#, VB, C++ and 32 bit assembly, with an occasional MSIL, IDL and 64 bit ASM thrown in. Sometimes, I like to switch between one version of code and another. This is useful

Cartoon animation program

A cartoon can be thought of as a series of drawings. To simulate movement, the drawings can be slightly different from each other. Remember drawing simple cartoons using a pad of paper? Simply flipping through the pages made the drawings come to life.
Posted by Calvin_Hsia | 15 Comments

Write simple Debug helpers to help you debug and maintain your code

Much of my time is spent using the Visual Studio debugger examining code to figure out how it works and how to fix it. When stepping through a function, the values the function uses are very useful for code understanding. The debugger shows these values
Posted by Calvin_Hsia | 3 Comments

You can use HWndHost to host a Win32 HWnd window inside a WPF element

Suppose you have some old code lying around that creates a Win32 window with an HWnd (perhaps ATL , MFC , or just C/ C++). For example, if you type some erroneous code into a VB application in Visual Studio: Dim x=4: catch ex As Exception The “Exception”
Posted by Calvin_Hsia | 1 Comments
Filed under: , ,

Dynamically load a DLL from a runtime specified path

When running VB.Net or C# code, often it’s useful to call native code. One way is using PInvoke. (for other ways, see How fast is interop code? ) For example, you can call GetWindowText to get the title of a window. To get it’s managed signature, you
Posted by Calvin_Hsia | 0 Comments
Filed under: ,

Synchronize your files across machines with Mesh

I have a collection of almost 30,000 pictures and videos. When I add new pictures to the collection, I had been running a script file to synchronize the collection across various machines. for %%s in (\\calvinh6\e$ \\calvinh3\e$ \\calvinh4\e$) do ( robocopy
Posted by Calvin_Hsia | 13 Comments
Filed under: , ,

Magnify your pictures using a PictureBox so that you can zoom with the Mouse Wheel

Today’s digital cameras take pictures with much higher resolution than many computer screens. My Canon PowerShot SD800 IS camera takes pictures at 3072 x 2204 resolution. One of my laptops died recently, and I noticed that local laptop retailers have
Posted by Calvin_Hsia | 15 Comments
Filed under: , ,
More Posts Next page »
 
Page view tracker