Friday, April 30, 2004

Ever Thought of Triggering an IMS Transaction from MSMQ Message in VB

Well wondering how I am writing anything else than .Net... Btw, I also work on Asynchrounous Architecture a lot nowdays and thats another area which I have started liking other than .Net...
To tell you the truth we have figured out a way of triggering IMS Transaction by sending a MSMQ Message from VB6, if this gets you interested, drop me an email at Vishal_Joshi@MVPs.org and I shall write to you back about it... Meanwhile I am intending to compile a nice KB article on that...

Wednesday, April 28, 2004

10 THINGS "YOU SHOULD KNOW" WHEN UPGRADING TO VS.Net 2003 & .NET FRAMEWORK V1.1

The answer to the below question might be something which would probably hit the bull's eye.. :-)

What promts me to write a column on this topic ?
A friend of mine has a big web application built in Visual Studio .Net 2002... Needless to say after a long a difficult process they finish their round of testing and launch their application to production... Now the enterprise decides to upgrade their software and get Visual Studio .Net 2003, which as appearing everywhere is better in all the perspective than VS.Net 2002... Well, accepted but now here we have a healthy running project, relatively large one, already in production we do not want to fiddle around with it... But the service team of this application get their new machines with VS.Net 2003 installed and here is where the problem starts... And here are the considerations that I would like to put forward for folks who are in similar situations...

10 THINGS "YOU SHOULD KNOW" WHEN UPGRADING TO VS.Net 2003 & .NET FRAMEWORK V1.1

1.) You should know that Visual Studio .Net 2002 targets .Net Framework Version 1.0

2.) You should know that Visual Studio .Net 2003 targets .Net Framework Version 1.1... Framework Version 1.1 has lots of enhancements over 1.0 so definitely the change is for good...

3.) You should know that if you open an application created in VS.Net 2002 in VS.Net 2003, it will prompt for the conversion or if application is recompiled in VS.Net 2003 it will start targetting .Net Framework 1.1...

4.) You should know that if you do not recompile application will continue targetting .Net Framework 1.0, but then if you are servicing the application made in VS.Net 2002, you expect it to change in some way right!!... And if you change it to recompile, :-) refer point 3.)

5.)You should know that sometimes its big deal about targetting .Net Framework Version 1.1 for applications which were built in 1.0... well, its a big deal sometimes coz there are changes in the latest Framework version as compared to earlier... Many of the method signatures are obselete now and just to catch your attention few of them are listed below...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataCommonDbDataAdapterClassICloneableCloneTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOleDbOleDbPermissionClassctorTopic1.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlClientPermissionClassctorTopic1.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIObjectConverterClassctorTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclasscloneinternalstopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetipaddressclassaddresstopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIObjectConverterClassConvertValueTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOdbcOdbcPermissionClassctorTopic1.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebServicesProtocolsSoapHeaderAttributeClassRequiredTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxslxsltransformclassloadtopic7.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxslxsltransformclasstransformtopic1.asp

Now what about the applications which have been using the stuff that's obselete now... Think whether you want to use the latest version and upgrade your code or use old version and live as you are living...

6.) You should know that if you use VS.Net 2003 to open your project once and save it, it cannot be reopened in VS.Net 2002... Well ofcourse no one should expect back-ward compatibility, but you should be aware of certain things before hand right!!

7.) You should also know that both the .Net Framework versions can run side by side and you can configure which application targets which Framework version... If you think I should write a column on that configuration and way to do it then drop me a mail at Vishal_Joshi@MVPs.org

8.) You should also know that both Visual Studio .Net 2002 and Visual Studio .Net 2003 can exist side by side on the same machine as well... Even Whidbey can still co-exist with those two... But mind you don't try it... I tried doing all those things and some supernatural powers made all my applications stop working, finally I did what a frustrated developer does, i.e. uninstall everything and install only VS.Net 2002 with .Net Framework 1.0... Well this is just Vishal Joshi, I did everything possible and nothing worked out, you may try might be you do it right!!

