DoEvents?? in .NET

7. May 2007 08:51 by Mrojas in General  //  Tags: , ,   //   Comments (0)
This is small Example. I had a POS Application in VB6 with this code. Me.EpsonFPHostControl1.SendCommand While EpsonFPHostControl1.State = EFP_S_Busy DoEvents Wend This code is almost the same in VB.NET Me.AxEpsonFPHostControl1.SendCommand() While AxEpsonFPHostControl1.CtlState = EpsonFPHostControlX.TxFiscalState.EFP_S_Busy Application.DoEvents() End While

Migration of VB6 POS

7. May 2007 08:46 by Mrojas in General  //  Tags: , , , , , ,   //   Comments (0)

POS (Point of Sale) software is everywhere. Whether you're at a Bar, at Denny's, Pizza Hut, BK or at the Duty Free. It is maybe one of the software's more commonly used. A POS system is generally simple. It manages a basic inventory, registers sales, and somethings manages credit card payments. Obviously there are far more complex POS systems. A lot of POS systems where programmed in VB6. But as you know VB6 language (and I'm not discussing the reasons here) is now a dead language. A lot of customers do not want to buy VB6 applications, even if they get the job done. So it's time to move on. This is the First of a series of posts around issues migrating VB6 POS applications. If you have any comments just send them now!

Events not firing in ToolPart

2. May 2007 10:35 by Mrojas in General  //  Tags:   //   Comments (0)
I was developing a WebPart and I came up with a situation where my custom ToolPart did not fired the events. I found this post that solved the problem. " I moved the databinding code into the CreateChildControls() code: protected override void CreateChildControls() { dllCatagory = new DropDownList(); dllCatagory.Visible = true; dllCatagory.AutoPostBack = true; dllCatagory.Attributes.Add("runat", "server"); dllCatagory.SelectedIndexChanged += new EventHandler(dllCatagory_SelectedIndexChanged); CdCatagoryList.CatagoryList cdCatL; cdCatL = new CdCatagoryList.CatagoryList(); //cdCat.Catlist is a dll that will get the data. DataView tviewFolders = cdCatL.CatList(true, "cdadmin", "", "server=192.168.221.246;uid=DataSa;pwd=pa456;database=ContentDepot"); dllCatagory.DataSource = tviewFolders; dllCatagory.DataValueField = "FolderNumber"; dllCatagory.DataTextField = "FolderName"; dllCatagory.DataBind(); Controls.Add(dllCatagory); } public void dllCatagory_SelectedIndexChanged(object sender, EventArgs e) { //Code to load the gridview //This event now fires} protected override void RenderToolPart(HtmlTextWriter output) { EnsureChildControls(); dllCatagory.RenderControl(output); } "

How to get a machine to use a specific pxeboot file with WDS?

1. May 2007 15:36 by Csaborio in General  //  Tags:   //   Comments (0)
We are racing against time to get an application ready that needs to deploy images with WDS and Active Directory.  This is the latest problem I have encountered:

Ok, so based on this article (http://technet2.microsoft.com/windowsserver/en/library/383538a3-4129-4205-b363-d36b08e22ca81033.mspx?mfr=true) , when using WDS and having the machine boot, you can bypass the F12 keypress by replacing pxeboot.ini by pxeboot.n12.  This works like a charm, all machines that boot into the PXE server bypass the F12 key.   However, I would like to specify which machines should boot fron pxeboot.com and pxeboot.n12.   I generated an Excel sheet that has the info required to prestage the client on the AD.  This is what I have entered on the 4th row:

SERVER01   GUID    Location....  \\wds_server_name\reminst\Boot\x86\pxeboot.n12

This pre-stages the machine on AD and based on what I have read, will point the machine (identified by its GUID to boot from the pxeboot.n12 file).

I have used the script called "PrestagRISCInt.vbs" (found here: http://www.microsoft.com/downloads/details.aspx?familyid=aaf0a7a4-71c1-4ee9-b974-66214651a23b&displaylang=en) and issued the following command:

cscript /InputFile:C:\Foo.xls /Server:hpc-dc

After a short wait, I get the following message: "Success creating new computer accounts in Active Directory based on UUIDs!"

When I boot tha machine, it still requests F12 to be pressed, which means that it is STILL using pxeboot.com to boot.  

I have followed all the instructions carefully, any idea on what the problem might be? 

Extracting images from a word document

30. April 2007 10:48 by Mrojas in General  //  Tags: ,   //   Comments (0)
I recently had a situacion where I needed to extract images from a word document. This can be cumbersome, tedious and you can loose the fidelity of your images I found two good aproaches: first see Approach One. This approach indicates to save the document as a web page. In my case I needed images with a sequence I could follow. Like Figure1 Figure2 etc and I needed them with the best quality possible. So I used another link recommended Approach Two which has a macro that you can use to export your image as bmp. Those two links were of great help to me. I recommended them.

Go Away, F12! (or how to disable F12 at bootime to boot into WinPE)

30. April 2007 05:52 by Csaborio in General  //  Tags:   //   Comments (0)

While looking for a way to fully automate the installation of wim image file to a server, we immediately stumbled upon a small problem.   When doing a PXE boot, the boot rom imaged asked for the F12 key to be pressed.  If the key was not pressed, the machine booted normally into Windows - so much for the automation idea, huh?

Fear not, as Stephen sent me a link that explains the following from a RIS installation:

"...To enable a fully automated RIS-based installation, it is necessary to substitute the Startrom.n12 boot file for the default Startrom.com boot file..."

Further reading revealed this vital piece of information:

To configure all clients serviced by a RIS server with an automated installation, rename the startup boot files as follows:
• Change Startrom.com to Startrom.bak
• Change Startrom.n12 to Startrom.com

These files are located in the following directory location on your RIS server:

RemoteInstall\OSChooser\i386

There are certain differences between the RIS and WDS installations, but nothing big.   First off, the location of the files for boot time (given that it is a 32-bit box is the following):

\\WDS_Server_Name\reminst\Boot\x86

There you will not find Startom.com and Startrom.n12, but rather pxeboot.com and pxeboot.n12.

If you rename pxeboot.n12 to pxeboot.com, your machine will PXE boot and will NOT ask for F12 key press.   Ok, now that the problem is solved, we can go back and try to find solutions for the remaining 500.

Get IP Address for Db2 clients

26. April 2007 09:14 by Mrojas in General  //  Tags: ,   //   Comments (0)




Source IP for connected applications in DB2

Usually when there are performance problems you need to track who is connected to the database. Especially in development environments because production environments are more restricted with who has access to the DB.

You can easily list the applications connected to your DB2 database using the control center application or from the command line.

From the control center:

  1. First check that the Objects Detail Pane is active

  1. In the Objects Details Pane, click the application list link

  1. This will open a window like this:

From the command window just do something like:

DB2 LIST APPLICATIONS

Now to get the real juicy and useful information execute from the command line:

DB2 GET SNAPSHOT FOR APPLICATION AGENTID ###

And use the number that is under the Appl. Handle column, this will show the ip address and other info.

Workaround for OCX State Problem (VMRC Active X)

26. April 2007 04:31 by Csaborio in General  //  Tags: ,   //   Comments (0)

On a previous post I was having problems with the VMRC ActiveX control when creating an instance at runtime.  The problem boiled down in having an invalid OCX state exception thrown at me whenever I tried to access a property of the VMRC ActiveX control at runtime.

After researching for quite a while on the Internet, it struck me that if I just placed the VMRC ActiveX in a UserControl at Design time, and instantiated that UserControl instead of the ActiveX directly, things would work great.  I implemented this into the VMCA application and it worked perfectly fine.   You can see I managed to get VMRC connections to different machines in different tabs at runtime on this post.

Some people have asked where they can get a copy of the VMCA.  Unfortunately as of now, the application hasn't been thoroughly tested and is missing some functionality which I deem as basic.  Also, this is something I have been working on my spare time and lately I have been swamped with other projects.  Perhaps the best approach would be to take it to stable phase and then try and get it on CodePlex so that everyone can pitch in...we'll see how that goes.

For all things related to software migration, be sure to visit Artinsoft's website. For training in Visual Basic to C# migrations, Visual Basic to VB.Net, Virtualization, and 64-bit training check our training web page.

WinPE 2.0: Lessons on capturing images

25. April 2007 15:33 by Jaguilar in General  //  Tags:   //   Comments (0)

This past two weeks I have been working on a deployment that involves technologies like PXE, WinPE, Windows Deployment Services, the Windows Automated Installation Kit, and others. I was stuck for a while with WinPE, having issues when trying to capture a Windows image using the WDS Capture disk.

Most of the issues I had were driver-related. When I started, neither the network nor the hard drive of the machine (SATA drivers!! argh!!) were available to WinPE.

So, I did the following:

  1. Get the storage drivers from Intel’s website. You can download them from here. Make sure you download the Vista version of the drivers.
  2. Unpack them on a temporary directory. In my case I ran:
             iata621_enu.exe -A -PF:\intel
  3. Mount the Capture WinPE 2.0 wim image (generated through the WDS console) to a directory:
             imagex /mountrw d:\temp\capture.wim 1 d:\temp\wpe
  4. Copy the file C:\Program Files\Windows AIK\Tools\x86\imagex.exe to d:\temp\wpe or where you mounted the wim image).
  5. Now, add the drivers to the WinPE image with the following command:
             peimg PF:\intel\*.inf d:\temp\wpe\Windows
  6. Unmount the WinPE wim image:
             imagex /unmount /commit d:\temp\wpe
  7. Add the WIM image to WDS. On the console, select Windows Deployment Services->Servers->->Boot Images->(Right Click)->Add Boot Image, and browse to the WIM you just unmounted
  8. Boot the target machine using PXE and make sure it loads the correct WIM image
  9. Ok, so here is where I had issues:
    • First, the WDS Image Capture Wizard didn't list the SATA drives. Turns out the driver loaded correctly, but for some reason it couldn't see the drive.
    • If you run into an issue where the driver won't load, try using the drvload command from the WinPE command prompt..
  10. Because of those issues, I had to fall back to the command line. To do this, press Shift-F10 in the Capture Wizard, and that will open a command prompt.
  11. Once in the command prompt, create the image using imagex:
             imagex /capture c: c:\myimage.wim "My Image" /compress maximum
  12. With the image created, map a network drive on the server, and copy it back:
             net use i: \\\share * /user:
  13. Copy the image back to the server (I: drive)
  14. Turn the machine off.
  15. Enjoy your newly captured image!!!!

System Center Virtual Machine Manager Beta 2 is out

25. April 2007 06:21 by Jaguilar in General  //  Tags:   //   Comments (0)

Today Microsoft released the Beta 2 of Carmine System Center Virtual Machine Manager. This Beta 2 release adds long-awaited functionality, like P2V and V2V migration, among others. From the release notes:

  • Completely new look-and-feel (same as System Center Operations Manager 2007, Service Desk and System Center Essentials)
  • Physical-to-Virtual (P2V) Conversions
  • Virtual-to-Virtual (V2V) Conversions
  • 64-bit VMM server support
  • EveryVMM component is now remotely installable
  • Full Windows PowerShell support
  • Better overall performance and scalability
  • Every feature from Beta 1 with more functionality and enhancements

I am currently downloading it, and will post back once I get a chance to play with it a little bit. One of the features that I’m dying to try out is the Powershell support – as powerful as vbscript is, I’m not particularly fond of it, and replacing its use on yet another MS product is another step in the right direction.

You can download Beta 2 from https://connect.microsoft.com/vmm. Remember you have to register first!

Ok, there's one more... another Virtualization Lab scheduled!

24. April 2007 07:45 by Jaguilar in General  //  Tags:   //   Comments (0)
Last week it seemed that the Paris and Zaragoza events were going to be the last ones in the Virtualization for Developers lab series. Well, due to popular demand, there's a new lab scheduled for Singapore, on May 16-18. Click the link to sign up, or check out the series at the Virtualization for Developers Lab Series homepage.

Quicksand at the comfort zone

23. April 2007 11:02 by enassar in General  //  Tags:   //   Comments (0)
I’ve seen recently an increase in the number of people with business critical applications written in Visual Basic 6.0 that are looking more actively towards making the transition to the .NET platform. I think that this may have been triggered in part by the proximity of the end of Microsoft’s extended support for VB 6, in March 2008 (mainstream support ended 2 years ago). For Independent Software Vendors specially, this is a source for considerable market pressure. According to some analysts, most people moved to .NET because of the demand from clients or for the need to keep up with the latest trends, aside from the platform’s own capabilities and features, of course. In the past, there’s been a consistent lack of perceived need for .NET among VB 6 developers, but .NET usage continues to increase from year to year. And with more successful migration stories every day and a broad range of related resources and incentives available (take for example Microsoft’s NXT initiative for ISVs), many are starting to consider the .NET upgrade as an unavoidable step to avoid the legacy quicksand.

<Blog>

OK. So finally, after months of encouraging my colleagues to post their thoughts and experiences on this domain, I decided to start my own blog. Yeah, well, it probably should have started the other way around, but you know what they say: "Shoemakers’ wives go barefoot, and doctors' wives die young". Having worked at ArtinSoft's marketing and customer service departments for years, it's only natural to write about the market/business side of the software migration world (motivations, advances, tips, experiences, issues, achievements, statistics, etc.), specially around Visual Basic to .NET upgrades. But you should also expect some random stuff thrown in once in a while.

Sign up for the last Virtualization for Developers Labs!!

20. April 2007 05:51 by Jaguilar in General  //  Tags:   //   Comments (0)

In a couple of weeks we’ll have the last of the scheduled Virtualization for Developers Labs. The two labs will take place on the same week – one in Zaragoza, Spain, on May 8–10, and the other one in Paris, France on May 9–11.

If you are interested in Virtual Server, the upcoming Windows Server Virtualization, or Virtualization in general, I suggest you check them out. So far we’ve had some great reviews of the labs, and it is a great opportunity to get hands-on training with Virtual Server and its APIs.

 

Spring Cleaning or How to Optimize the Performance of Your PC Using a Free Tool

20. April 2007 04:53 by Jaguilar in General  //  Tags:   //   Comments (0)

Ever since we saw this post over at the Virtual PC Guy’s Weblog, we have been using Dave Whitney's Free Defragmenter on our virtual machines’ dynamic VHDs to improve the compaction process. The results so far have been great – we have managed to shrink dynamic VHD files to levels far beyond what we could with the standard Windows Disk Defragmenter.

This week I decided to do a little spring cleaning on my work laptop. I installed Windows on it around 2 years ago, and have been installing/uninstalling tons of software ever since. The machine, predictably, had become painfully slow.

Yesterday I managed to remove about 3.5GB of old software and files, leaving the hard drive horribly fragmented. So I decided to leave the Whitney’s defrag tool running overnight… today in the morning I am surprised on how responsive it is! Outlook now takes a few seconds to startup (with a multi-GB pst file), compared to over a minute yesterday. And I can’t believe how quickly the Windows Live Messenger and Visual Studio .NET 2005 started up. I was so surprised, I even decided to write about it here!

HOT TIP: I also recommend an utility called CCleaner to help you optimize your system. It removes all sorts of temporary files and safely cleans up the Registry. I my laptop it freed up around 750MB!

Virtual Server 2005 R2 SP1 RC

19. April 2007 09:08 by Jaguilar in General  //  Tags:   //   Comments (0)

You can now download the Release Candidate for Virtual Server 2005 R2 SP1 from https://connect.microsoft.com. Remember that you need to be registered in the beta program to be able to download the files.

This release contains bug fixes from Beta 2 – other than that, it doesn’t have any additional functionality.

Virtual Machine Configuration Assistant

13. April 2007 06:07 by Csaborio in General  //  Tags: ,   //   Comments (0)

As I previously mentioned, I've had some chance of working on the application dubbed as the Virtual Machine Configuration Assistant in the last few days.   One of the most noticeable changes are the GUI.  This is the old GUI of the app:

ZZ6A980B2C

This is the revamped, improved version:

ZZ1AC07DEE

The application has undergone major revisions under the hood.  I have tried to separate tasks into different classes in order to gain modularity.  So far I have a VMManager, a VHDManager, a VMRCManager and so on.  Reading the code now makes a lot more sense than before.

This is the part in which most of the work has been lately done, the Disks tab:

ZZ33FBC3C2

From here, you can pretty much do anything related with VHDs.  After modifying some ISOs,  I have also managed to completely automate the defragmentation-precompaction-compaction phase required to reduce the size of VHDs.  Now I just leave the process running and when I arrive the next day, my VHDs are like 50% smaller.

I had not touched C# in a while, and all I can say is "Wow".  C# rocks, it is very intuitive and creating efficient GUIs is a bliss.  One can only wish that there was a 2.0 framework to run under OS X.

I have also fixed the problem with OCX stats at runtime - actually it was a workaround, not a fix.  Here is a video I made of some of the features of the application, which include:

  • VHD Attachment
  • VHD Creation
  • VM Creation
  • VMRC in tabs for each of the machines
*sigh*...It has been impossible to embed the video here, here is the youtube link.

In case the resolution of the movie above is too small, the avi can also be downloaded.

For all things related to software migration, be sure to visit Artinsoft's website. For training in Visual Basic to C# migrations, Visual Basic to VB.Net, Virtualization, and 64-bit training check our training web page.

Problems Creating a VMRC ActiveX Instance at RunTime

9. April 2007 06:40 by Csaborio in General  //  Tags: ,   //   Comments (0)

During the Virtualization labs, which are freely available to anyone interested in Virtualization, the Artinsoft trainers have had a chance to teach the Virtual Server COM API and its uses.  One of the attendees showcases the application that they build on his blog. I think the application in its finished state is a great start to create something functional, but it is in no way something that can be used for management right out of the box.  The reason for this is simple: we wanted simple in order to reduce the learning curve of the COM API. 

I have started to work on my spare time on a new version of the Virtual Machine Configuration Assistant (VMCA) which will be version 2.0 due to major UI overhaul it has had.   One of the cool things I wanted to do, was the ability to open VMRC connections within the app in tabs (gotta love tabs in everything!).  So here is the interface I have so far (click on the image for larger view, as it has info on what I am trying to accomplish):

ZZ5B4D2238

Sounds easy, huh?  Well, that is what I thought.  I have in my application the reference to the VMRC ActiveX control, the image that you see above depicts a VMRC instance placed on the form in Design Time.

When the user selects the VMRC option, I have the following code:

vmrcControl = new AxVMRCClientControl();
vmrcControl.ServerAddress = "vs02";
vmrcControl.Size = new System.Drawing.Size(985, 675);
//Add a New Tab
this.tabPage1 = new TabPage();
tabPage1.Text = VMCA.VirtualInstances.getVMInstance().Name;
//Add the VMRC Control
tabPage1.Controls.Add(vmrcControl);
vmrcControl.Location = new System.Drawing.Point(0, 0);
this.tbcVMRC.TabPages.Add(tabPage1);
vmrcControl.UserName = "Administrator"

The line in red below is where all hell breaks loose:

ZZ735D6EE2

The problems seems to be that at design time, the VS Designer creates and configures a resource that is used to keep track of the ActiveX instance's state.  At runtime, this resource does not exists and that is the reason why the ActiveX is an invalid state.  Not being the ActiveX hacker that I would like to be, I am baffled on this problem.

Have you ever suffered with a problem such as the one above?  I have looked for help at various locations without any luck.  Although not critical, this feature is something that would definitely rock.  Help me solve this problem and I will send you a couple of pure quality Costa Rican coffee wherever you may be (if you are in Costa Rica, I'll send you beer instead ;)

I have posted a project which repros the problem:

http://amd.streamload.com/artinsoft/Links/5B75335893

In order to repro, just debug the app, and from the menus select Remote Control...if you can somehow make it through without the invalid OCX state exception, you are right on the money.

UPDATE: In order to run the project above, you *need* to have the VMRC ActiveX control installed on your machine.  The following page will guide you with the necessary steps to complete this process: https://www.microsoft.com/resources/virtuallabs/installactivex-technet.aspx

For all things related to software migration, be sure to visit Artinsoft's website.  For training in Visual Basic to C# migrations, Visual Basic to VB.Net,  Virtualization, and 64-bit training check our training web page.

Ideal Profile of a Developer in a Software Migration

30. March 2007 14:48 by jpena in General  //  Tags:   //   Comments (0)

During the planning stages of a migration project, many customers ask about the ideal profile that the members of the migration team should have. The job of migrating an application is very technical, so having skilled developers is a must. After several migration projects, we have identified a basic set of characteristics that are very desirable in the developers that will port an application to a new platform:

  • Advanced knowledge of the target platform: while migrating the application, developers will face the challenge of implementing a set of features and behaviors of the source platform that are not directly available in the target technology. This cannot be achieved without a high degree of knowledge of the destination platform.
  • Knowledge of the source platform: it is also very important for team members to know the expected behavior and results of commonly used features of the source platform, especially those that are not directly supported in the target technology.
  • Migration knowledge and experience: naturally, having developers with previous experience in migration projects is quite helpful. As these developers are not very common, here is where ArtinSoft consultants are most helpful in a joint migration project.
  • Knowledge of the application to be migrated: during the migration process, many lines of code, methods and classes of the original application will have to be manually changed or adjusted to work in the new platform. Since there will be a constant modification process until the application reaches Functional Equivalence, knowledge of the internal structure and coding of this application is very desirable. In a joint migration project, here is where customer’s developers are most helpful.

Why can't I delete a file in Windows?

19. March 2007 12:09 by Csaborio in General  //  Tags:   //   Comments (0)

Ever had this happen to you?:

ZZ79C5CB0A

I think this is the most annoying message that Windows has (OS X has one similar which is not very useful in letting you know what the problem is).  IMHO, I think that if the OS is informing you about an attempt to delete a file that has a handler open, it should be smart enough to tell you one thing: which is the application/process using it!!!

Fear not, as there is a workaround for this.   Unlocker is a (free) utility that will give you this info.  Once installed, it is a contextual menu:

ZZ3BE71A04

Unlocker will then present you with a dialog that will let you deal with the situation:

ZZ1D140288

One less Windows nuisance to worry about.  Credit where credit is due: Stephen was the person who referenced me to this program.

For all things related to software migration, be sure to visit Artinsoft's website.  For training in Visual Basic to C# migrations, Visual Basic to VB.Net,  Virtualization, and 64-bit training check our training web page.

Categories