How to enable AnkhSVN on Visual Studio 2013?

Gallery

I would like to set up WinMerge as external Diff and Merge Tools after setting the source control plug-in (you have to install WinMerge first): Visual Studio -> TOOLS -> Options -> Expand the “Source Control” Node Double click on … Continue reading

Standalone Single Instance in Linux

Gallery

Given code will help to create standalone single instance of application in Linux operating system. #include <stdio.h>#include <semaphore.h>#include <fcntl.h> int main(){    const char sem_name[] = “tmp”;    sem_t * mutex;     printf(“semaphore application started!\n”);    mutex = sem_open(sem_name, O_CREAT | O_EXCL, 0600, … Continue reading

Incremental Linking (LNK1123) error in VS2010 while building project

Gallery

Question: What is Incremental Linking in Visual Studio 2010? Answer: Please study given link to understand Incremental Linking in visual studio 2010.[Link] http://msdn.microsoft.com/en-us/library/4khtbfyf(v=vs.100).aspx Question: How error looks like while building project on visual studio? Answer: Build error will be looks … Continue reading

How to setup “libpcap” environment on Ubuntu

Gallery

Following steps will be required to prepare libpcap environment on Ubuntu. Download “libpcap” file from http://www.tcpdump.org/release/libpcap-1.3.0.tar.gz Use following commands sequentially to install “libpcap” package, $ sudo ./configure – prefix=/usr && make $ sudo make install In case, you faced problem … Continue reading

Compute Checksum Function

Gallery

