Posts

Hide poup when click outside.

Just set islightdismissenabled property true for control. If popup is enabled and user clicks any where else the popup will be automatically disappeared.

error MSB3271: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture, "x86", of the implementation file

The error comes when you include winrt component in your project. To remove the error open project file of both the components and change the value of $(Platform)'== to make common in both project. I came out with error after changing the value from AnyCPU to x86.

ESENT –JET APIs to create database in Metro Style App on Windows 8

ESENT –JET APIs to create database in Metro Style App on Windows 8- ESENT dll is a part of windows SDK and provides apis to create and manage database on metro style application there is two major choices that can be used to implement databse in metro style application: 1.        SqlLite v3 2.        ESENT – JET database model SQLLite3 is not officially annouced to be used as database engine on windows8. But winrt version is already available to play with database. ESENT is already the part of windows8 so winrt support is already their to link esentlib statically to use the application.  JET apis are much flexible to create indexed base database and can be used to create huge database with thousands of table and columns. JET apis introduced in different levels according to plateform like win2000, WINXP , VISTA and above. Most of structures changed due to unicode support and security enhancement. I have cre...

C# - Programmatically Reset IP configuration to default

Following sample code will reset Internet Protocol version 4(Tcp/Ipv4) Properties to Obtain an IP address automatically and Obtain DNS server automatically private void RunCommand(String commandLineArgs) { System.Diagnostics.Process objProcess = new System.Diagnostics.Process(); objProcess.StartInfo.FileName = "C:\\Windows\\System32\\cmd.exe"; //objProcess.StartInfo.UseShellExecute = false; objProcess.StartInfo.Arguments = commandLineArgs; objProcess.StartInfo.CreateNoWindow = false; if (objProcess.StartInfo.Arguments.Length > 0) { objProcess.Start(); do { Thread.Sleep(100); } while (!objProcess.HasExited); } if (objProcess.ExitCode == 0) MessageBox.Show("Installed successfully....."); else MessageBox.Show("Oops smthng...

Earn money Online free

Earn upto Rs. 9,000 pm checking Emails. Join now!

taskdef class org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs cannot be found

I got this problem while building JAR. I have spent 10 to 15 to solve this headech steps wre: Right click over the Project and select option -> Resolve Reference Problem.... Then It will display which reference is really problem just locate the right Libraries. And tan tada done :).... Best of Luck...

Example Code to send mail in JAVA

package javaapplication27; import java.security.Security; import java.util.Properties; import javax.mail.Message; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; /** * * @author SANAT */ public class Main { /** * @param args the command line arguments */ private String mailhost = "smtp.gmail.com"; public synchronized void sendMail(String subject, String body, String sender, String recipients) throws Exception { try { Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); Properties props = new Properties(); props.setProperty("mail.transport.protocol", "smtp"); props.setProperty("mail.host", mailhost); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.port", "465"); props.put...

XML Programming using IXMLDOMDOCUMENT in vc++

Here the sample code to start XML programming using XML dom parser. // TestXML1.cpp : Defines the entry point for the console application. // #import #include "stdafx.h" #include #include #include //sample xml u can copy paste it in note pad and save it with .xml extension and store in location c:\ int _tmain(int argc, _TCHAR* argv[]) { CoInitialize (NULL); CComPtr pXMlDoc = NULL; HRESULT hr = CoCreateInstance(__uuidof(DOMDocument), NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pXMlDoc)); VARIANT_BOOL boolval; CComVariant path ="c:\\cdcat.xml"; hr = pXMlDoc->load(path,&boolval); BSTR val ; pXMlDoc->get_xml(&val); MessageBox(0,val,_T("TEST"),0); pXMlDoc = NULL; CoUninitialize(); return 0; }

Good collection of C n C++ interview written Questions and answers

Download Questions in PDF : Download C n c++ written questions and Ans(PDF) C Aptitude 1. void main() int const * p=5; printf("%d",++(*p)); Answer: Compiler error: Cannot modify a constant value. Explanation: p is a pointer to a "constant integer". But we tried to change the value of the "constant integer". 2. main() char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); Answer: mmmm aaaa nnnn Explanation: s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea. Generally array name is the base address for that array. Here s is the base address. i is the index number/displacement from the base address. So, indirecting it with * is same as s[i]. i[s] may be surprising. But in the case of C it is same as 3. main() float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); Answer: I hate U Explana...

