Monday, October 24, 2005

Guided Setup via Broadband for TiVo Series 2

Apparently, there isn't an intuitive way to use your broadband connection to do the initial setup on the Series 2 TiVo's. I just confirmed that changing the dialing prefix to ,#401 will let you do it. TiVo's FAQ says that I am wrong, but who can argue with completed setup. Make sure to use one of their supported adapters.

Saturday, October 8, 2005

Mysterious DB2 8.2 UDB FixPak 10 Issue: Solved

I recently added native support for DB2 8.2 UDB from our product and was doing quite well until I went out for deployment. Many odd errors were occurring throughout the product with the DB2 error: "ERROR [22005] [IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005 " I couldn't understand how it had worked perfectly in development but failed in deployment. We finally tracked the difference down to the fixpak. I was developing under FP9a and deploying under FixPak 10.

I copied my NUnit testing code over to deployment and ran it and about 1/3 of all of my functions were failing. After several days of troubleshooting I finally tracked it down to the way the DB2 client handles Enums. I was passing the enums directly as stored procedure parameters with no sort of conversion into an Int32 field. After changing the code to do a Ctype(myEnum, Integer), the code is working flawlessly again. Stupid on my part to not convert them directly but Option Strict didn't catch them in the Enterprise Library AddInParameter method. Also very strange that the behavior changed between clients. In the development environment, we were able to verify that even if the database remained on FP9 and the client changed to FP10, the error would occur. So this is a 100% client problem. I don't have a clue how to let IBM know about this but hopefully it will get to them from one of their direct customers. Until then, remember to explicitly convert your datatypes!

Friday, October 7, 2005

VS.NET Macros Stop Working

Curiosity killed the IDE.
In the last few months I have been experimenting with a host of Visual Studio .NET add-ins. Sometime in there, my Macro environment stopped working. I would run a macro and the task tray icon would flash and then nothing would happen. At some point, I finally coerced an error message of "No such interface supported" out of my Macro IDE but that lead me no where on a Google search. I tried uninstalling all of my current add-ins which was no easy task. Unfortunately, none of the uninstalls remedied the problem. Finally, I decided I would take the big plunge and do a repair on Visual Studio.NET 2003 EA. For those of you who haven't experience this, it takes about 2-3 hours.

I couldn't believe it when I went confidently back in and the macro's still didn't work. I finally found a reference that looked promising on Matt Renolds .NET 24/7 explaining that poorly behaved add-ins can unregister mscorlib.tlb. The fix posted was to do the following:
REGTLIB.EXE MSCORLIB.TLB

mscrolib.tlb should be located in your
...windowsMicrosoft.NETFrameworkv1.1.4322 directory.
On my XP system, I found regtlib.exe in ...windowssystem32URTTemp.
(though you may have to search your hard drive for this one).

Sincerely,
Ed Dore [MSFT]

I tried that and got a "mscorlib.dll failed : 80029c4a" error. The last part of that thread said to try uninstalling and reinstalling the .NET Framework. I didn't believe it but after a quick uninstall/reinstall/reboot/patch, my macros are back. I hope someone finds this and doesn't have to go through all of that again.

Wednesday, October 5, 2005

Start Application Automatically After Setup

I wanted to automatically run my application after setup completed. I searched high and low for this option and it just isn't included in the Setup Project options for Visual Studio.NET 2003. It looks like it will be in 2005 though. Here is the easy way to do it

  1. Add an installer class to your application with the following code:
    [sourcecode language='vb']
    Public Overrides Sub Install(ByVal stateSaver As IDictionary)
    MyBase.Install(stateSaver)
    Dim Asm As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly
    System.Diagnostics.Process.Start(Asm.Location)
    End Sub
    [/sourcecode]

  2. Right click on your setup project and go to View - Custom Actions

  3. Right click on Install under Custom Actions and select Add Custom Action...

  4. Select the primary output of your project from the application folder

  5. Do the same for the Commit


That's it. Your installer will now run your application after setup.

