Archive for the 'C/C++' Category
Compute Checksum Function
Please visit: http://aimslife.com/blog/?p=27
Filed under: C/C++ | Leave a Comment
Please visit: http://aimslife.com/blog/?p=23
Filed under: C/C++, DDK, Linux, Windows | Leave a Comment
Tags: C/C++, DDK, Linux, Windows
Please visit: http://aimslife.com/blog/?p=20
Filed under: C/C++, Linux, Windows | Leave a Comment
Tags: itoa, sprintf
Please visit: http://aimslife.com/blog/?p=6
Filed under: C/C++, Linux, Network | Leave a Comment
Tags: Linux Kernel Module Programming Netfilter SK_Buff
Please visit: http://aimslife.com/blog/?p=7
Filed under: C/C++, DDK, Network, WDF, WDK, Windows | Leave a Comment
Tags: DDK WDK WDF NDIS
Please visit: http://aimslife.com/blog/?p=18
Filed under: C/C++, DDK, Network, WDF, WDK, Windows | Leave a Comment
Tags: NDIS_PACKET WDK DDK NDIS
Given code can help you to compute checksum.
/* pseudo header for checksum calculation */ typedef struct pseudoh { guint32 src_addr; guint32 dest_addr; guint8 zero; guint8 protocol; guint16 [...]
Filed under: C/C++, Java, Linux, Network, WDF, WDK | Leave a Comment
Tags: Checksum TCP
This setting will enables for you to control automatic rebooting of the system after the crash. After the crash, you must be able to check the reason of the crash and for that, the system should not reboot. Therefore, it is very necessary to control the automatic rebooting of the system.
Path: [...]
Filed under: C/C++, DDK, Network, WDF, WDK, Windows, fun & enjoy | Leave a Comment
Tags: reboot WDK DDK system crash
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 Following groups [...]
Filed under: C/C++, DDK, Network, News, WDF, WDK, Windows | Leave a Comment
Tags: NNTP
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” is “Project Properties” >> “Configuration Properties” >> “C/C++” >> “Command Line”
Filed under: C/C++, Network, Windows | Leave a Comment
Tags: Network LSP Komodia Winsock2
Please visit: http://aimslife.com/blog/?p=11
Filed under: C/C++, DDK, WDF, WDK, Windows | Leave a Comment
Tags: WDK WDF C/C++ DDK Windows
Please visit: http://aimslife.com/blog/?p=9
Filed under: C#, C/C++, Java, Linux | Leave a Comment
Tags: http://aimslife.com/blog/?p=9
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 [...]
Filed under: C#, C/C++, News | Leave a Comment
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 [...]
Filed under: C/C++ | 5 Comments
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);
[...]
Filed under: C/C++ | Leave a Comment
How To Use Greta?
[Visit Link] http://www29.websamba.com/sswater/en/greta/index.htm
Filed under: C/C++ | Leave a Comment
Regular Expression in C++
GRETA:
The GRETA Regular Expression Template Archive
GRETA gives you all the power of Perl 5 regular expressions in your C++
applications. These easy-to-use classes let you perform regular
expression pattern matches on strings in C++.
Features include:
Fast backtracking regular expression engine.
Separately compiled patterns.
Matches against C-style NULL-terminated strings, C++-sytle std::string’s, or iterator ranges.
Template on iterator type and syntax module.
Supports [...]
Filed under: C/C++ | 1 Comment
#include
#include
#include
#include
int DeleteDirectory(const std::string &refcstrRootDirectory,
bool bDeleteSubdirectories = true)
{
bool bSubdirectory = false; // Flag, indicating whether
// subdirectories have been found
HANDLE hFile; // Handle to directory
std::string strFilePath; // Filepath
std::string strPattern; // Pattern
WIN32_FIND_DATA FileInformation; // File information
strPattern = refcstrRootDirectory + “\\*.*”;
hFile = ::FindFirstFile(strPattern.c_str(), &FileInformation);
if(hFile != INVALID_HANDLE_VALUE)
{
[...]
Filed under: C/C++ | Leave a Comment
Make sure you call CoInitialize(NULL); before calling this function.
// CreateLink – uses the Shell’s IShellLink and IPersistFile interfaces
// to create and store a shortcut to the specified object.
// Returns the result of calling the member functions of the interfaces.
// lpszPathObj – address of a buffer containing the path of the [...]
Filed under: C/C++ | 4 Comments
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[]){ char ptr[ ] = ”123abcdabeabf”; int count, start, end, up, move, endIndex; count = 1; start = end = up = 0; move = 1; endIndex = strlen( ptr ) + 1; while( start <= endIndex ) { while( move <= endIndex ) { if( ptr[ up ] == ptr[ move ] ) { end = up; if( ptr[ up + 1 ] != ptr[ move + 1 ] ) { count ++; } up ++; } else if( ptr[ up ] != ptr[ move ] ) up = start; move ++; } if( count > 1 ) cout<<”string: ”<<ptr<<endl <<”count : ”<<count<<endl <<”start : ”<<start<<endl <<”end : ”<<end<<endl <<”up : ”<<up<<endl; up = start = end = end + 1; count = 1; move = end + 2; } cout<<”—>END OF LINE<—”<<endIndex<<endl; _gettch( ); return 0;}
OUTPUT:——-string: 123abcdabeabfcount : 3start : 3end : 4up : 3string: 123abcdabeabfcount : 2start : 7end : 8up : 7—>END OF LINE<—14
Suggest it, how to make it correct?
Filed under: C/C++ | Leave a Comment
If you wants to makes toolbar with out using MFC IDE. MFC IDE is too much ugly and helpless to make toolbar using high resolution bitmap. For this Purpose you needs following line to write in .rc file
IDR_RCTOOLBAR BITMAP “res\\LargeIcons.bmp”
IDR_RCTOOLBAR TOOLBAR 32, 32BEGIN BUTTON ID_NEW BUTTON ID_OPEN BUTTON ID_SAVE BUTTON ID_PAST BUTTON ID_SEARCH BUTTON ID_PRINT [...]
Filed under: C/C++ | Leave a Comment
streaming fun
enjoy streaming example in C++
#include “stdafx.h”#include <iostream>#include <fstream> using namespace std; int _tmain(int argc, _TCHAR* argv[]){ ofstream file( “rdbuf.txt” ); streambuf *x = cout.rdbuf( file.rdbuf( ) ); for( int i = 0; i < 20; i ++ ) cout << “test” << endl; // Goes to file cout.rdbuf(x); cout << “test2″ << [...]
Filed under: C/C++ | Leave a Comment