unsigned short ComputeChecksum(unsigned short *data, int size) {     register int nleft=size;     unsigned long checksum = 0;     while(nleft>1)     {         checksum=checksum+*data++;         nleft=nleft-sizeof(unsigned short);     }     if(nleft)         checksum=checksum+*(unsigned char*)data;     checksum=(checksum>>16)+(checksum&0xffff);     checksum=checksum+(checksum>>16);     return … Continue reading

How to generate new copy of NDIS_PACKET?

Gallery

Given code is working perfect to generate new copy of NDIS_PACKET, NDIS_STATUS CreateNewSendNdisPacket(IN NDIS_HANDLE SendPacketPoolHandle,                         IN PNDIS_PACKET pkt_old,                         IN PGUINT8 pkt_raw,                         IN GUINT32 pkt_len,                         OUT PNDIS_PACKET * pkt_new) {   NDIS_STATUS Status;   NdisDprAllocatePacket(&Status, pkt_new, SendPacketPoolHandle); … Continue reading

Helpful forums for Microsoft Device Driver

Gallery

While working on Microsoft Device Driver domain, I found following most active and helpful forums, 1) OSR-Online: http://www.osronline.com You can configure OSR-Online forum on email client and given client will be helpful for you. http://www.osronline.com/page.cfm?name=NewsReaderInfo 2) Microsoft NNTP Server: msnews.microsoft.com … Continue reading

How to solve Command line error D8004?

Gallery

I faced given compilation error after convert “Komodia Project” from “VC6” to “VS2K5”. Error    1    Command line error D8004 : ‘/D’ requires an argument    cl Solution: Remove “/D” from “Additional options” (Example image is given below). Path of “Additional options” … Continue reading

How to build DDK source using vs2k5?

Gallery

Special thanks to Hollis Technology Solution to write script for build DDK source with vs2k5. [link] http://www.hollistech.com/Resources/ddkbuild/ddkbuild3_14.zip Following Environment variables need to use DDKBuild v3.14 script with vs2k5. I am using WDK 6001.18002. Don’t open vs2k5 before do following configuration. … Continue reading

Few common POSIX Regular Expression

Gallery

Following POSIX Regular Expression will be needed commonly while developing application, ALPHA_REG_EXPRESSION = "[a-zA-Z ]*" ALPHA_UNDERSCORE_REG_EXPRESSION = "[a-zA-Z_ ]*" ALPHA_NUMERIC_REG_EXPRESSION = "[a-zA-Z0-9 ]*" ALPHA_NUMERIC_UNDERSCORE_REG_EXPRESSION = "[a-zA-Z0-9_ ]*" ALPHA_NUMERIC_UNDERSCORE_DASH_REG_EXPRESSION = "[a-zA-Z0-9_[-] ]*" DECIMAL_REG_EXPRESSION = "[0-9]*[.][0-9]*" INTEGER_REG_EXPRESSION = "([1-9][0-9]*)|0" ADDRESS_REG_EXPRESSION = "[,.#_a-zA-Z0-9- … Continue reading

Taking Help from the right place

Today, I am sharing one of the informative information for craze engineers. ‘Taking Help from the right place‘ is difficult job know days cause of million of million site available on internet. So, how we can evaluate web site in a short time? this is difficult for me to answer it, but I know one place from where we can get correct information in short time and eXtremely great people are helping you on that forum. Guess where??

Yes! you guess is right, Microsoft Forums.

You just need below NNTP Server URL and Thunderbird to access them and take guidance with eXtremely great people.
[NNTP Server URL]
msNews.MicroSoft.com

Best of lUck!
.

How make DLL using C/C++ in Visual Studio 2005?

Creation of DLL task in visual studio 2005 is so simple. Follow the following
steps to make DLL in visual studio 2005.

Make new project via using menu or press “Ctrl+Shift+N”.

Select Win32 from Project types and select “Win32 Console Application” project
template.

Give project name which you want, select location of project where you want to
save. Press OK.

Win32 Application Wizard will welcome you, press Next button.

You have to select DLL in application type and Press Finish.

Your project will create. Build your project and get Library File(.lib file) and Dynamic Link Library (.dll file).

Now, important thing related to exporting function. There is two ways of exporting function. One, using Module-Definition File (.def file) which is old way to export DLL (I like this way), second way, export function using Microsoft Specific extension of the C language via using __declspec(dllexport) keyword.

For learning these ways visit following sites.

(using def file)
[link] http://msdn2.microsoft.com/en-us/library/28d6s79h(VS.80).aspx

(using keyword)
[link] http://msdn2.microsoft.com/en-us/library/a90k134d(vs.80).aspx

By,
-–| AimsLife™ |–

How make “N” bit Integer??

#include <iostream>

using namespace std;

template <int Size>
class NInt
{
private:
int Int:Size;
public:
int GetValue();
void SetValue(int value);
void PrintValue();
};

template <int Size>
int NInt<Size>::GetValue()
{
return this->Int;
}

template <int Size>
void NInt<Size>::SetValue(int value)
{
this->Int = value;
}

template <int Size>
void NInt<Size>::PrintValue()
{
cout<<“Value : “<<this->Int<<endl;
}

int _tmain(int argc, _TCHAR* argv[])
{
NInt<2> obj;
obj.PrintValue();
obj.SetValue(1);
obj.PrintValue();
obj.SetValue(2);
obj.PrintValue();
obj.SetValue(4);
obj.PrintValue();
obj.SetValue(5);
obj.PrintValue();
cout<<“Size of : “<<sizeof(obj)<<endl;
cout<<“press any key to continue…”<<endl;
_gettch();
return 0;
}

Output
———
Value : 0
Value : 1
Value : -2
Value : 0
Value : 1
Size of : 4
press any key to continue…

C Bit Fields
In addition to declarators for members of a structure or union, a structure declarator can also be a specified number of bits, called a “bit field.” Its length is set off from the declarator for the field name by a colon. A bit field is interpreted as an integral type.
struct-declarator:
declarator
type-specifier declarator opt : constant-expression

The constant-expression specifies the width of the field in bits. The type-specifier for the declarator must be unsigned int, signed int, or int, and the constant-expression must be a nonnegative integer value. If the value is zero, the declaration has no declarator. Arrays of bit fields, pointers to bit fields, and functions returning bit fields are not allowed. The optional declarator names the bit field. Bit fields can only be declared as part of a structure. The address-of operator (&) cannot be applied to bit-field components.
Unnamed bit fields cannot be referenced, and their contents at run time are unpredictable. They can be used as “dummy” fields, for alignment purposes. An unnamed bit field whose width is specified as 0 guarantees that storage for the member following it in the struct-declaration-list begins on an int boundary.
Bit fields must also be long enough to contain the bit pattern. For example, these two statements are not legal:
short a:17; /* Illegal! */
int long y:33; /* Illegal! */
[Reference link] http://msdn2.microsoft.com/en-us/library/yszfawxh(VS.80).aspx