Hyper-V Beta is out!

14. December 2007 08:05 by Jaguilar in General  //  Tags:   //   Comments (0)

For those of you who missed it, Windows Server 2008 RC1 was released yesterday, with the Beta of Hyper-V. Finally!

You can download it here, and there is some more information on the Virtual PC Guy's WebLog.

Debugging AJAX

12. December 2007 05:00 by Mrojas in General  //  Tags: , , ,   //   Comments (0)
AJAX applications are great
Their coolness factor is high, and your clients
will be trilled by the new interactivity of your pages
But as a developer when you have a problem with
AJAX it could be hard to track. Because there is
a lot going on behind the scenes
Some of our costumers migrate their ASP applications to
to ASP.NET and it's natural that they want
some AJAX in it.
So I found a GREAT GREAT application for AJAX debugging
It's called fiddler. I cannot describe it all for you so go its site and watch the videos
The tool is just amazing :)
It really can see everything that the browser
receives and sends and more.
A definitive must Fiddler

Doing business in Latin America

6. December 2007 06:05 by Jaguilar in General  //  Tags: ,   //   Comments (0)

Even though most of our clients are from the US and Europe, lately we have been getting more and more projects in Latin America, specially in Mexico. You’ve probably heard about a large project we started in Mexico recently. We also signed two smaller projects in the last month, and last week I was on-site at a customer in Mexico D.F. working on yet another one.

The thing is that in Mexico, even though still in Latin America (remember that we are based in Costa Rica), there were a couple of cultural differences that really caught my attention.

First of, the schedule. We in Costa Rica usually have lunch between 12 and 1. In Mexico it is usually between 3–4pm, 3–5pm or 2–4pm, depending on the company. That is a bit late for us… let’s just say that by 3pm I was starving.

The second one was the dress code. Normally in Europe and in the US, IT departments are very laid back, and have a very lax dress code. Through out Latin America, however, it is mostly suit and tie. Only in a few places can you show up with “business casual” or even “casual” clothes. This is changing, though, and going more and more casual.

All in all, going to Mexico was a nice experience. The people I worked with were really nice, and treated me well (other than keeping me hungry until the mid-afternoon  ). I hope we sign this project, so I’ll be able to go back!

Why is it more difficult to migrate VB6 to C# than to VB.NET?

16. November 2007 13:46 by jpena in General  //  Tags:   //   Comments (0)
One of the questions that most people ask when preparing for a Visual Basic 6.0 migration to .NET has to do with the difficulty level of migrating an application to C# compared to VB.NET. Although the Visual Basic Upgrade Companion product can migrate VB6 code to both VB.NET and C#, and both languages are first-class citizens in the .NET world, having access to all the resources provided by the .NET Framework, there are some key differences that will make a migration to C# demand more manual effort and changes.  The following are two of these differences:
  • C# is strictly typed as opposed to VB6 and there’s no way around it.  Invoking a property or method from an Object variable that is meant to be instantiated to a different type at runtime would require a type-cast; otherwise the compiler will throw an error.  Therefore, many late-bound operations and unsafe operations (such as assigning the value of a Long variable to an Integer variable) that unfortunately were common in VB6, will generate compilation errors.  This will not happen in VB.NET unless you turn Option Strict on, which is turned off by default.
  • In C#, only Structured Error Handling (“Try Catch”) is allowed.  This means that any error-handling code that could not be converted to “Try Catch” by VBUC will have to be fixed manually, implying an important amount of manual work in some projects (especially if statements such as “On Error Resume” and “On Error Resume Next” are used in the VB6 code).  On the other hand, VB.NET still supports Unstructured Error Handling (“On Error GoTo”) for compatibility with migrated applications, which will reduce the amount of manual work if you are in a hurry.  For VB.NET migrations, VBUC can disable the conversion of “On Error GoTo” to “Try Catch” to speed up the migration process and reduce manual changes.
Naturally, strongly-typed and well-structured code is preferable.  However, this increases the amount of manual work that is needed to achieve Functional Equivalence. More information on migrating Visual Basic 6.0 to C# can be found in the ArtinSoft website: http://www.artinsoft.com/vbc_csharpgen.aspx

MSBuild and Visual Studio

9. November 2007 04:50 by Mrojas in General  //  Tags: ,   //   Comments (0)
One of my purposes for this year was to start
using more the MSBuild
Saldly I'm still not as good on it as I expected
This link provided some interetings points MS Build and VS

Case Sensitive SQL Server

26. October 2007 06:29 by Mrojas in General  //  Tags: , , , ,   //   Comments (0)
Recently a friend at work had a problem querying a SQL server that indicated that the column name was wrong.

