|
Mohammad A Gdeisat wrote: Specifically I want to monitor the HTTP protocol port 80, so any program sends or receives data on that port, its data will be visible to me.
Hook winsock.dll or look for packet filtering library like
WINpCap[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
winpcap as I remember when I last played with sometime back deploys a filter driver. You need install rights for that
Hooking winsock.dll is restrictive. As someone pointed out iphelper apis would help, but it would work only on 2000/XP and above.
LSP works everywhere and is safe for what he is looking for.
Vipin - MVP
|
|
|
|
|
Thanx man, Thanx for your help
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
vipinasda wrote: LSP works everywhere and is safe for what he is looking for.
But installing and Debugging LSP dll is itself it cumbersome task... hooking would be safe bet as you easily hook and unhook that dll according to your need but for LSP dll you have restart your computer...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Snort as Packet Sniffer in Linux
-- modified at 0:43 Tuesday 27th December, 2005
|
|
|
|
|
sunit5 wrote: Snort as Packet Sniffer in Linux
Hai, I havn't have idea about Linux ...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank you all for your help
I really appreciate this
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Hello,
I got the following compiling error:
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(86) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const struct PolygonX' (or there is no acceptable conversion)
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(396) : see reference to function template instantiation 'void __stdcall CopyElements(struct PolygonX *,const struct PolygonX *,int)' being compiled
I am very strange because file "c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h" is not a file in my project. How can I solve that?
I am almost exausted by this problem. A lot of thanks if someone helps.
xyhan
|
|
|
|
|
If you put a snippet of your problematic code, someone would be able to help you.
Vipin Aravind - MVP
|
|
|
|
|
Your code is directly or indirectly using a template class in that file. If you could post the piece of code that's causing the error, you could expect more help.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
afxtempl.h is one of the MFC headers. It defines the MFC template-based collection classes: CList , CArray , and so on. Since you didn't directly include it in your code, you are evidently including some other file that does.
The error you listed occurs when an assignment operator has not been defined for a class used as an argument to one of the afxtempl.h classes.
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
Merry Christmas!Thanks for helps from all of you.
The following is the source code that caused the error. the code is from afxtempl.h.
template<class type="">
AFX_INLINE void AFXAPI CopyElements(TYPE* pDest, const TYPE* pSrc, int nCount)
{
ASSERT(nCount == 0 ||
AfxIsValidAddress(pDest, nCount * sizeof(TYPE)));
ASSERT(nCount == 0 ||
AfxIsValidAddress(pSrc, nCount * sizeof(TYPE)));
// default is element-copy using assignment
while (nCount--)
*pDest++ = *pSrc++; //this line causes error.
}
Here I list the error information again:
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(86) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const struct PolygonX' (or there is no acceptable conversion)
c:\program files\microsoft visual studio\vc98\mfc\include\afxtempl.h(396) : see reference to function template instantiation 'void __stdcall CopyElements(struct PolygonX *,const struct PolygonX *,int)' being compiled
It seems I did not define the assignment operator of the argument. However, I defined it as the following:
struct PolygonX:public CObject
{
double minAngle;
CArray<cpoint,cpoint> ptArray;
public:
void operator=(PolygonX &src);
};
void PolygonX::operator=(PolygonX &src) {
minAngle=src.minAngle;
ptArray.Copy(src.ptArray);
}
I look forward to more helps!
Best regards,
|
|
|
|
|
I do not know if it is the cause of your error, but operator =() should not return void , it should return a reference to the current object.
PolygonX& PolygonX::operator =(const PolygonX &src) {
minAngle = src.minAngle;
ptArray.Copy(src.ptArray);
return *this;
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for your help. I tried it but it doesn't work.
|
|
|
|
|
PJ Arends wrote: it should return a reference to the current object.
Could you explain why ?
thank you in advance.
|
|
|
|
|
A good C++ book will explain it better, but the main reason is so that you can chain the operators. ie. one can do
MyObject1 = MyObject2 = Generate_temp_MyObject(); If MyObject::operator =() returned void then MyObject1 would not get assigned the value returned by Generate_temp_MyObject() .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
There are some good example in VB to get the
window title .
But u need constantly check for all windows
title or anyhow get the handle of the window
of ur game .
In VB ur work will be fast , never seen such
code in VC but its possible in VC
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
First of all Merry Christmas!
I noticed something weird in Visual Studio 2005. I haven't test my code in previous versions so I cannot confirm whether its merrit of VS2005 or else.
Ok, I have a dialog box application with 2 modeless dialog boxes which are created before the main dialog box in the application. I noticed there are 2 extra threads in the application with names "ThreadStartRoutine" and CRpcThreadCache::RpcWorkerThreadEntry" both at location _KiFastSystemCallRet@0 as shown in debug mode.
These 2 threads are created during the creation of the main dialog box in DoModal() function. I traced the exact creation point to Line 306 at dlgcore.cpp:
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
pParentWnd->GetSafeHwnd(), AfxDlgProc);
Which is inside this function:
BOOL CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,
CWnd* pParentWnd, HINSTANCE hInst)
My question is what are these 2 threads for? and why are they created?
Any insight appreciated!!
Rob
|
|
|
|
|
My guess would be that the CRpc* stuff is related to Remote Procedure Call support in the MFC libraries. I'm pretty sure I've seen this before with MFC 7.1 apps. The other function, I have no idea.
Software Zen: delete this; // <a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" rel="nofollow">Fold With Us!</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?msg=1307432&id=10338#xx1307432xx" target="_blank" rel="nofollow" title="New Window">^</a>]
|
|
|
|
|
Why is it of concern to you? let the library do anything as long as it accomplishes the things you want.
Vipin - MVP
|
|
|
|
|
Hello,
I need to make a *.bmp file out of my CBitmap file. I do not know about bitmaps so much and i cannot make conversions between different types. Can someone help me?
Thanks in advance
|
|
|
|
|
You can't save the CBitmap as it is into a file. You will have to convert the CBitmap which is a DDB into a DIB. The bytes for the pixels in the CBitmap are device dependent, only the graphics driver knows how to interpret the pixel values(RGB) corresponding to what a byte or triplet denote. So the first step would be to convert to a DIB. To do that, you will have to use the GetBitmap(...) method on the CBitmap and then get the DDB bitmap's dimensions. You should then create a DIB, this is normally done using CreateDIBSection(...), you should fill in the BITMAPINFOHEADER and then be done with creating the BMP with the right color depth. I would then BitBlt between a device context having a DDB into another memory device context having the DIB and the underlying graphics driver or DI would convert the DDB(your CBitmap)to DIB. You can now save the DIB to a file.
Well the above are the fundamental set of operations to do it. There are already built-up classes here in codeproject. Have a look at this article "CDibData", linking to which you can get what you want.
http://www.codeproject.com/bitmap/jscdibdata.asp[^]
Microsoft - MVP
|
|
|
|
|
Articles at CP (Bitmaps & Palettes): CxImage, CDibData, "Saving a Drawing to a Bitmap File". There are probably others.
INTP
Every thing is relative...
|
|
|
|