|
ok i agree with you inthis topic.
yeah it possible that if the port don't allow to connect we can't do any thing
i think i have to work on it thanks for suggestion
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
If you want to check for someone port scanning your machine you open a bunch of ports on your machine where nothing is running. If something hits several of them you know you are beind port scanned.
More complex is to listen for all packets, and decode the raw packets. Look for connection attempts, and if you see multipul connections you know you are being port scanned.
The hard part is telling the difference between acidental connections to your machine (someone who intended a different machine but typed the wrong address), and a port scan. Portscanners may run with several machines over a long time, hoping the port scan will not trip your detector instead it looks like the former.
|
|
|
|
|
Can u suggest me an algorithm to do so..
i know the basics of detection. just watching on closed ports is also a type of ports can detection but it gives lots of false positives.. i need some advances level help..
|
|
|
|
|
Not myself. Google around, I know there are open source programs that attempt to do this. Read their code. (but watch the license)
|
|
|
|
|
Hi,
I am looking for a reporting with certain abilities. I know and used Crystal Reports, but the reports are bound to a database. I would like to fill the data directly from my application. I tried Visual Reports, but i can't display a preview as a child window in my application dialog. I'd like to have an ActiveX View Component.
Can anyone give me a hint?
The tool should have:
- A Report designer to design the report
- A ActiveX Viewer component for application integration
- The data shouln't come directly from a datatabase, i need to fill the data in myself from the application.
greets,
Jason
|
|
|
|
|
Hi,
I am new in MFC.
I would like to change a dialog box into property page.
Is it possible or not?
If it is possible.So, please help me "How to change a dialog box into property page".
rajesh
|
|
|
|
|
1.Yes. but as far as I know you cannot use property page alone ,you have host your property page in Property sheet.
2. Look into MSDN for "Using Property Sheets in Your Application"
Click Here
[^]
-With Regards,
Abhi Lahare
|
|
|
|
|
i have a tool for data migration.
the tool is developed in vc++ with backend as sql server.
and i want to improve the performance of the product.
I have a datamigration tool where in i take set of records from source side and apply some data manipulation functions like substring,date functions and transfer to target. So i need to do it record by record so it hits my performance level.I have a recordset and will hold all the records of the source table how huge it would be. Can i reduce the burden anywhere in this process
Can anyone help me out on this.
thanks.
srinivasp.
|
|
|
|
|
Optimizing code is a tricky business, indeed, and your question is so nebulous so it borders on the immaterial
First of all, you must find the exact bottlenecks of the current implementation. Is it the database handling? The string handling? Something else?
A small performance gain in an often used function can give some gains. But IME, those gains are often only measured in single-number percentages - the really big performance boosts can often be found by rethinking the problem.
So, start by identifying what is taking the most time. Then it might easier to submit more specific questions!
|
|
|
|
|
Make sure that your SQL code to manipulate/save the data is written as stored procedure(s). This can have a dramatic impact if you are processing row by row and executing SQL for each row.
onwards and upwards...
|
|
|
|
|
I'm trying to create an app to perform several tasks with files, my question is:
When I found a file, then i want to open it use its suported program, how do i ???
(How to open a file with its suported program.)
any one help me please?
(sory, my English is not well)
thanks
|
|
|
|
|
<br />
ShellExecute(NULL, "Open",pathName,0,0,0);<br />
It is Illogical to define an inventor by his invention
|
|
|
|
|
for 32 bit OS
BOOL CreateProcess(
LPCTSTR lpApplicationName, // name of executable module
LPTSTR lpCommandLine, // command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
BOOL bInheritHandles, // handle inheritance option
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // new environment block
LPCTSTR lpCurrentDirectory, // current directory name
LPSTARTUPINFO lpStartupInfo, // startup information
LPPROCESS_INFORMATION lpProcessInformation // process information
);
for 16 bit OS
UINT WinExec(
LPCSTR lpCmdLine, // command line
UINT uCmdShow // window style
);
gabby
|
|
|
|
|
thanks alot for your help Wadi,
Can i ask you any more...
--------------------
Ghazi Al Wadi wrote:
Hi,
Hope this helps
Retrieving the owner of a file requires:
obtain the security descriptor for the file, Use GetFileSecurity()
then using the security descriptor to get a pointer to the owner's Security Identifier (SID). GetSecurityDescriptorOwner()
Finally, you use the owner's SID to obtain the owner and domain name of the file LookupAccountSid()
------------------------
thanks, could you give me a simple example???,
i've tried but it's not resposible:
CString TheFile;
TheFile=CString(Buffer[i].FileName).Left(Buffer[i].FileNameLength / 2);
SECURITY_DESCRIPTOR sd;
DWORD sob;
GetFileSecurity(TheFile,OWNER_SECURITY_INFORMATION,&sd,sizeof(sd),&sob);
SID pOwner;
BOOL OwnerDefault;
GetSecurityDescriptorOwner(&sd,(PSID*)&pOwner,&OwnerDefault);
char AccountName[80];
char DomainName[80];
DWORD cbDomain;
DWORD cbName;
LookupAccountSid(NULL,&pOwner,(LPTSTR)AccountName,&cbName,(LPTSTR)DomainName,&cbDomain,NULL);
::AfxMessageBox(AccountName,0,0);
help me please???!!!
thanks
|
|
|
|
|
Hi,
The issue is you have to find the required buffer for each parameter. see the example below.
Simply open up an MFC Dialog project and place this code in the OnOk () function.
Browse for and select the fpasted file and clikc ok.
Cheers
<br />
void CFindOwnerDlg::OnOK() <br />
{<br />
char szFilters[]=<br />
"MyType Files (*.*)|All Files (*.*)|*.*||";<br />
<br />
CFileDialog fileDlg (TRUE, "*", "*.*",<br />
OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, szFilters, this);<br />
<br />
if( fileDlg.DoModal ()==IDOK )<br />
{<br />
ULONG uSizeSD ;
PSID pOwner = NULL ;
char szName[MAX_PATH] ;
char szDomain_name[MAX_PATH] ;
<br />
<br />
ULONG uName_len ;
ULONG domain_len;
char *sdBuf;
SID_NAME_USE deUse ;
<br />
<br />
int bSuccess = 0;<br />
szName[0] = 0;<br />
szDomain_name [0] = 0;<br />
uName_len = 0;<br />
domain_len = 0;<br />
<br />
BOOL fOwnerExists = FALSE;<br />
<br />
<br />
<br />
CString pathName = fileDlg.GetFileName ();<br />
<br />
<br />
bSuccess = GetFileSecurity( <br />
pathName, <br />
OWNER_SECURITY_INFORMATION, <br />
0, <br />
0, <br />
&uSizeSD);<br />
if (bSuccess != 0) <br />
MessageBox ("It should not happen as it should be an error "); <br />
else<br />
{<br />
sdBuf = new char [uSizeSD];<br />
<br />
bSuccess = GetFileSecurity( <br />
pathName, <br />
OWNER_SECURITY_INFORMATION, <br />
sdBuf, <br />
uSizeSD, <br />
&uSizeSD);<br />
<br />
bSuccess = GetSecurityDescriptorOwner(sdBuf, &pOwner, &fOwnerExists);<br />
<br />
<br />
bSuccess = LookupAccountSid (NULL , pOwner ,szName, &uName_len, szDomain_name, &domain_len, &deUse);<br />
bSuccess = LookupAccountSid (NULL , pOwner ,szName, &uName_len, szDomain_name, &domain_len, &deUse);<br />
<br />
if (bSuccess == 0) <br />
MessageBox ("Error ");
else<br />
{<br />
CString msg;<br />
msg = szDomain_name ;<br />
msg= msg + "\\";<br />
msg =msg + szName;<br />
MessageBox (msg);<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
}<br />
It is Illogical to define an inventor by his invention
|
|
|
|
|
Hi Ghazi Al Wadi,
You maybe misunderstand my question.
my problem is : When an other computer on my Local Area Network (LAN) connected to my computer and has pasted a file on my Shared Folder. I wanna know : who (which computer on my LAN) has pasted the file?.
Could you help me more, Wadi.
thanks
|
|
|
|
|
Hi Ghazi Al Wadi,
You maybe misunderstand my question.
my problem is : When an other computer on my Local Area Network (LAN) connected to my computer and has pasted a file on my Shared Folder. I wanna know : who (which computer on my LAN) has pasted the file?.
Could you help me more, Wadi.
thanks
|
|
|
|
|
Hi,
yes you are right , I must have misunderstood the question.
The answer assumed that the required piece of information is: "What is the user name of the person who pasted that file on my shared folder" The answer will give you the name of the person who was logged on to the computer that pasted the file. As for from which computer was the files pasted, the answer does not come to me right now.
I would do more invistigation in a timly manner.
I hope one of our fellow CPians may have an answer.
It is Illogical to define an inventor by his invention
|
|
|
|
|
Hi !
I've read somwhere that one of Java's feature is 'reflection', where C++ doesn't have this feature. I tried to find on the web some more info but didn't find anything. What exactly is 'reflection' and is it correct that C++ doesn't have this feature ?
Thanks !
Jerome
|
|
|
|
|
I haven't heard about Java including 'reflection' yet, but I suppose that's a good thing. The first I heard of it was in a book on C#, and I have yet to understand why anyone cares about it. I can't figure out any use for it, any value added in terms of efficiency, readability, or maintainability. Any "improvement" that doesn't add to any of the above is mere clutter, and deserves no attention. As far as I can tell, C++ doesn't have this attribute, and it lacks nothing for its absence.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Oh..
I think your are wrong. Im new to C# but AFAIK with reflection you can create something like "PlugIns"
with a LOT less code than in C++ ...
|
|
|
|
|
is it somehow related to message reflection in MFC?
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
Yes, reflection is a technique that's been in Java for a long time. The Sun page for it can be found here[^]. Basically, it allows you to examine (reflect) a class at runtime and create objects and run functions that you don't know about at compile time. As the API states, you shouldn't use it where something else would be more appropriate, but it can be very useful.
C++ does have some reflection features already - you can use RTTI to examine a class, and there are various techniques for implementing the rest of reflection (policies, STL, etc).
So, it's not correct to say that C++ doesn't have reflection, but some parts of it you need to handle yourself.
|
|
|
|
|
'reflection' is the ability to obtain detailed information about an object type at runtime. You could, for instance, obtain a list of all the method signatures of an object and invoke a method explicitly through the runtime. C++ has very limited run time type information, it can compare types at runtime and perform safe dynamic casts, nothing flashy.
C++ does have templates though, which are more than sufficient to do most of the codegeneration and type inspection tricks that reflection allows - but using the compiler rather than the runtime.
Have a look at http://www.boost.org/libs/mpl/doc/[^] if you are feeling brave
Ryan
|
|
|
|
|
I have a program, that displays this in the debug window when i exit it. Do i have to worry? What does the exit code mean? I thought a healthy program should return an exit code of 0.
The thread 0xF48 has exited with code 2 (0x2).
The thread 0x3B8 has exited with code 2 (0x2).
The thread 0xF70 has exited with code 2 (0x2).
The thread 0xDCC has exited with code 2 (0x2).
The program 'D:\Documents\BarcodeRT ver2.2\Debug\BarcodeRT.exe' has exited with code 2 (0x2).
|
|
|
|
|