Sunday, December 19, 2010

Restoring database replication tables like sysmergepublications

For Microsoft SQL Servers,

To restore a database backup and keep the merge replication tables like sysmergepublications and sysmergearticles you need to restore the database from T-SQL using the RESTORE command and use the keep_replication

This will allow you to restore the merge replication required data and the publication definition.

Tuesday, December 14, 2010

Free UML Modeling using ArgoUML

I have tried ArgoUML and I thought that it will be nice that I share my first learning experience with you.

A direct URL to my tutorial for modeling a simple class diagram:

You can find also find more links in the Tutorials section:

If you are interested in this free UML modeling tool then try to visit:

Sunday, May 17, 2009

Converting CString to double in MFC

You can use the following snippet to convert CString to double in MFC:

#include "stdlib.h"

double func(CString pValue)
{
wchar_t* stopString;
double num = wcstod(pValue, &stopString);
return num;
}

Tuesday, April 07, 2009

View Native DLL Dependencies

If you develop a native DLL using Visual Studio 2005 SP1, you may need to know the dependencies of this DLL in order to ship it with your application, you can use the Visual Studio utility: depends.exe

image 

  1. Run Visual Studio Command Prompt
  2. type depends.exe and press enter.
  3. Click file->open to choose your DLL.
  4. View the dependencies in the left side tree view.

Wednesday, February 15, 2006

C# Invalid Cross Thread Operation

In .NET Framework 2.0 with default settings you can not change a Windows Control Property from an external thread, and if you try to do that you will get the following Exception
"Invalid Cross-Thread Operation"

to avoid this exception you can disable the checking for invalid Cross-Thread Operation by setting this static Property to false:
Control.CheckForIllegalCrossThreadCalls = false;

This settings is not recommended it is done only to avoid the exception appearing while debugging, it may cause serious problems if you disabled it (its done mainly to warn you while you debug your application).

To See other techniques to avoid this problem, see:
http://weblogs.asp.net/justin_rogers/archive/2004/10/08/240077.aspx
http://blogs.wwwcoder.com/amachin/archive/2004/12/15/1146.aspx

Tuesday, February 07, 2006

Invalid character value for cast specification

If you catch this error and you are trying to use a DateTime Value with SQL Server then check that your date in this range:

1/1/1753 to 31/12/9999

it will probably fix the problem