9.) You should know that if .Net Framework V1.1 is installed on your machine ASP.Net and Web Services will automatically target .Net Framework V1.1 unless otherwise configured... A gentleman called Denis Bauer developed a utility called ASP.Net Version switcher, which is available free for download... This utility is really useful at times to switch the Framework version your ASP.Net application is targetting and if you need to get it Click Here... Well you can do this configuration manually as well but aren't we moving towards automation :-)

10.) You should know that rest of the applications made in any Version will run with the version they were made to target, unless they are configured otherwise... As mentioned earlier applications built to taget V1.1 will not work on V1.0 (disclaimer: unless otherwise designed & configured)

Feel free to write in your comments to me at Vishal_Joshi@MVPs.org... I am ready to make the title "More than 10 Things you should know when upgrading to VS.Net 2003 and .Net Framework V1.1"

Should I copyright this??? Just kidding!!


Wednesday, April 14, 2004

Creating COM Callable Wrapper (CCW)

Query on using .Net components in VB6

-----Original Message-----
From: Anup Ganji
Sent: Wednesday, April 14, 2004 10:05 AM
To: Vishal Joshi
Subject: Help Required!!

Hi Vishal!
I request for a small help from you, for which I would be talking some time of your's.
A friend of mine is facing a problem in accessing a dot net (C#) coded component in VB6.0, I heard that if could come up with a wrapper around the dot net coded component you can access it from lower versions.

Waiting for more inputs from you.

Thanks,
Anup


A Quick Solution

-----Original Message-----
From: Vishal Joshi
Sent: Wednesday, April 14, 2004 10:33 AM
To: Anup Ganji
Subject: RE: Help Required!!

Hi Anup,
It is very true that by making minor changes to C# component it can be made visible to com components… There are certain attributes and steps that we need to follow for this…. These attribute informs the CLR to generate CCW(Com Callable Wrapper) which creates the Interface by which VB6 components can call C# components…
Its been long time since I wrote such component but the basic steps should be as follows…
In you C# component use using System.Runtime.InteropServices;
Now we need to create a interface with the same name as your .Net class only with "_" in the beginning… Precisely speaking in this interface you will write only those methods which have to be exposed out of your .Net component
Eg
using System.Runtime.InteropServices;
using System;
namespace SameAsClassesNamespace
{
[Guid("use GUIDGen.exe to create GUID for urself")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _MyNetComponent
{
//ur method signatures will come here
}
}
Remember the attribute InterfaceType is important here as it tells which kindof ComInterface is required…
Now in your class following are the modifications to be made…

using System.Runtime.InteropServices;
using System;
namespace SameAsClassesNamespace
{
[Guid("use GUIDGen.exe to create GUID for urself")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("SameAsClassesNamespace.MyNetComponent")]
public class MyNetComponent : _MyNetComponent
{
//ur method definition will come here
}
}
Now go to project properties --> Configuration Properties and set last two properties (Register for Com Interop & Create Debug information) to true… Well this can be done manually but no big reason to go about doing it… {Find out more about Regasm.exe, sn.exe, gacutil.exe if you are interested in doing it manually, but better don't…}
Now as you compile your component should be visible to COM… And ofcourse you know the ProgId above to use your component...
Enjoy!!

Warm regards,
Vishal Joshi
Ph#: +1-309-763-2242.
If You Think YOU CAN.. You Can...

Thursday, April 08, 2004

Press Release From Microsoft on MVP Global Summit 2004

MS Press Release

Info on E-Week

A Quick Tip on long length URLs

You must have faced problems about line wraps when you send a really long URL... Well, might be many of you know this but just FYI...
When a URL is pretty long and you need to send it in an email or paste in in a word doc, all you need to do is to put a start the url with "<" and end with ">"... Everything included within these operators will be considered as a single URL...

Monday, April 05, 2004

MVP Global Summit 2004 - A Melting Pot

MVP Global summit going on from 3rd April 2004 to 7th April 2004 is truely a melting pot of different thoughts and same passion - Microsoft Technologies...
Just in two days I have met people from more than 20 different countries and all of them were such amazing guys/gals...
I am just coming after attending a session by Don Box and Chris Anderson, and there are no words to express how you feel listing technology from the guys who make it...
I am overwhelmed thats all I can say... More on MVP Global Summit to come...