Jun 17 2008

Application not initialized correctly (0xc000001d) error and VS2005

Classified in: C/C++, Microsoft, Programmingpaomic at 4:53 pm

While trying to transfer an application created using VS2005 to an embedded PC (VIA C3 M 10000 embedded PC), I run into this very annoying problem. First, I got a slightly different exception, which was due to the msvcr80.dll file missing. So, I used the VS20005 redistributable to deploy the application. But my journey through the DLL hell was only at the beginning, because I got this very strange error. I got this only in the release version of the application, while the debug one worked fine. Using dependency walker, I could check that all the necessary DLLs were there, so I didn’t know what was this. After a couple of days of googling, and an incredible number of rebuild and solution clean, I finally found out that it was due to a DLL (created by me) being compiled in release mode with support for SSE2 istruction set, which was not available in the VIA CPU (it seems that it only supports 3DNow! ones). After removing the SSE/SSE2 optimization, everything worked fine!


Feb 23 2008

Empty Datalist: show message?

Classified in: ASP.NETpaomic at 11:36 am

If you have a ASP.NET datalist and you need to show a message when there are no items in the list, you can use a code like the following:

myDataGrid.DataSource = …;
myDataGrid.DataBind();

if(myDataGrid.Items.Count == 0)
{
myDataGrid.Visible = false;
someLabelWithAMessage.Visible = true;
}
else
{
myDataGrid.Visible = true;
someLabelWithAMessage.Visible = false;
}

This is for C#, for VB it wuold be something like:
myDataGrid.DataSource = …
myDataGrid.DataBind()

If myDataGrid.Items.Count = 0 then
‘There are no records
myDataGrid.Visible = False
someLabelWithAMessage.Visible = True
Else
myDataGrid.Visible = True
someLabelWithAMessage.Visible = False
End If

Happy coding!


Oct 31 2007

CakePHP and paths

Classified in: CakePHP, Programmingpaomic at 3:31 pm

I had a problem related to CakePHP and url. I found some articles, such as this or this, but I still can’t find a solution. I try to access a file in the app/webroot directory, but using www.mysite.com/myfile.jpg or www.mysite.com/app/webroot/myfile.jpg don’t work…

Any help or ideas?

Edit: I made a few mistakes, so I was using the wrong path, with the correct path it works fine.

PS: the images are placed in the main webroot directory, but they are accessed using website.com/app/image.ext


Oct 05 2007

MS.NET framework source available!!!

Classified in: Programming, Windows tools, Technology newspaomic at 9:01 am

Microsoft decided to release the source code (well, part of) of the .NET framework, one of the most employed programming framework, used in ASP.NET websites and C# and VB.NET applications. The sources will be released with the Microsoft Refernce License, a very restrictive license (sources are not meant to be modified and redistributed, but only to help people debug their applications). Debug symbols can help programmers better debug their applications (i.e. ScottGu’s Blog shows how to “step into” the GridView DataBind method). More info on ScottGu’s Blog.