Categories
Geeky/Programming

Visual C++ fatal error LNK1158 midl.exe

ok. Dang it I don’t like C++ and I was getting this error trying to compile a solution. Since searching in google doesnt give anything (do c++ developers use the internet yet?) I am posting this here for the next unlucky soul. What it means is that file is missing from an executable path or include path. What I did to fix was find midl.exe in another directory (C:Program FilesMicrosoft Visual Studio .NET 2003Common7ToolsBin to be exact) and then copied it to

C:program filesMicrosoft Visual Studio .NET 2003Vc7bin

and

C:program filesMicrosoft Visual Studio .NET 2003SDKv1.1Bin

and then my solution finally compiled. 🙂

Categories
Geeky/Programming

.NET Execute Process with Arguments

if you are trying to execute a process in .net and trying to pass in arguments, and seem to not be getting anywhere, in the “start info”, set UseShellExecute = false. Worked for me 🙂

Categories
Geeky/Programming

.NET Framework Mistake

I think the .NET Framework is great. It is great for web and fat client apps, web services, etc. I think the mistake Microsoft made with it, is it isn’t required with the OS. Too many people don’t have it. It isn’t feasible to develop a fat client app with .NET and expect widespread installations. People that don’t have the framework will be put of by the whopping ~23MB size of the install. I think it is just goofy that Microsoft tries to push .NET down our throats (as developers) – everything is .NET this, .NET that – and it is good, it can do a lot. Thing is – if you want to get an application to the masses, you still have to fall back on C/C++ as it will 99.9% run natively.

Instead of making the .NET framework a optional update on Windows Update, I think that if it was a required update, it would make things a lot better in terms of developers wanting to target a larger audience. Microsoft says that Vista will have .NET Framework 2.0 – but it is too late. Too many people have XP (9X even!) that they will probably never switch to Vista.

I think managed code is good. I don’t think I should have to develop in unmanaged code because it is too much of a PITA to get the framework to end user machines.

🙂

Categories
Geeky/Programming

Automate your Piano with WinFX

this is awesome. automate your grand piano to take soap messages and play the notes, and vice versa. totally cool.

MSDN TV Holiday Episode III (note: I couldn’t get this to work in firefox)

Categories
Geeky/Programming

PocketBlogger 1.3 Released

I just released PocketBlogger 1.3 which adds support for MSN Spaces. Here is my post over at pocketblogger.net if anyone is interested

Version 1.3 Released (MSN Spaces Support)

Categories
Geeky/Programming

Visual Studio Loading Slow?

Dang, today at work loading up Visual Studio was taking like 5 minutes at 100% cpu. I rebooted, looked at task mgr, etc, nothing unusual. I turned off realtime virus scanning and boom! – it loads so fast its crazy. Just something that hasn’t been an issue, but creeped up and up on me, making it load slower.

Categories
Geeky/Programming

'Class' must be marked as Serializable or have a TypeConverter other than ReferenceConverter to be put in viewstate.

What a PITA. If you want to store an object in the viewstate in ASP.net you need to make sure it is marked as Serializable. Not only that, you need to make sure that every class that it uses is marked as serializable.

There are some scenarios that you don’t have to thought: if you store the objects in Session, you will be ok – unless you try to use out of proc sessions, then you will get the same error for sessions except it will say ‘Class’ must be marked as Serializable or have a TypeConverter other than ReferenceConverter to be put in Session.

If you can, try not to store complex objects in Session/Viewstate and you will save yourself the headache. Or hope that your complex object doesnt use any other classes, then it will be easy for you. 🙂

Categories
Geeky/Programming

Enum or Lookup Table (Or Both?)

Well, here is a dilemma. Should you use an Enum in code or a Lookup Table in the DB for static lookup data. Or should you use both and make sure they match up? And if you do, should you make the tables have an identity INT column?

Depends on the situation.

If you have a lookup table for something that is static (or relatively static – changes maybe once every year or more), then an Enum to Lookup table relationship might be what you need. But, if your list is more than say 10-15 items, I don’t know if it would be best to even have an enum. If you have a lookup table that will get added to a lot (more than once a year) then I don’t think you want to add an enum as you would have to change it and recompile your code on every addition. With the case of frequently changing data or a lot of items in your list, a cached dataset would probably work the best. I think in practice you should lay out ground rules before the start of a project on what business rules have data assumptions and where they will be (data layer, business layer, presentation layer) – that way, there will be no confusion on lookup/seed/static data throughout your project.

If .NET had some way to make sure that your enum and lookup table matched or if you could create the enum from a data table, it would be great. You can dynamically create enums using reflection, but I don’t think that would be the best solution in this scenario.

Here are some other blog posts on the subject

Enums and Lookup Tables

Data Modeling and Enums

Categories
Geeky/Programming

Detecting Flash – FlashObject

There are many ways to detect flash in a browser, but today I came across an elegant solution that I think is the best I have seen so far, and better yet – works with all browsers, and lets you expose minimal code. With around 10 lines of code you can detect flash, and set up your alternate content, etc. Pretty sweet if you ask me, especially compared to some of the hacks I have seen to try to detect the browser and OS and if flash is installed and what version and you get the picture. With FlashObject, you reference the js file, and then you set up a div tag for alt content, and a JavaScript block with your flash code (2 lines of code). It seems a lot more easier then the default shockwave EMBED method. If you have to detect flash on multiple browser, I suggest you check out FlashObject.

FlashObject

Categories
Random

ActiveX vs. Java

Firefox isn’t a panacea. I got spyware installed on a box surfing with firefox. A java applet installed spyware that affects internet explorer. I think it is more a vuln. in java and windows, not really firefox or ie. It really shows you that ActiveX isn’t the only thing that has issues as far as installing things on your box when surfing.

I think that you need to worry about security no matter if you use IE or FF or anything else. 🙂