C++ Class Member Initialization order....

Sample Code.... class Test { int x; int y; public:Test(int z) { x=y=z; } }; class Test1 { Test t; const int b; Test1(int z):t(1),b(10) { } }; CSomeClass::CSomeClass() { x=0; y=1; } and in other places I see it written this way: CSomeClass::CSomeClass() : x(0), y(1) { } Some of my programmer friends say that it's better to do it the second way, but no one knows why. Can you tell me the difference between these two methods of initializing class members? A Technically your friends are right, but in most cases it makes no difference. There are two reasons to use the second syntax, which is called a member initialization list: one is necessity, the other efficiency. Let's examine the first reasonâ€"necessity. Suppose you have a class member that is itself a class or struct, and this class only has one constructor that requires an argument. class CMember { public: CMember(int x) { ... } }; Since CMember has an explicit constructor, the compiler do...

MySql from Command prompt

To Access your MySql Database server via command prompt steps are as follows: 1.Connect to Database server. 2.Select Database 3.Run MySql Queries. Commands for all these steps: 1.Connect to database.-- Enter the bin directory of database like - c:\cd C:\xampp\mysql\bin Connect to databse server: C:\>..\bin\mysql -u username -h localhost -p [press enter] will prmpt for password Enter password > now..connect to database:- mysql> use [databasename] now start executing quieries > enjoy MySql queries .... best of luck

Customize Outlook message inbox View VC++ code

