Thursday, December 22, 2005

How to format expresions in the watch window of visual studio 2003

I have been trying to add a wariable in the watch window and try to see his value in char format (the value was a byte). I have been reading the unuseful help of visual studio 2003, and I haven´t found nothing useful.

The solution to format, it is using exactly the same as in the lenguage. If you have a byte value, and you want to see this value as a char, you can write in the watch window (char)cnt, and the watch window will show something like 'R'. Useful, but specially if this was in the help.

Monday, December 19, 2005

Problem installing the DAO software

I have had, in my old Visual C++ MFC software, problems installing the DAO library. I normally install this software from a 3 disks installation package that I think that come as redistributable with visual studio 98. What happens, it is a message saying that "Some of the files are in use".

The problem it is very normal in Windows XP with the norton antivirus.

The solution it is to shut down all the programs (the procexp tool from sysinternals.com it is very helpful) that use the DLLs that also use the DAO package.
It seems that it is the own antivirus what gives the problem.

Problems with USB PL2303 usb to serial adapter

While evolutioning to .NET, I had had problems in my old Visual C++ MFC software with a specific USB to serial adapter. The software used to work more or less with all the USB adapters, but was not able to work with this one. We use the adapter to connect to a GSM modem at a speed of 9600 bps.
The driver was the last version and also it was correctly installed (I was able to sends commands to the modem from the Hyperterminal software). What was happening? A problem with the setup of the serial port. If I put the option "use 2 stop bits" while I open the port, the adapter doesn´t work correctly.

/* Fill in the DCB: baud=9600, 8 data bits, no parity, 1 stop bit. */
dcb.BaudRate = Speed;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = TWOSTOPBITS;
fSuccess = SetCommState(hCom, &dcb);

I have changed this option to ONESTOPBIT, and it starts working without problems.

Saturday, December 17, 2005

The beginning

After years of programing in Visual Studio 98, I have decide to experience of programming in .NET. I think of myself as a experienced C++ programmer, and I have at this momet a good knodledge of the MFC library and STL.

I don´t know yet exactly what advantages will give me the .NET environement, but it is the moment to move. Visual studio 98 it is 7 years old... and the applications that I build start to have a little older feeling.

The first decision it is to decide if I will continue programming in C++ with MFC (this is still possble in .NET 2003, I don´t know if it will be also possible in .NET 2005), or move to other different programming language. The possibilites are:
- Java in .NET.
- C#
- Visual Basic.

I have too search the pros and the cons of this important decision!.