Thursday, September 15, 2005

Visual Studio.NET and Nant

UPDATE 10/5/2005

I figured out why I was getting the BC2010 error finally. I decided to isolate the failing build project into it's own directory and determine what the differences were between it and the Visual Studio build. As soon as I reloaded the project in VS.NET, I started getting errors that the signature was incorrect on the methods I was implementing for an interface. Upon further investigation I realized that I had renamed the dll in Nant when it was copied to my lib directory. So the interface that I was implementing referenced the DLL as one name internally, MSDocument.dll, and the library I was trying to build had a reference to it as well as MyCompanyDocumentStructures.dll. Although the contents were the same, I assume the name difference affected the signature enough that I was unable to implement it with a different name. Some sort of compiler information on the error would have been much more helpful but at least I know what was going wrong. I guess the moral of the story is to isolate the problem and then compare the vbproj file to the nant build file and figure out where you have differences. I am now looking forward to taking full advantage of Nant without vbc compiler errors.

Thursday, September 1, 2005

GUID's are mangled passing through DB2 DAAB in Enterprise Library

Continuing my work on the DB2 interface for my application using the DB2 DAAB, I am working extensively with GUID's. The probelm I am running into is that somehow, the Byte Array conversion or DB2 itself is changing the GUID value when it is added to the database. I have a simple Stored Procedure in DB2 that accepts a CHAR(16) FOR BIT DATA. This is handled under the covers by the AddParameter Method keyed by the dbType.GUID field. A conversion takes place from a GUID to a binary byte array.continued...

Here is the code from db2Commandwrapper.cs:
[code lang='vb']
case DbType.Guid:
guidParameters.Add(param.ParameterName, "System.Guid");
param.DB2Type = DB2Type.Binary;
param.Size = 16;
// convert Guid value to byte array only if not null
if ((value is DBNull) || (value == null))
{
param.Value = Convert.DBNull;
}
else
{
param.Value = ((Guid)value).ToByteArray();
}
break;

[/code]
Now here is the weird part, lets say I supply a GUID of value 9c1fcfe7-d68e-4a6d-b395-823bac3022f7. I run it through my stored procedure:
[code lang='sql']
CREATE PROCEDURE DB2ADMIN.PROCESSORINFOADDSINGLE ( IN v_ProcessorID CHARACTER(16) FOR BIT DATA))
DYNAMIC RESULT SETS 1
------------------------------------------------------------------------
-- SQL Stored Procedure
------------------------------------------------------------------------
P1: BEGIN

INSERT INTO DB2ADMIN.PROCESSORINFO (PROCESSORID)
VALUES (PROCESSORINFOADDSINGLE.v_ProcessorID);

END P1
[/code]

and it comes out as as x'E7CF1F9C8ED66D4AB395823BAC3022F7'. The first 16 characters are somehow changed. Weird. If I run a select statement against it from CLP, it will not match. However, if I used a parameterized query that runs the same GUID back through the db2Commandwrapper conversion function, it matches. This will cause problems if I try to run a standard GetSqlStringCommandWrapper without using a parameterized value for the GUID.

I posted this same information to the Enterprise Library Newsgroups. Maybe I will get some feedback.

Thursday, August 25, 2005

Handling GUID's (UniqueIdentifiers) in DB2 using VB.NET

Continuing the saga of DB2, I am now trying to handle GUID's/UniqueIdentifiers from the Enterprise Library. First thing I had to get a handle on is that DB2 UDB has no datatype similar to a GUID. In Microsoft SQL they are represented as UniqueIdentifiers and used quite extensively. Oracle represents them as RAW(16). When I ran the conversion on my database using the IBM Migration Toolkit (MTK), the GUID's in my database were converted to CHARACTER(16) FOR BIT DATA. So basically, a container to hold 16 bytes worth of data. It takes 2 hexadecimal characters to represent 1 byte so 32 hexadecimal characters is 16 bytes or 128-bits.

Monday, August 22, 2005