Here I am using VC++ code and OUTLOOK object model to add new column or field in outlook inbox message view. Like other fields ( importance,subject date ....) i am going to add new custom field. **Note...I tried a lot to add a ICON type value using bitmap like read unread mail in that column bt i couldnt... In simple I used a text type value for this field: Bellow two functions written : Over view: MicroSoft stores the Outlook view in XML form just need to get the XML and modify it. a lots of security and other issue involved here to know morw about it go to Creating Custom Views artical of microsoft and get alot: CConnect::AddNewViewField() { Outlook::_NameSpace * pNamespacePtr; MAPIFolder *pFolderptr; View * pViewPtr; BSTR strXMl; BSTR modifiedXMLSTr; m_spApp->GetNamespace(_T("MAPI"),&pNamespacePtr); pNamespacePtr->GetDefaultFolder(olFolderInbox , &pFolderptr); pFolderptr->get_CurrentView(&pViewPtr); pViewPtr->get_XML(&strXMl); modifi...

My different mode of poetry

Hi Evry one...I dont know why the hell I am going to write something here....but i love it 2 spread to all my frnd as a diwali wish......actally listen story wat happened... DAy - FRIDAY - 16-10-2009 Before 1 day to diawali came to my office n started orkut i sawa los of messages from my friend they -wre wishing me DIWALI...then i started replaying all of them and dere was sm other thing lk a line of poem running in my mind......then i thought i sud write 2 line in a different style to wish dem HAppy diwli....and i started writing but thing go beyound the 2 line i made it sm thng diff........................so here i am going to write.....for all my fiends....... "Office ke kaam se tha pareshan. Kam khtam hone ka leta nahi naam, lyf thi boring n dil hairan, baar baar khayalon me kuch tha shayed sayed ek chehra ya shyed koi naam, System ko liye baithe the, man nahi kar raha tha karne ka kaam, kuch to jarur tha mere around, mere liye nahi tha samjhana aasan, arey 1 s...

How to convert and print full system TIME string in GMT or UTC

SYSTEMTIME tempSYSTIME; SYSTEMTIME stLocal; FILETIME LocalTime; int TmpMeetingInfoLength = 0; TCHAR tempStartTimeStr[MAX_PATH] ; TCHAR strDateandTime[MAX_PATH]; TIME_ZONE_INFORMATION info; GetLocalTime(&stLocal); GetTimeZoneInformation(&info); LONG tmpval = info.Bias ; if(info.Bias tmpval = info.Bias * -1; LONG hr , min ; hr = tmpval /60; min = tmpval % 60; _TCHAR str[100]; _stprintf(str, _T(": %02d-%02d-%02d %02d:%02d:%02d GMT%s%02ld:%02ld"),stLocal.wYear ,stLocal.wMonth, stLocal.wDay, stLocal.wHour, stLocal.wMinute ,stLocal.wSecond , (info.Bias > 0 && info.Bias != 0 ) ?_T("-"): _T("+"),hr , min); OUTPUT : "YYYY-MM-DD HH:MM:SS GMT+/- HH:MM" eg: "2009-10-10 23:15:01 GMT +05:30"

How To create PreProcessed File in VC++

To Create a preprocessed file u need to compile a file with Following command line argument. 1 - CL /D [Macro ] (eg : _DEBUG) /EP /P filename(eg ....\123.c) it will generate a .i file with same file name (eg - 123.i) The qs is y do i need to create such a preprocessed file. I am a c++ developer but qnce i need to use some java file to compile written by other person with good coding style using #IFDEF and #endif macros that is not allowed in java so i was nt able to compile that file.then to compile that java file i need to first preprocess that file to remove this macros and then build the java file. then steps involved in that: 1 - try to find out wht code need to seperate 2 - write command with given preprocess variables checks 3 compile it the u will get output inform of .i file rename it as the format it required(eg .i to .java) Simplest way to get aal the required option for preprocessing if u r a .NET user Project or file setting enable the preprocessing optiopn prop - > c++...

Free Online Part Time Job

Work from Home. Earn Rs.2,000 daily. No Investment. Part Time Jobs. Wanted Online Internet job workers. Job is only through Internet. Work from home part time jobs. You can earn Rs.750-2000/- daily. These are genuine Data entry jobs & Internet jobs. No Investment required. Only serious enquires please. For more details visit http://www.earnparttimejobs.com/index.php?id= 2392314

How to Earn Rs.25000 every month without Investment through part time jobs?

How to Earn Rs.25000 every month without Investment through part time jobs? You can earn Rs.25000 very first month from data entry jobs on internet. This is an easy work from home form filling jobs. Work less than 1 hr daily. No investment. Please visit the website http://www.earnparttimejobs.com/index.php?id= 2392314

Way to start Programming.

Simplest method to create COM object -VC++

Here i am going to write steps that i used to create a object of component and call the functions of that object. i was just having the progid of that component and i supposed to call the function of that component. in VB it is very simple to do. u need to just call a function "CreateObject(progID)" and start wrking with that object. Eg: ProgId : abc.application.1 dim obj = CreateObject("abc.application.1e"); done. but in VC++ it is quite complicated to call the function or object creation. but lets see i have done the task. required header files: #include #include "Objbase.h" CLSID clsid; LPUNKNOWN punk; LPDISPATCH pdisp; OLECHAR FAR* szMember = _T("GetIpAddress"); DISPID dispid; DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; OleInitialize(NULL);// if OLE isn't already loaded. CLSIDFromProgID(_T("abc.application.1"), &clsid); CoCreateInstance(clsid, NULL, CLSCTX_SERVER,IID_IUnknown,...

VC++ - Importent Outlook - Add in close

I was just working with Outlook 7 and made aVC++- ATL addin and things were very fine. for a moment i just shifted my code on Outlook 2003 the things gone changed ...suddenly my smile converted in deep worry becoz of in case of multiple instance i was not able to close all the explorer of outlook.outlook was not getting closed,was running behind. then after a lots of debug loops i found where exactly the problem........ here i am goin to list some issues that may be a part of such problems while developin a com addin for outlook. 1 - if u are registering any event (DispEventAdvise(.......)) with button or menu item just check that its having corresponding un registeration(DispEventUnadvise(...........)).If DispEventAdvise is coming in your code then there must be DispEventUnadvise(.....). 2 - Arelease the explorer object that u r using. 3 - free all the Com object that u r using. 4 - always try to handle the events that you are using in your addin case in a different class. Here i...