The only thing wrong was the the case. For example he had COLUMN1 instead of Column1. I had never seen that problem in SQLServer.
I had seed that in Sybase but not in SQLServer. He solved that by changing the database collating sequence to something like this:

alter database database1 collate SQL_Latin1_General_CP1_CI_AI

the CI in the collating indicates Case Insensitive

For more information on SQL Server collations check: http://msdn2.microsoft.com/en-us/library/aa258233(SQL.80).aspx

And you determine your current database collation use a code like this:

USE yourdb>
GO

print 'My database [' + db_name() + '] collation is: ' + cast( DATABASEPROPERTYEX ( db_name(), N'Collation' ) as varchar(128) )

print 'My tempdb database collation is: ' + cast( DATABASEPROPERTYEX ( 'tempdb', N'Collation' ) as varchar(128) )

 

Track Changes in VSS (Visual Source Safe)

24. October 2007 06:18 by Mrojas in General  //  Tags: , , , , ,   //   Comments (0)

MS VSS (Visual SourceSafe) is not really my preferred Source Control application, but
sometimes in your company that is what is available and you need to used it to have
at least some versioning of the code.

But haven't you had a situation where last week everything worked and
now everything is broken. And now is up to you to determine what went
wrong? I have it all the time.
 

VSS have some search tools but I really do not enjoy using them.
The Code Project Site provides an excellent tool called VssReporter

Sample Image - VssReporter.jpg

Do take a look at it, it makes it more easy to track changes. :)

 

Get GUIDs/CLSIDs from Exe, dll, ocx, tlb, etc

23. October 2007 10:08 by Mrojas in General  //  Tags: , ,   //   Comments (0)

A simple way of getting the GUID from an exe, dll, ocx, tlb is using the  TLBINF32.dll