IBM DB2 on Fedora Core 3 64-Bit

I have moved on to my next adventure in writing a native database interface. We have decided to add native DB2 support to our product offering. I was fairly excited when I first started out to install this but after 5 days, I am frustrated and dismayed at the lack of forethought or testing put into the product. I downloaded DB2 8.2 from IBM's web site and installed the 90-day trial for enterprise edition on my Sun Sunfire V20Z development server running Redhat Fedora Core 3, 64-bit edition. Now I bet there are alot of people who want to test DB2 under these types of conditions and from what I read, it just won't work.

Friday, August 12, 2005

Callvantage QoS

I finally got around to fixing the QoS problem with my Callvantage VoIP setup. After determining about 3 months ago that my Callvantage box was dropping packets and causing general outbound havok on my system, I decided to move it inside my network behind my trusty linux firewall/router/mailserver/gameserver box. The unfortunate side effect was that I lost the Quality of Service capabilities. This caused a serious delay in voice transmission and sometimes even stuttering while I was talking on the phone. I usually just accepted it until my friend got his new Actiontec router and it handled VoIP QoS automatically. Now if Actiontec can do it, I know my outdated Redhat 7.3 install should be able to.

Tuesday, August 2, 2005

Coaxial Run with Power CCTV Troubleshooting Guide

Written by Jim Shank 8/2/05



 

There should be two major troubleshooting points for CCTV, the camera’s themselves and the central terminating location (CTL) in which the video signal is captured and the power is supplied (if power is not supplied mid-run or directly at the camera location). Troubleshooting will be started at the CTL and then move to each individual camera. It helps to have a baseline camera that is working in order to capture normal readings for comparison. Remember that CCTV cabling should be as follows






 
RG-59/RG-6
UTP with Baluns
Fiber Optic

Run Length

< 250 ft.




250 – 3000 ft.




> 3000 ft.





 

Tools Needed




  • Digital Volt Meter (DVM)

  • Electrical Tape


Optional Tools




  • BNC or F-type connector and small piece of coax

  • 9V battery


 

Monday, March 28, 2005

.NET Remoting and App.config files

I am moving on to some remoting applications in my project and found another interesting tidbit. Almost all of the remoting examples in Microsoft .NET Distributed Applications: Integrating XML Web Services and .NET Remoting use console applications as component hosts (listeners) and of course call the RemoteConfigurationFile.Configure method. This really doesn't make sense since in the real world, you are probably going to be running your component host as a service. What isn't revealed is that when you start your service, it's local directory is your system dir (e.g. c:windowssystem32). In order to access your application configuration you either need to hard code the whole path (bad idea) or use the ever so handy AppDomain.CurrentDomain.SetupInformation.ConfigurationFile. This makes it much simpler to access the app.config file and load your remoting configuration correctly. I found a snip that this information is included in Ingo Rammer's Book Advanced .NET Remoting in VB.NET but I haven't read that one yet.

Monday, March 7, 2005

Systray icons here to stay

For almost a year now, I have been having problems with my system tray icons disappearing intermittently after startup. I assumed one of the 30 or so startup applications was crashing dropping the explorer process and therefore, only the following tray icons were appearing. I finally had some free time and was in the process of looking for a program to debug the startup process when I hit an interesting link. Apparently, this is a more common issue than I thought, so common that there is a fix called the Ostuni Workaround detailing that disabling the UPnP subsystem will fix the problem. I couldn't really believe that one thing had to do with another but after following the directions and a quick reboot, the problem went away. 5 reboots later, still no problem. I don't have to wait an hour to login or do any other voodoo to get this working. As a nice side benefit, I noticed that the system appears to be running faster. Network browsing is quicker and no longer hangs showing UNC and description of My Network Places. Absolutely great!

512MB MiniSD Finally Arrived

