if you want to use the secure version rand_s() – be careful, it only works on XP and higher!!
http://msdn2.microsoft.com/en-us/library/sxtz2fa8(VS.80).aspx
Guess you don’t get to be secure on Windows 2000 or lower. 😛
if you want to use the secure version rand_s() – be careful, it only works on XP and higher!!
http://msdn2.microsoft.com/en-us/library/sxtz2fa8(VS.80).aspx
Guess you don’t get to be secure on Windows 2000 or lower. 😛
So, now that I have the extensions and have started digging into WPF, I notice one thing blatantly missing. Datagrids! So I did a quick search and found that Xceed has a free (as in beer) datagrid control for WPF, you can get here. I have downloaded it and can’t wait to start using it.
Microsoft recently released the .NET Framework 3.0 (WinFX) that includes Windows Presenation Foundation, Windows Communication Foundation, Windows Workflow Foundation, and Windows CardSpace. If you are trying to develop using the WPF or WCF using VS2005, you might be wondering if there are VS2005 Templates avail for these project types. You would think that by installing the Vista SDK and the .NET Framework 3.0 you would have them, but no. After doing some digging, there are extensions for WWF for Visual Studio. For WPF and WCF, you are left with the November 2006 CTP Release of the Extensions, which is the “Cider” Release. I guess from what I am reading, there won’t be RTM versions of these extensions, well, not until the Visual Studio release of “Orcas”.
Now, I guess I don’t mind that the CTP versions are what you are supposed to use, but the problem is there is no where I can find (in one place) where all of this is laid out and specified. You have to dig around on forums and what not. Microsoft should lay out what is what so you don’t have to second guess.
After installing the RTM 2006 Extensions, you should see the .NET Framework 3.0 projects types in VS2005 as shown here:
Previously in .net 1.0 and 1.1, to send mail from a console application, you could use
using System.Web.Mail
and use a method similar to this:
static void SendMail()
{
MailMessage msg = new MailMessage();
msg.To = “toaddress1@whatever.com,toaddress2@blah.com”;
msg.From = “fromaddress@whatever.com”;
msg.Subject = “My Subject”;
msg.Body = “My Body”;
msg.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = “yourmailserveraddressorip”;
SmtpMail.Send(msg);
}
If you then upgrade to .net 2.0, you will get this when building:
warning CS0618: ‘System.Web.Mail.SmtpMail’ is obsolete: ‘The recommended alternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid=14202’
Nice huh, link doesn’t tell you much except the API is obsolete.
The old way still works, but you get a bunch of ugly warnings.
So, to fix that, you need to do this. First remove the using statement for System.Web.Mail, then add and change your mailing method as follows:
using System.Net.Mail;
static void SendMail()
{
MailMessage msg = new MailMessage();
msg.To.Add(“toaddress1@whatever.com,toaddress2@blah.com”);
msg.From = new MailAddress(“fromaddress@whatever.com”);;
msg.Subject = “My Subject”;
msg.Body = “My Body”;
msg.IsBodyHtml = true;
SmtpClient smtpClient = new SmtpClient(“yourmailserveraddressorip”);
smtpClient.Send(msg);
}
As you can see, pretty close but a few subtle differences. No more warnings! 🙂
** Note that if you really want a good SendMail function, you should pass in the parameters and have overloads for options such as HTML mail, etc. Depending
on the app I am making, I’ll just throw up a email method like this, but it’s really the quick and dirty way to do it. **
Recently, at work, we redid our Exchange 2003 server. After the change, ActiveSync on my Windows Mobile Pocket PC 6700 Sprint Phone stopped working. Previously, we used a homegrown certificate, so I had to copy it to my device and install it. But during this change, we switched to a third party cert. This is where the problems started.
Internet Explorer, Firefox, and other applications keep a list of known valid trusted (and untrusted) root cert authorities. Every so often they update their lists to add new root cert authorities. Easy enough.
The cert we were using was from a newish root cert auth. IE7 had it listed and worked fine going to Outlook Web, no cert errors. Firefox on the other had would give a message saying that it couldn’t figure out what the cert was all about.
On the Pocket PC, if I went to Outlook Mobile Access (OMA), I would get the same type of error, where it couldn’t validate the cert. Also, because of this, the over the air (OTA) ActiveSync stopped working, and I was getting error 0x80072F0FD, saying that the certificate was invalid. (But – it wasnt!!)
Needless to say, I couldn’t just register the cert for our server, I had to register every cert in the cert path, which ended up being 3 certs. By doing this, my device knew that the root cert auth was valid and then allowed me to sync.
Really, Microsoft should be sending out these updated trusted root cert authorities in updates to the device or for ActiveSync, or at least make it easier to find info on it and know what is going on. A lot of time was spent troubleshooting an issue that shouldn’t really have taken as long if the information was readily available.
On the geek note, after I got ActiveSync working, I hard reset my device, and then installed the AKU3.3 hacked upgrade patch in USB bootloader mode (make sure to go into bootloader mode – hold down record and power button and do a soft reset). Sprint might or might not release it, but it has a bunch of bug fixes and speed performance tweaks. Also, once I did that, when the device came up, and before the Sprint bundles started to install, I did a soft reset. What does this do for you? Well, #1 you don’t get any Sprint bundles, and also things they disable are available to you. The one thing you need to do to make your device fully functional is add an ISP connection to #777 so the EV-DO works.
And then, finally, I installed the WM6/Crossbow theme and the Vista dialer pad skin. Sweet! 🙂
If upgrading a C++ project from VS2003 to VS2005, you might run into this error. LNK1104: cannot open file ‘LIBC.lib’
I resolved it by doing the following:
Project->Properties->Configuration Properties->Linker->Input
Ignore Specific Library: libc.lib
I guess VS2003 has there by default, from what I have been reading.
if you are doing a Response.Redirect, and are seeing this error, try something like this
string url = someUrlWithNewLines;
url.Replace(“nr”, “”)
Response.Redirect(url);
Seems trivial, but I have seen the error crop up many times. Just for kicks I did a Google search on it, and a lot of people are asking about it, but no real answer. So, here it is 🙂
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt..
If you have VS2005 C++ Unit Tests, written in managed C++ as they should be, and you are calling native code from them, and you see that error when running your unit tests – I have found it to mean that you are using insecure versions of methods (strcpy, etc). If you change the method calls to the secure versions, you should see your tests pass!
In your Query Builder, you can filter a dimension using MDX, here is how you get the TOP N
TOPCOUNT({Dimension Member},N,{Measure.Value})
Comes in pretty handy for building reports.
If you are referncing another lib in a project and you goto build and get
fatal error LNK1104: cannot open file ‘C:MyProjectDebug.obj’
Do a double check in the project you are referencing configuration. If you have a space in the name (Say “Debug Test”) you might see this error and scratch your head. If the project you are referencing outputs to $(ConfigurationName), then the output directory will have a space. Seems that when you reference that project or lib, it doesn’t like it with a space in the path name, doh! 🙂