|
Hello all,
I am developing sniffer kind of application.
I have it at all. But now i want to add IP Filtering option in it.
But i don't know how to set an option on socket so that i can not receive local network packets.
Is there any body who can help me out.
Any help will be highly appreciated.
Thanks in advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Are you wanting to sniff on the packets that originated from an external network? In that case, you could do a check on the source IP address of the packet, which should not belong to the IP range of your local network.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hello all,
I am using webBrowser control for my application. In fact i am trying to build customised browser application. I am able to navigate to any URL using CHtmlView::Navigate method. But not to the URL containing swf file in their url string just like below:
http://www.webkinz.com/SWF/setLocale.swf?locale=us_en[^]
Above URL gives me IE script error. When i disabled IE Debugging script option in IE's Internet Options Advanced tab, I can navigate to above URL.
But what I want is that is there any other way to accomplish this task. I don't want to do it manually.
|
|
|
|
|
|
Hi,
Is there any API that can tell the file position inside the File System like cluster number,sectornumber,etc?
Means at which clusters the file is located.
|
|
|
|
|
That level of access requires a Ring 0 driver.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
I have a 2 CRichEditCtrl boxes on a CMDIChildWnd for which I want to set the Caret position.
I am handling KeyUp and KeyDown messages to track if a left or right arrow is pressed.If a right arrow is pressed in the first box and the cursor is on the last character then I move to next box.all this is working fine.
But the cursor goes at the end of the string for the next window.I want to place the cursor to the first character of the next window .I can place the cursor by SetCaretPos() but when a charater is typed the character gets typed at the end of the string.That is the cursor position has changed but the behaviour has not changed.
What should be done ? I want to change the cursor position alongwith the behaviour.
Regards
Pritha
|
|
|
|
|
Did you try using SetCursorPos()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You should let the control take care of the caret.
I believe you need to use CRichEditCtrl::SetSel(0,0) to move the
caret/insertion point where you want it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank for the support I got it
|
|
|
|
|
Helo,
I m using visual c++ 6.0.
I m developing win32 console application.
In that I m using third party Com object in my vc++ application.
So how I add and use thirdy pary Com dll in my vc++ application
Regards,
Amit
|
|
|
|
|
Using LoadLibrary() or CoCreateInstance() depending on what you have and how do you want to do this.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Please someone tell me how to use properties file in my program.
i.e. how can the values related to each key can be called in the program. And by which functions.
Thanks.
|
|
|
|
|
May be this question has been asked earlier. What is the format of your properties file? Since you talk about the key in your query, is the file in XML Format?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
The format is somthing similar as below..
file_name=file
max_no_of_files=10
level=max
I would also like to ask, is there any particular format for putting down the properties files for use in C++?
|
|
|
|
|
I think you need to extract the string using some delimiter. If you have the strings or the key-value pair on separate lines you can read the full line and then extract the key and the value based on "=" delimiter.
A proper way of writing down the entries, would be a XML file. You can find that lot of applications do use the XML file in the config format.
If you have lesser number of entries and you are allowed to read/write from registry you can also go for this easier option, but this depends on the privileges you have as a developer.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
That looks like old .INI file format - you can use the
WritePrivateProfileString()/GetPrivateProfileString()
functions to work with INI files.
Using XML is a more modern and flexible approach.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
pl_kode wrote: Please someone tell me how to use properties file in my program.
That's up to you and your program. It matters not that you call it a properties file, an initialization file, or an options file. What's in it is only relevant to your application.
Now, what exactly are you wanting to do with this file (i.e., what purpose does it serve)?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ok. I was given
ULONG dwToken;
Gdiplus::GdiplusStartupInput input;
Gdiplus::GdiplusStartupOutput output;
Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
if(status == Gdiplus::Ok)
{
Gdiplus::Bitmap srcBitmap(L"betty.PNG", FALSE);
Gdiplus::Graphics wndGraphics(staticwindow);
wndGraphics.DrawImage(&srcBitmap, 0, 0);
//Gdiplus::GdiplusShutdown(dwToken);
}
to draw pictures on a static control. I used ResEdit to create my window and I placed a Picture Control on the box. Turns out it seems to be a static control with a specific style to do this.
Now I am creating a dialog box and trying to draw the image again. I used Visual Studio's editor (no choice atm) to create my child window with the picture control called IDC_STATIC.
For some reason the above code no longer works. I step through it with no errors. So what could be wrong? well I looked into the .rc file and it is using some strange class for my picture control and not the static control like resedit's was.
Bwa?
If I use resedit's picture control it works. If I do not, I get no picture.
Any ideas?
|
|
|
|
|
Seems I am being silly today.
That code can't be run in WM_INITDIALOG.
What's the first message I *could* run it in?
|
|
|
|
|
May be wait for the first WM_PAINT message and do your stuff there?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I had problems in using the WM_INITDIALOG as well, and I solved it using a "bypass". I just used a bool bFirst setting it to TRUE in WM_INITDIALOG. Then in WM_PAINT took a look into, when true do some staff and putting it to false.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
As with most drawing, you should be doing it whenever the control receives a
WM_PAINT message
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for all the suggestions so far. I've tried doing it in WM_PAINT with just a little success.
Code is at end of post. I have a picture box control with type Bitmap on my control as position 0,0. I basically want a window where it just displays an image.
However with the current code below, I am unable to get the image to not "be covered up". If I take another window and cover up MY window and then move away, I can then see the image as I desire.
However this is not desired behavior. I have a function commented out called RepaintWindow. It's one of my custom functions. It gets the client rect of the window and calls invalidaterect for that section. A shortcut.
When that is not commented out, I get to see my image (again when moving another window onto MY window) for a brief second then it gets covered by up by gray again.
I am missing a small detail here and by god if I can't see what that is! Thanks for the help.
<br />
case WM_PAINT:<br />
{<br />
<br />
if(firstTime)<br />
{<br />
<br />
<br />
if(status == Gdiplus::Ok)<br />
{<br />
HWND staticwindow = GetDlgItem(hwnd,IDC_STATIC);<br />
HDC dc = GetDC(staticwindow);<br />
<br />
const int size = ad.message.size();<br />
char* placeholder = new char[size+1];<br />
strcpy(placeholder,ad.message.c_str());<br />
<br />
placeholder[size+1] = '\0';<br />
<br />
WCHAR temp[100];<br />
mbstowcs(temp, placeholder, size+1);<br />
<br />
Gdiplus::Bitmap srcBitmap(temp, FALSE);<br />
Gdiplus::Graphics wndGraphics(dc);<br />
<br />
Gdiplus::SizeF SIZE;<br />
srcBitmap.GetPhysicalDimension(&SIZE);<br />
<br />
int height = SIZE.Height;<br />
int width = SIZE.Width;<br />
<br />
wndGraphics.DrawImage(&srcBitmap, 0, 0);<br />
<br />
SetWindowPos(hwnd,HWND_BOTTOM,0,0,width,height,SWP_NOMOVE |SWP_NOZORDER );<br />
SetWindowPos(staticwindow,HWND_BOTTOM,0,0,width,height,SWP_NOMOVE );<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
firstTime = true;<br />
<br />
<br />
}
<br />
}<br />
|
|
|
|
|
Do you want to show image on the static control?do you have problem in this section? and also you can use of CImage class for load images.
|
|
|
|