Like a watched pot left forgotten on the stove... the 512MB MiniSD card for my MPx220 finally arrived today. I had forgotten to call and check when the next "back-order" date would be for it and sure enough, it came. Nothing exciting to tell, it seems to hold 512MB so I copied a bunch of MP3's onto my phone. Since I now own the Motorola HS120 Stereo Headset (Headphones and microphone) I have a full blown 512MB MP3 player with me at all times. Sweet.

Wednesday, February 23, 2005

Solving the dreaded Oracle Invalid Parameter Binding

It only took me 2 weeks to finally fix this one. I am using the ODP.NET driver to access my Oracle database from VB.NET. It seemed like every time I tried a dataAdapter.Update command, it would bomb out with an ArgumentException error with a message of Invalid Parameter Bindings (thanks Oracle). The first week was spent searching and trying to implement a SQL Trace (like SQL Profiler for MSSQL) so I could see what exactly the OracleCommandBuilder was sending off for the command. No luck there, I can't believe how outdated Oracle GUI management tools are. I would have thought at some point they would have written at least some sort of simple GUI management tool but alas, a Web version of iSQL plus and Enterprise Manager are all that is available to us who crave an easier way to manage.

Tuesday, February 15, 2005

StringBuilder.ToString with Null Characters (0x00)

A little interesting find in todays coding. I am parsing a binary file type and when I encounter values that I don't want to convert, I was setting them to 0 (ASCII Null). These values were then added to a StringBuilder object successfully. The interesting thing is when I finish the operation and return a StringBuilder.ToString, the text is truncated at the Null character position even though there is additional text beyond it. I was unable to find a quick and easy way to erase the text I didn't want to see in the ouput so I ended up changing the offending characters to 32 (ASCII Space). I found an article on Expert Exchange (great site) about a similar problem but didn't find a specific solution doing it the way I am. Technically, I could create another array and populate it and then return the new array but it seems less efficient then just setting the values to 0 and letting a conversion remove them. I guess this was the intended method of .NET (NUL signals the end of the string). Feedback is welcome on this :)

Tuesday, February 1, 2005

Still waiting on my $52 512MB MiniSD Card

Would you believe I still haven't received it?!?! It's been over a month now and nothing. I guess I will have to call again and see when it is back ordered to this time.

Bluetooth Headset

It arrived! I got the free bluetooth headset on Friday! I was suprised to open a box from Youth America and find a Motorola HS-810 headset in the box. I figured there was no way I was one of the first 1000 users of the MPX-220 to register but here it is. The size and shape are really well done and I prefer the flip out boom mic as compared to the 820. My brother says his 820 likes to redial in his pocket. I am disappointed with the interface to the MPX220 though. Voice dial doesn't work quite correctly due to a problem with the bluetooth stack in Microsoft Windows Mobile 2003. It is rumored to be fixed sometime but I won't hold my breath. You can actually hold up the volume button on the phone to activate Voice Dial and then speak into the headset but you get no prompts on the headset which is difficult. I can't use it as a wireless audio device either. It would be nice to play games/listen to MP3s using it. As a hands free headset for phone calls, It works pretty well. It has a world more of possiblities but I guess I will have to wait for Windows Mobile 2005 to see what it can do. It is definitely worth what I paid for it.

Oracle Time

Sorry it's been so long since an update. I have been working and coding hard. I was presented with the challenge of adding native ODP.NET (Oracle Data Provider) support to my current project. For those who are looking to get a start on Oracle here is what I did.

Wednesday, January 19, 2005

How to get SmartPhone Emulator 2003 SE in SmartPhone

So you are trying to develop a SmartPhone (Windows Mobile 2003 SE) application in Visual Studio .NET 2003 but the install of the extra emulators does nothing for you. I finally figured it out. Here is the deal.

  1. Download the new Emulator packagefrom Microsoft.

  2. Run the install

  3. Copy everything from C:Program FilesSmartphone 2003 Second Edition EmulatorsWWESmartphone to C:Program FilesWindows CE Toolswce420SMARTPHONE 2003Emulation

  4. Restart Visual Studio and check the available emulator images .


It took me forever but post me a comment if this works for you!

Thursday, January 13, 2005

