|
Man, I'm glad I'm not you!
It is possible to determine if a directory is shared on the network. But what they appear to be asking for is a monitoring program. What I mean by that, is a program that is constanly checking if a directory has started being shared (not a program that knows the information when it firsts starts).
Now there is the possibility that the server may log this information (I dought it), if it does then the access to the information is probabaly undocumented (Welcome to Windows programming). Before you ask how to retrieve the information, you need to know if the information is there to be retrieved (ask the administrator or a network guy). If the server does not log the information, then they are asking for a monitoring program (if they know it or not).
Monitoring probably means calling NetShareEnum and noting the time when your program first started checking and noting when any change has occured, there-after.
Good Luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hello thank you for your response,
I understand what you mean, but I am going to reformulate my question because my problem is less tricky than you thought (hummm...I hope).
So, my problem is to detect on my computer and only on my computer when a directory start to be share.
Between us...I would prefer to have more time and more documentation, source, etc.
Thank you, for your response, If this precision help you to understand my problem, I'll be glad to have your help
|
|
|
|
|
Does FindFirstChangeNotification() help?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yes it does,
I think it's possible to use on of these functions :
ReadDirectoryChangesW,
FindFirstChangeNotification(),
NetShareCheck,
NetShareAdd.
Now, I am going to test and see...
None of these functions answer precisely to my request, but I think it's possible to do sthg...
let's go coding...
If you have something else...I am listening all day long, thank you!
|
|
|
|
|
Hi,
I want to get the source of a web page.
Currently im using Cwebbrowser2 but i fail to retrieve the information.
i tried to use GetDocument().
<br />
m_Browse.GetDocument()<br />
What goes wrong?
Pls advice.
If possible , pls give an example code.
thanx
|
|
|
|
|
www.funducode.com/projideas/Project3/Project3.htm
http://msdn.microsoft.com/workshop/browser/webbrowser/tutorials/wbtutorial.asp
Hope it helps.
http://www.priyank.in/
|
|
|
|
|
Hi Guys... I am stuck in a problem.
To suppress the error "The host name in the certificate is invalid or does not match.", I have added a flag "INTERNET_FLAG_IGNORE_CERT_DATE_INVALID" in my code. But still getting message.
---------------------------------------------------
CString csPostString = strQry;
CString csObject;
INTERNET_PORT nPort;
DWORD dwServiceType;
DWORD dwHttpRequestFlags;
csUrl = strSiteUrl.c_str();
AfxParseURL(csUrl, dwServiceType, csServerName, csObject, nPort);
if ( dwServiceType == AFX_INET_SERVICE_HTTP )
dwHttpRequestFlags = INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
else if ( dwServiceType == AFX_INET_SERVICE_HTTPS )
{
dwHttpRequestFlags = INTERNET_FLAG_EXISTING_CONNECT |
INTERNET_FLAG_NO_AUTO_REDIRECT |
INTERNET_FLAG_RELOAD |
INTERNET_FLAG_NO_CACHE_WRITE |
INTERNET_FLAG_SECURE |
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID |
INTERNET_FLAG_IGNORE_CERT_CN_INVALID;
}
else {
SendError(-1, "Bad URL to connect to server" );
return false;
}
TRY
{
pConnect = session.GetHttpConnection( csServerName, nPort );
pFile = pConnect->OpenRequest(CHttpConnection::HTTP_VERB_POST,
csObject, NULL, 1, NULL, NULL, dwHttpRequestFlags);
// step 3.
pFile->QueryOption( INTERNET_OPTION_SECURITY_FLAGS, dwHttpRequestFlags );
dwHttpRequestFlags |= SECURITY_FLAG_IGNORE_UNKNOWN_CA;
// Set the new security flags
pFile->SetOption( INTERNET_OPTION_SECURITY_FLAGS, dwHttpRequestFlags );
pFile->AddRequestHeaders(szHeaders);
pFile->SendRequest(NULL, 0, (LPVOID)(LPCTSTR)csPostString, csPostString.GetLength());
}
CATCH(CInternetException, eInet)
{
if (eInet->m_dwError = 1238)
{
AfxMessageBox("Error");
}
eInet->GetErrorMessage(szErrorCause, sizeof(szErrorCause));
SendError(eInet->m_dwError, szErrorCause);
goto cleanup;
}
AND_CATCH(CException, eGeneric)
{
eGeneric->GetErrorMessage(szErrorCause, sizeof(szErrorCause));
SendError(-1, szErrorCause);
goto cleanup;
}
END_CATCH
|
|
|
|
|
Hello,
I would like to know if we can use winsock functions in a Dll?
If yes please give an example for the same.
Mythri
|
|
|
|
|
Why wouldn't you be able to?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
i am enumerating the services present in my computer using
::EnumServicesStatus(scman,SERVICE_WIN32,SERVICE_STATE_ALL,
lpservice,bytes,&bytesNeeded,
&servicesReturned,&resumeHandle);
// scamn is handle returned by OpenSCManager()
but i am getting an error
_AFX_INLINE CStringData* CString::GetData() const
{ ASSERT(m_pchData != NULL); return ((CStringData*)m_pchData)-1; }
in the debugger .pls sort out my problem
|
|
|
|
|
Show all code.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
I believe , i have sorted out, thanks for reply
|
|
|
|
|
How about sharing the results.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Show us the code that is using a CString or related object. Also, what types are the variables being sent to EnumServicesStatus() ? Is lpservice large enough?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Respected All
Regards!
what are the equelent function in VC++ of inp() and outp(), so plz help .
From
David
david
|
|
|
|
|
What are you doing with direct port access in Windows? This can't be done in NT as the privledge level of the processor is set to prevent it. It's probably possible to do it back in Windows 9x, but who uses that these days?
The equivlent would be to just inline "IN" and "OUT".
This goes against modern Operating Systems which are designed to abstract hardware from the application developer. If you want to do direct port access, write a hardware driver.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
As Toby said, you can use a driver to access I/O ports from a program running within NT. A few months ago, I made use of PortTalk[^] to read/write some ports in order to control some low level undocumented features of a PCI card.
|
|
|
|
|
Respected All
Regards!
I am David and a nowadys learning VC++.
" I have to develop the TRENDS of any Geometric Functions like Sin(),Cos() etc, against time or something else.
mean that how to draw the Functions graphically against Time or any things.
Thanks
Best Wishes.
David
david
|
|
|
|
|
Search on this website for a chart control. This will allow you to drw these functions inside a chart.
|
|
|
|
|
Hi everybody,
I am doing a project in image processing using VC++.
I want to dispaly the image to the user, for which I got all the information about the bitmap from the Serialize function. Except 24 bit bitmap all other bitmaps are not displayed properly
Should I add any extra code for displaying 1,4,8 bit bitmap?
Pls Help
|
|
|
|
|
Hi,
You should you Device-Independent Bitmaps rather Device-Dependent Bitmaps. it might solve your problem.
Jitendra.
|
|
|
|
|
Hi,
You should use Device-Independent Bitmaps rather Device-Dependent Bitmaps. it might solve your problem.
Jitendra.
|
|
|
|
|
Dear All,
My application converts images of TIFF format to TIFFG3Fax. For this i'm using WriteFile sdk method to write data to the file. It fails. But when i use _lwrite, it works fine. Can someone tell me what is the differences between these two functions. _lwrite is obsolete so MSDN says that WriteFile should be used. But it fails with error code 183 (ERROR_ALREADY_EXISTS)
Please help!
Devoirs,
____________________________________________________________
rishabhs
I think therefore I am.
|
|
|
|
|
0:000> u kernel32!_lwrite
kernel32!_lwrite:
7c838d93 8bff mov edi,edi
7c838d95 55 push ebp
7c838d96 8bec mov ebp,esp
7c838d98 837d1000 cmp dword ptr [ebp+0x10],0x0
7c838d9c 741f jz kernel32!_lwrite+0x21 (7c838dbd)
7c838d9e 6a00 push 0x0
7c838da0 8d4510 lea eax,[ebp+0x10]
7c838da3 50 push eax
0:000> u
kernel32!_lwrite+0x11:
7c838da4 ff7510 push dword ptr [ebp+0x10]
7c838da7 ff750c push dword ptr [ebp+0xc]
7c838daa ff7508 push dword ptr [ebp+0x8]
7c838dad e8ed81fdff call kernel32!WriteFile (7c810f9f)
Pretty funny huh? I think u need to paste both code snipets.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Well, yes, that you went all the way to some disassembly
If you load the C run time source code and visually trace through it, you could see that all the 'standard' file IO calls typically devolve into CreateFile, ReadFile, WriteFile, and CloseHandle - after psending a fair bit of time mapping the fiol I/O flags and parameters into the ones that the Win32 API expects
|
|
|
|