by
drydo via
Drydo (Mark Dryden)
on
10/21/2008 6:23:00 AM
Is it me or is coding getting easier and more fun. So, I've been handed a no-brainer project, its needs to be dynamic and database driven with a tiny little dataset. Initially I wanted to run with a pure XSLT approach, however, I wanted the strength of using Master Pages and themes as there was going to be a few static pages involved and I couldn't see the point of creating specific XSL templates or xml to fit into my scenario. The alternative, in my eyes, was a good old AS ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
4/23/2008 1:34:00 PM
So firing up Expression Blend and getting into the whole WPF thing is always a refreshing change, especially getting away from mundane coding and alike. However, the first thing to trip me up and my colleague up was using the "Edit Externally" command from the project view to edit an existing '.png' file and whipping into my favourite graphics editor. Imagine my surprise when I was greeted with MSPaint! How there are two things to consider here...
I used to be a design guy prior to be ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
3/26/2008 4:07:00 PM
A very quick one. Been playing with the above class for generating emails in .NET 2.0, embedding images within HTML views which is rather cool. However, I noticed an unusual problem. The emails I generated in my test project would not send until I had exited the application. It was almost like it would only 'flush' the generated email once the application had unloaded. Interestingly, if I attempted to send the email using the 'SendAsync' method, it would fire the SendCompleted event but st ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
3/3/2008 4:42:00 PM
To be quite frank, after 3 months of ASP.NET development, the opportunity to do some down and dirty API programming really appealled to me today. So, the question (as indicated by the title) involved a member wanting to disable the right-click context menu from the Flash ActiveX component when being used in a WinForms application. (See previous blog entries for examples of Flash in VB.NET and communication between the two such as http://blogs.vbcity.com/drydo/archive/2005/10/18/5586.aspx ). ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
1/28/2008 11:22:00 AM
I guess as developers we're used to solving the difficult problems, this task isn't working because of dependancy X, Y and Z - so we code around that, handshake with this and validate the other. But as a developer its always the simple things that catch you out.
For instance, I've spent the last 4 hours messing around with loading a comma delimited textfile into a typed dataset using one dataadapter, do some funky things to it and then upload those records into an SQL Server using an SQLDat ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
1/24/2008 9:55:00 AM
This course was created for the VBCity Academy where you can take online courses for free. Unfortunately, the material I wrote is something I constantly want to keep linking to - so I've decided to place the course up as a flat article.
I fully recommend that the take the course through the Academy where the structure and flow of the course should make a little more sense - however, if big long documents are your thing - check out the article at http://blogs.vbcity.com/drydo/articles/8959. ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
12/5/2007 11:36:00 AM
OK - this is a bit of a shameless plug so apologies in advance.
As most of you may (or may not) know I'm a keen cyclist and during the summer I tend to cycle into work as much as possible (20 mile round trip). Its good fun, it makes me feel like I'm keeping fit and satisfies that little eco-nazi inside of me. However, when the nights draw in I tend to either commute by Motorbike or Car, but not this year...
So I'm all togged up with my various winter gear and alike to brave the winds, ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
10/17/2007 10:01:00 AM
On forum today I saw an interesting post where I had advised the ORPO that a datareader could be binded to combobox, having worked on ASP.NET for the past months now its easier than falling over as you can use the 'DropDownList' object. However, for the Windows Combobox object ( regardless of web based development semantics ) you cannot do this as it will pipe up with the friendly...
"Complex DataBinding accepts as a data souce either an IList or an IListSource"
Anyhoo - fix provided kin ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
10/10/2007 4:28:00 PM
Just an old code snippet that I've dug out for a new project from an old VB6 project and thought it would be beneficial to post up but I start doing my VooDoo. In short, the following will detect the insertion and detection of USB key devices, CDs and DVDs. It doesn't detect the insertion of specific USB devices (at least not the devices arrayed in front of me) - but feel free to play with the code and the Hdr.devicetype parameter.
Anyhoo, create a new form and paste the following in...
... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
10/2/2007 10:03:00 AM
I've been involved in an interesting post where a member wanted to create a Global Exception Handler. As an absolute purist of course, I recommend that an adequate testing phase should eradicate virtually all errors, barring those that are effected by outside elements, e.g. FileSystem, Database(s), Networking, etc.
Anyhoo, we initially started off utilising the 'AppDomain.UnhandledException' event and whilst this certainly worked in the Development Environment, if it was ran as a normal e ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
9/28/2007 2:25:00 PM
Importing a TextFile into a Database using a Dataset
This question comes up a bit on the forums (twice today already) where the user wants to import data from one Datasource (such as a TextFile) into a database (SQL Server / Access / Whatever). Now in the case of SQL Server my natural reaction would be to suggest DTS for SQL 2000 or check out some of the new cool features of SQL 2005 (which I've yet to experience). However, there are occasions - especially if some processing needs to be perf ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
9/19/2007 11:18:00 AM
I love starting new projects with a new technology and recently the requirement for an ASP.NET 2.0 custom reporting module landed on my desk. I have some ASP.NET 1.1 experience having created a couple of sites about two years ago but that was it.
Keen to implement some of ASP.NET 2.0's cool features I came across the Membership, Roles and Profiles features @ http://www.4guysfromrolla.com and was impressed by how easy it was to generate a robust authentication system from scratch utilising R ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
7/25/2007 2:11:00 PM
Just a tiny post after another break of sorting out the house selling junk on eBay.
Today I saw a post on the VbCity Forums where the ORPO wanted to delete a portion of files from a directory using a search pattern. The answer was to utilise the 'IO.Directory' or 'IO.DirectoryInfo' class's 'GetFiles' method then loop through the result deleting the appropriate 'IO.File' or 'IO.FileInfo' object. However, ORPO's being ORPO's wanted to perform this action in one line.
Anyhoo, after comin ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
5/24/2007 10:48:00 AM
Well, it's been a fun couple of days messing with the Micro Framework and overall I'm impressed. Sure - the .NET Micro Framework doesn't have the XML namespace, but it is a *Micro* framework people.
Anyhoo, I've managed to code up some simple applications such as an image viewer that could move between image, which I then improved so it moved between images and used an alpha transition between each one. And I've also been messing the SerialPort class to just send some simple commands to ou ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
5/22/2007 2:37:00 PM
A couple of months I got to go over to Seattle to the MVP Summit and surprising amongst the many meals out and occasional port's sniffed, I did actually check out some cool stuff. One of the most notable (for professional and general interest reasons) was the .NET Micro Framework.
Anyhoo, a slot came up in my schedule for some R&D work and we purchased the 'Tahoe Development Platform' from EmbeddedFusion.com for $299.99 - an absolute snip and at the time of writing the only one th ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
5/3/2007 10:35:00 AM
Quick background - I haven't much XML experience. Sure I know what it is, I love using it with datasets and can navigate an XML document if pushed. However, I know there's an awful that it can do that I simply haven't had time to probe.
So, a post came up in the VBCity forums the other day about taking a RSS and passing that data into a dataset. "Unlikely" I scoffed and it wasn't until the next day biking into work (some 11 miles you know) that it occured to me that why shouldn't it? O ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
4/18/2007 9:40:00 AM
WooHoo - back into actually doing some development after a stint doing some Flash Actionscript work and conducting a 4 week testing phase (possibility one of my favourite tasks).
Anyhoo, let's say you're trying to update a UI element from the non-UI worker thread using similar code to the following...
=0 && i h)ch.style.height=h;" sel=1 selold=1 selcount=3> Code Copy Hide Scroll Full ' Single form, one button called 'butExecute' and one label called 'lblTime' Private ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
1/31/2007 4:16:00 PM
As most developer type bods, debugging problems on deployed software can be an arduous task at best. Sure, tracing and asserts are great tools to be utilised and the JIT Debugger is cracking allowing the debugger to view the call stack as well as a plain text explanation of the unhandled exception. Well, using Framework 1.* that was the case.
However, after deploying a Framework 2.0 application to a Windows XP Home (SP2) machine with all the usual critical patches installed, etc. a nasty l ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
9/11/2006 2:19:00 PM
I know it’s been a while. It could be you - it could be me - but hey - at least I'm taking some responsibility in this relationship.
Well, the summer's been kinda fun, changing job, not leaving said job, lots of family stuff and general messing around. During this messing around I succumbed to moving to Firefox as my main browser and whilst there are some fun elements with just the basic install; it was the various plugins the really impressed me. Now I won't run through all of the plu ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
6/15/2006 11:14:00 AM
I've been working on a fairly intensive VB.NET VS2005 solution over the past couple of weeks and have been somewhat shocked by the amount of memory usage VS2005 seems to gobble up. In fact, I managed to hit 600Mb of memory usage at one stage - and that wasn't including the other two solutions I had open that running at around 80Mb and 200Mb. That's pretty greedy IMHO. It initially starts at a respectable 20-40Mb then creeps up depending on which actions you then take.
Anyhoo ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
6/9/2006 10:47:00 AM
I've seen three posts in the past week or so about this subject and thought I would post up my quick code sample for achieving the above. The basic principal for hittesting on a non-rectangular shape, e.g. polygon, is to represent your shape within a graphicspath, then create a new Region based upon that GraphicsPath and invoke the 'IsVisible' property of the region, passing through the X and Y co-ordinates.
The following demonstrates this using the 'VBCity' logo ( http://www.vbcity.com ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
5/30/2006 12:11:00 PM
Thought I'd punch this little fella up for your perusal. Basically, it’s a base control that's resizable at runtime allowing the user to resize the control to whatever size (although I have implemented a minimum size check - check out the comments). I've seen a couple of people / organisations that are selling similar items and rather than take the path of least resistance ;-) - I'd thought it would be fun do one myself.
Anyhoo, most of its basic stuff, however, the most int ... [ read more ]
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
5/30/2006 12:09:00 PM
A colleague forwarded me this rather interesting blog post titled 'Stored procedures are bad, m'kay?' ( http://weblogs.asp.net/fbouma/archive/2003/11/18/38178.aspx ). Now whilst most people can look past the reference to South Park - it kinda questions the mantra that I generally spout when discussing Stored Procedures.
Now as a disclaimer, I've read the post a couple of times and to be quite honest take a superficial approach to using SQL Server, e.g. I know how to use it, work with it ... [ read more ]
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
5/30/2006 12:09:00 PM
Hello! Well, I must admit it’s been a while since my last sporadic post and as with English buses, you wait for one then three come in quick succession. Of course, its not because I particularly didn't want to post here but life has been dragging me around as of late, holidays, re:MVP'ing and an interesting diversion towards ActionScript 2.0...
For those of you not familiar with ActionScript - it’s the scripting language that is built into Flash 6 and onwards. It ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
3/9/2006 2:06:00 PM
I've want to shy away from using the term 'post' with this entry - but Dave Jeavons' blog entry inspired by to 'throw' up my version of a custom paging control (I have been meaning to post it up - honest Dave) - but with a twist...
Working on certain quasi-public sector web projects, issues such as accesibility are always bounded about by individuals who simply haven't got the first inclination about what they mean OR the implications of implementing such 'guidelines', e.g. Section 508 for t ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
2/18/2006 11:55:00 AM
Still working ASP.NET based projects at the moment (and recovering from another Hard Drive crash and subsequent rebuild), I came across this tricky issue...
I've been working on one particular project that ultimately would be published to an external ISP. Development of the project has been pretty smooth with various 'plug-in' elements linking into the project extremely easily. However, when publishing the web site to the external ISP - certain webforms would no longer submit, usi ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
1/11/2006 11:42:00 AM
Firstly, happy new year to everyone - I hope you had a good'un. For me, I didn't realise that turning 30 would automatically bracket me into the 'crap' Christmas presents arena - but it did and I'm sure you can picture the joy on my face as the only present I got this year (yes, only present) was a pair of socks. Ho hum - glad I bought the boy a RC monster truck now.
Anyway, a new year and new projects to work on. Most notably a few interesting ASP.NET projects, something I' ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
12/7/2005 4:53:00 PM
OK - this has been causing me problems for the last day or so and I've managed to come up with a tentative workaround. When you attempt add the Shockwave Flash Object (Version 8) to a form in a new or existing project - the IDE presents the message 'Failed to import the ActiveX control. Please ensure it is properly registered'. Checking out MSDN Product Feedback centre - this issue has been reported as a 'bug' and as of typing this message it is unresolved.
Other indicators ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
11/29/2005 1:38:00 PM
Back again after a protracted holiday and paternity leave (for those interested - it was a girl ). I'm back and at least I'm getting back into the groove work-wise at least.
Anyway, I came across this wonderful site today which I thought was really smart. Basically, its an online UML-based Class Diagram modller that allows you as a developer to create class diagrams online and print them off.
OK - this isn't a proper CASE tool as such, but its a very cool utility for quickly ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
10/18/2005 3:00:00 PM
Well, I received a copy of the new Macromedia Flash 8 and had some fun playing around with some new features and for the sake of this blog, those features that concern interaction with .NET (sample code provided in VB.NET).
A couple of years ago, before the world had crushed my spirit, I wrote this little FAQ titled 'Communicating between Macromedia Flash and VB' @ VBcity and until Flash 7, those elements held true - apart from the mildly cool XML class in ActionScript 1.0 Library that ca ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
9/27/2005 9:28:00 AM
An awful lot of dynamic websites have some kind of login facility where the user provides a username / password to gain access to more juicier / functionality elements of the website. A typical approach to log an actual user being authenicated is to set a flag / variable or whatever in the session object at the server end. This way, on each page view of the secured website (we) can check the session, determine whether the user is logged in and perform the appropriate actions.
Anyway, a few m ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
9/12/2005 2:59:00 PM
Hey, hey, hey
Today I saw a post on forum about reading ID3 tags from an MP3 file. Remembering rjhare's FAQ on the same subject I'd thought I would knock up a .NET version. Simply put its a single class with one method called 'ReadMP3Details' that receives the filename of the MP3 and exposes properities for the Album, Song title, Artist, etc. It opens a FileStream accessing the file and uses a BinaryReader to read the data, it navigates to the end of the file where the tag da ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
8/31/2005 10:08:00 AM
Just found this chunk of code knocking around in a code library and thought I would share it. Basically, its the method of retreiving error details when making a call to Win32 API function. I must admit I found it extremely useful on some of the more unusual P/Invoke conversion projects I've worked on...
Code Copy
Public Class cGetLastDLLError Private Declare Function FormatMessage Lib "kernel32" Alias "FormatMessageA" _ & ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
8/24/2005 12:15:00 PM
Just a quickie. Recently had a requirement for a mini-VGA screen to switch itself on (from standby) and navigate to a specific channel. Initially, we tried short-circuiting the power-on switch to essentially trip the switch. However, fiddly circuits and clumsy soldering irons left this option as a no-go. We then decided to check out the ability to emulate what the screen's remote control could do, e.g. Power-On on the screen and select the appropriate channel.
Anyhoo, ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
8/23/2005 5:08:00 PM
Hello everyone,
Well, I've had some time off and have been to the races (and was up by £10 on the day), sorted out the boy's 3rd birthday (involved a Thomas the Tank Engine Cake roughly the size of a Nissan Micra and me dressing up as Scooby Doo) and being able to get more than 6 hours sleep a night four nights in a row.
Anyway, today's offering is a little SpyCamera application. Now I've had a sneaking suspicion the boss and his wife share clinches in the office and this shocks ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
8/11/2005 3:46:00 PM
Just a quickie.
I keep seeing questions on the forum (www.vbcity.com/forum) about WAVs, Resource Files and all that malarkey and I'd thought I'll blog up the code for all sundry. Let it not be said that I am not a fan of Resource Files oh observers.
Anyhoo, the codey will extract a WAV file at runtime and play the sound by passing the byte data to the sndPlaySound API function. Note: to include a WAV into your assembly, simply add the file (as an existing file) to your project and set its ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
8/10/2005 12:10:00 PM
Hey Ho and a bucket of prawns,
Wow - have I been having some fun lately. Loads of GDI, a bit of managed DirectX and messing around with DirectShow - all in the .NET environment and getting some pretty spanking results. Anyhoo, today's chunk of wisdom - if you can call it that - is about the PaintEventArgs ClipRectangle parameter.
Well, I won't go into a full and detailed explanation of the ClipRectangle - but to mention that this element informs the Paint Event / Overriden OnPaint method ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
7/22/2005 4:44:00 PM
Eh up, Well, have I been busy as of late. Decorating bedrooms, mending roofs, training for the annual 100 mile cycle run and the new football season. However, oh wanderer of the internet - you do not bless my blog for pure merriment or concern about my person. Nope, you've come here for a reason - using me like some scabby medival whore.
Anyway, I digress....
Ok - this post I'm sure is going to produce an avalanche of comments - so as a precursor. This has merely been an experiment and wh ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
6/7/2005 3:24:00 PM
How's yer donald. Just noticed a newsgroup posting about some guy struggling with setting a custom forecolor on a textbox when its disabled (e.g. enabled = false). "No bother" I thought and quickly ran up the code - then I realised the dates, over two months ago and he had found a solution (although not as elegant).
Anyway, for your enjoyment and perusal. This class inherits a textbox, simply shadows the enabled property and if the property is set to false, it draws the textbox (with appropr ... [ read more ]
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
6/7/2005 12:17:00 PM
Hey,
As part of my cleaning up of various test projects and half baked ideas - I came across this little class the other day. Basically, it can mute and/or set the Master Volume of the computer using the 'mixerSetControlDetails' API and its various cousins.
I originally converted the code over from this ( http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q178456 ) VB6 support document and as part of the conversion process I wrote this FAQ @ VBCity ( http://www.vbcity.com/forums/ ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
6/3/2005 10:10:00 AM
Eh up,
OK - I admit it has been awhile. But after all that stuff in the papers and the whole on-off thing with Angelina Jolie - well, you could understand my mind has been elsewhere.
Anyhoo, I'm back and after the brushing the cobwebs away I thought I'll use my blog for the power of good and dump up some stuff as I go along, like interesting pieces of code and that kind of thing.
Today's masterpiece is this little thing I posted up on the forum the other day. In short, it pigg ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
12/1/2004 12:21:00 PM
Had a quick requirement today to retreive a list of drives available to a machine and their respective drive types, e.g. USB, CDROM, Logical Drive, etc. I naturally looked for a .NET solution and could quite easily retrieve the drive letters using System.IO.Directory.GetLogicalDrives property. However, to obtain the DriveType we must goto the System.Management namespace running a 'win32_logicaldisk' query that had to be executed for each individual drive.
However, the time it take ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
11/30/2004 12:02:00 PM
Came across a very ugly problem this morning that I thought I would share. Created an application that uses an form as a template for other forms to inherit from - the form contained a panel that would display a custom image with the image being set as part of the panel paint event.
This worked fine whilst loading the image directly using Image.FromFile method. However, when storing the image as an embedded resource (within a Resource File) - the inherited forms would work f ... [ read more ]
|
|
by
Mark Dryden via
Drydo (Mark Dryden)
on
11/19/2004 12:17:00 PM
OK - before make yourself a cup of tea, break open the Butter Thins and settle down to read this blog - I must warn you that this blog is technical in its nature. If you are expecting lighthearted romance or a thrilling roof top chase - you've come to the wrong place...
If you were to bracket me as a specific kind of person, I would say that panicker would be pretty much last on your list. If say, the building I work in were about to blow up, I wouldn't freak out and start jumping ... [ read more ]
|
|