Smartphone CAB Creation

Found this little tidbit here. I've been playing around with the CabwizSP.exe and the .inf file for the whole night. Some quick points to note:

  1. The Build Cab File button in VS.NET is not working for Smartphone development coz it's pointing to Cabwiz.exe but we have to use CabwizSP.exe instead.

  2. Although it's not working, we can still press the button coz it'll help us the generate BuildCab.bat and AppName_SMP.inf

  3. Manually change BuildCab.bat so that it points to "C:Program FilesWindows CE Toolswce420SMARTPHONE 2003Toolscabwizsp.exe".

  4. Manually amend the .inf file and cut away all the ARMV4 and X86 sections, and amend the shortcuts as we like.

  5. Run BuildCab.bat from command line, it'll generate 2 .cab files in the cabdebug directory. I just chose one of them and ftp to my server.

  6. On a Smartphone or Smartphone emulator, use IE to access the cab file on the web server. It'll start downloading and install the app.

  7. We can remove the app using the Remove Program option in the Start Menu.

Tuesday, January 11, 2005

Creating Windows Service Installers

My newest project is moving along nicely. There was an earlier snag that I thought I should mention before I forgot it. In order to use a VB .NET Windows service, you must add a project installer to it. The books make this seem easy enough but I couldn't figure out how to do it. Finally, I got it. All you have to do is open the service design surface (the yellowish one) and then check properties. There, at the bottom, is a little Add Installer hyperlink. For all you VS.NET users, open your help file to

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vbcon/html/
vbtskaddinginstallerstoyourserviceapplication.htm

(combine the two lines before pasting)

Friday, January 7, 2005

SmartPoints for SmartPhone

I had a little down time today while I rested from coding my new project and decided to play with the Windows Mobile SDK. I was amazed at the development skills I was able to leverage thanks to the .NET Compact Framwork which, prepare to be amazed, is part of the OS in Windows Mobile 2003 SE. I love the old Weight Watchers point system and religiosly use my Palm to run wwcalc to keep track of my points. I wanted to see how hard it would be to rewrite the application for SmartPhone and it is coming along quite well. Here are some teaser screen shots:

Images gone after moving my blog.

Wednesday, January 5, 2005

Another MSMQ Service Solution

Now why did I make that so hard on myself. I started looking at that last blog and realized I have no need to create a separate thread for listening. I thought that by calling the listen event, it would cause the OnStart to hang. I called listen directly and it works like a charm.

MSMQ Async Solution

See end of post for update

I touched on this a little bit befoe but finally figured out a solution. Here is the basic code for a Windows Service that sets up a listener thread and executes it, the listener thread is responsible for adding a handler for the queue ReceiveCompleted event. Here is said code:

Tuesday, January 4, 2005

Loving the MPx220

I didn't know what kind of impact having my Outlook Syncronized calendar and contacts was going to be. I already have it on my Palm M505 but it is amazing how much more convenient it is on my phone. Most times, my Palm (the case I use is my wallet) sits in my jacket pocket. I was coding away today when my phone vibrated on my hip, I checked it and it told me it was time to pick up the kids from school, now how handy is that!

Microsoft Messaging Queue

I thought this was going to be straight forward. There are example chapters in my Enterprise Application book about creating applications that use Microsoft Messaging Queues or MSMQ. There are also chapters on creating Windows services. I figured I would marry the two and have an cool service that would process messages from the MSMQ. Unfortunately, it is not all that simple. Because I am spinning up a new thread to handle the background processing, there is a race condition that occurs when there is no waiting message in the MSMQ. I found a more detailed explanation here. I guess it's back to figuring out a better way to handle it tomorrow.

Saturday, January 1, 2005

Happy New Year!

Happy New Year! Sorry for the lack of posts over the last few days but the end of the year has been busy. I spent a lot of good time with family and friends and enjoyed a wonderful dinner at The Broker last night as well as enjoying the fireworks over downtown Denver to welcome in the New Year. Here are the pictures I took with my phone.