This file is in the system path and it must be registered
(Remember to use regsvr32 if you haven't registered).

            TLI.TLIApplicationClass a = new TLI.TLIApplicationClass();
            try
            {

                TLI.TypeLibInfo inf = a.TypeLibInfoFromFile(@"c:\windows\system32\MSHFLXGD.OCX");
                MessageBox.Show(
                "TypeLibrary Name " +  inf.Name + "\r\n" + //name of (Type Library)
                "Tlb ID " +  inf.GUID + "\r\n" + // GUID for Library
                "LCID "  + inf.LCID + "\r\n" + // Language / Country
                "Major Version "+ inf.MajorVersion + "\r\n" + // Major Version
                "Minor Version "+ inf.MinorVersion); // Minor Version
                for (short i = 1; i < inf.TypeInfoCount; i++)
                {

                    TLI.TypeInfo inf2 = inf.TypeInfos[i];
                    MessageBox.Show("CLSID " + inf2.Name + " - " + inf2.GUID,i + " of " +
inf.TypeInfoCount);

                }
            }
            catch (Exception ee)
            {
                MessageBox.Show("No guid");
            }

 

 

cfgrid or ext grid change column align

23. October 2007 05:42 by Mrojas in General  //  Tags:   //   Comments (0)

If you are using Coldfusion MX 8 cfgrid or the excelent Ext library and
you want to change the aligment for the column then a simple way
to do that is:

Add an style block like

 .x-grid-col-0 {text-align:center}
 .x-grid-col-1 {text-align:left}
 .x-grid-col-2 {text-align:right}

And that's all just remember to change  .x-grid-col-n change the n for the column you want to modify.

Clean Up your Coldfusion application

22. October 2007 09:56 by Mrojas in General  //  Tags: ,   //   Comments (0)
Currently I'm working in some tools to clean
your code, whether it is VB, ASP or Coldfusion.

Mostly simple tools, but for now if you are a
ColdFusion Developer I want to recommend a nice
application called CF Project Cleaner
This tools lends you a hand so you can
get rid of unused files. The tool is not perfect. But it is always handy
to review your code.

MAN for .NET

5. October 2007 03:32 by Mrojas in General  //  Tags: , , , ,   //   Comments (0)
Microsoft recently published the MTPS Content Service

In brief, the MTPS Content Services are a set of
web services for exposing the content in
Microsoft/TechNet Publishing System (MTPS).


And Craig Andera, has develop a swift nice tool
called msdnman that you use from the command line to
get information from the MSDN

Also I recommend you to see this cool video of a Human LCD that Hugo sent me

Comparison Tool for Windows

4. October 2007 11:53 by Mrojas in General  //  Tags:   //   Comments (0)
If you need a good and FREE comparison tool
I recommend WinMerge

Input Line Too Long

3. October 2007 09:35 by Mrojas in General  //  Tags: ,   //   Comments (0)
I was trying to compile a C++ Project in Visual Studio
and this project has a post-build step that executes
some batch statements.

And succendly from one day to the other the project failed
and the only message I had was
The input line is too long


After some googling I found that this error is displayed
when the command line in the command prompt
exceeds the maximum number of characters.
(Something quite obvious jeje)

The bottom line was that recenlty I had installed
some software and my PATH variable became TOO long
I fixed it by creating a new environment variable
called EXTRA_PATH where I put some references to
Some big paths and then changed my PATH variable
replacing all those long variables for %EXTRA_PATH%.

And problem solved!

VB6 References Explorer

1. October 2007 11:22 by Mrojas in General  //  Tags:   //   Comments (0)
I recently found this decent tool called VB6 Reference Explorer.
It even comes with source code.

This tool will show a list of the references for a set of projects in your path.




Here at Artinsoft, some colleagues have develop
some tools that perform even more exhaustive
project analisys like CreateObject dependencies
and others. Maybe I'll post something about those
tools in the future

VB6 Printer Object and PrintForm migration

1. October 2007 10:55 by Mrojas in General  //  Tags: , , ,   //   Comments (0)

If you ever had any problems while migrating from VB6 Printer Object or the PrintForm functionality
we have goods news for you the Microsoft Visual Basic 2005 Power Pack 2.0.
Our version of the Visual Basic Companion already provides and extended migration of the Printer Object,
and we're now updating it to use this new implementation. This Printer Compatibility Library makes it a
breeze to migrate Printer Functionality.

This is the description of the PowerPack:

"The new Line and Shape controls included in this version of the Visual Basic 2005 Power Packs are
a set of three graphical controls that enable you to draw lines, ovals, and rectangles on forms and
containers at design time making it much easier to enhance the look of your user interface.
These new shape controls also provide events such as click and double-click allowing developers
to respond and interact with end users.

The Printer Compatibility Library allows projects that used the Printer and Printers Collection in Visual Basic 6.0
 to be upgraded without having to re-write your printing logic. By simply adding a reference to the library, declaring a
Printer and making a few minor syntax changes, your project will be able to print using the Printers collection
and Printer object as it did in Visual Basic 6.0. This version adds a new Write method to the Printer object which
allows you to print text without a forced carriage return similar to the semicolon syntax used by Print method in Visual Basic 6.0.

The PrintForm component is designed to bring back the ability to easily print a Windows Form.
With this the new PrintForm component you can once again layout the Windows Form exactly as
you want it and allow your users to print the form as a quick report."

You can download the PowerPack from here

NOTE: there's is another link that only includes the Printer Library but MS recommends to download the PowerPack
because minor upgrades and fixes will be done on the PowerPack distribution

 

IE7 Print shrink to fit problem

29. September 2007 17:22 by Mrojas in General  //  Tags: , , ,   //   Comments (0)
IE7 has an interesting bug...
Someone decided to change the printing default
to "Shrink to Fit".This is supposed to be good
because it will make printing of web pages better
but it affects several applications develop for
IE, for example if you are using the Web Access
to your Exchange server, or if you have an application
that prints on a page that is not a letter size page


Well a guy from a forum found an excellent solution.

The only problem is that he refers a hot fix,
but if you have problems with that hotfix, then
do the following:

1. Go to windowsupdate.microsoft.com

2. Make sure you have the following updates:

** Security Update for Internet Explorer 7 for Windows XP (KB938127)
** Cumulative Security Update for Internet Explorer 7 for Windows XP (KB937143)

And then run the following in the command prompt:
reg add "HKLM\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_STF_Scale_Min" /v iexplore.exe /t REG_DWORD /d 100 /f

Remove unused references VB6

28. September 2007 11:33 by Mrojas in General  //  Tags: , , , , , , , ,   //   Comments (0)

As part of the VB Companion Development group, my day to day includes
migrating several project from different clients, to develop custom mappings
and custom functionality for their migration needs or to add new features
for the next VB Companion version.

A long part of the initialization in the migration process consists of the load and
analysis of the COM references indicated in the .VBP project file.

Sometimes I have notice that there are several references that are never used.
Removing these references will provide a great save in time because the migration will
not have to incur in any time for TypeLib and TypeInfo extraction.

I look for a tool that let me get rid of the VB6 unused referencences but I found none.
So I decided to create one myself. And I created the VB6 Project References Cleaner Addin

The concept of the tool is simple, someone from a group posted the idea I just implemented.
The addin goes thru all the references and one by one tries to remove it.
And then compiles the project. It the project compiles,then the reference was not neccesary.
If you mark the remove option the tool will remove the references for you.

This tool will NOT SAVE the project file. You decide if you what to save it.

I'm attaching the source code and the dll. To used it just take the VB6References.dll and run:

  regsvr32 VB6References.dll
After that the tool will appear in the Addins menu in VB6 SOURCE CODE and BINARIES

 

 

 

VB6 API calls to .NET

27. September 2007 10:06 by Mrojas in General  //  Tags: , , , ,   //   Comments (0)
Every SERIOUS VB6 application, ended up requiring
that you import some functionality from the windows API or another DLL.
However if you were looking for a .NET equivalent and
google did not take you to the right page,
there is a document (a little old I might say) called
Microsoft Win32 to Microsoft .NET Framework API Map

I remember a couple of other pages that were even more complete,
but right know I can only remember http://pinvoke.net that gives some info about APIs

2008 is the final warning to move VB6 applications to .NET

27. September 2007 06:51 by Fzoufaly in General  //  Tags:   //   Comments (0)

Rob Helm, director of research at Directions on Microsoft, recently answered the question "Do the new releases of the Microsoft platform have an impact on the issue of upgrading applications from Visual Basic 6 to Visual Basic .NET?" with the quote that is the title of this post.

He said that the new platform updates really do not have an impact and that you should not wait any longer to move. He emphasized that after the end of support date for VB6 the support will only be through a special support contract with Microsoft that typically is "very onerous" and increasing every year.

Additionally, Rob Helm mentioned something that I had not noticed. Did you know the name of Visual Basic .NET is now officially only "Visual Basic"? Definetely another sign pointing at the future!

Coldfusion8 html cfgrid problem

26. September 2007 09:21 by Mrojas in General  //  Tags:   //   Comments (0)
We had a problem with a cfgrid
Coldfusion8 introduces an HTML cfgrid that is AWESOME!!!
It is something you should use.
It is based in the also excellent library Ext But recently we were extruglying with it because when we tried to capture exceptions in the update functions nothing happened and it was terrible because a real life application NEEDS exception handling. My code was something like this:
First file was places.cfc

<cfcomponent output="false">


<cffunction name="getData" access="remote" output="false">
<cfargument name="page">
<cfargument name="pageSize">
<cfargument name="gridsortcolumn">
<cfargument name="gridsortdirection">
<cfquery name="team" datasource="cfdocexamples">
SELECT Emp_ID, FirstName, EMail
FROM Employees
<cfif gridsortcolumn neq "" or gridsortdirection neq "">
order by #gridsortcolumn# #gridsortdirection#
</cfif>
</cfquery>
<cfreturn QueryConvertForGrid(team, page, pageSize)>
</cffunction>

<cffunction name="editData" access="remote" output="false">
<cfargument name="gridaction">
<cfargument name="gridrow">
<cfargument name="gridchanged">

<cfif isStruct(gridrow) and isStruct(gridchanged)>
<cfif gridaction eq "U">
<cfset colname=structkeylist(gridchanged)>
<cfset value=structfind(gridchanged,#colname#)>
<cfquery name="team" datasource="cfdocexamples">
update employees set aaa<cfoutput>#colname#</cfoutput> =
'<cfoutput>#value#</cfoutput>'
where Emp_ID = <cfoutput>#gridrow.Emp_ID#</cfoutput>
</cfquery>
<cfelse>
<cfquery name="team" datasource="cfdocexamples">
delete from employees where emp_id = <cfoutput>#gridrow.Emp_ID#
</cfoutput>
</cfquery>
</cfif>
</cfif>
</cffunction>

</cfcomponent>
 

and the second file was grid2.cfm:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function errorhandler(id,message) {
alert("Error while updating\n Error code: "+id+"\n Message: "+message);
}
</script>
</head>

<body>
<cfform name="form01">
<cfgrid format="html" name="grid01" pagesize=11
stripeRows=true stripeRowColor="gray"
bind="cfc:places.getData({cfgridpage},{cfgridpagesize},
{cfgridsortcolumn},{cfgridsortdirection})"
onerror="errorhandler"
delete="yes" selectmode="edit"
onchange="cfc:places.editData({cfgridaction},{cfgridrow},{cfgridchanged})">
<cfgridcolumn name="Emp_ID" display=true header="Employee ID"/>
<cfgridcolumn name="FirstName" display=true header="Name"/>
<cfgridcolumn name="Email" display=true header="Email"/>
</cfgrid>
</cfform>
</body>
</html>

And the problem where was it!!
It was not in any of those files it was in the application.cfm There was an onError handler. So it was commented out and everything work perfect! Well I just like to write down these little details so I don't make this silly things twice. I hope this can be of any help

Categories