|
I'd like to know how I can find out if two drive letters refer to partitions on the same hard drive.
I'm working on a database backup utility, & I want to discourage users from selecting the same physical hard drive for their backups as the hard drive where their 'live database' is running.
ie: If "C:\LiveDatabases" and "D:\My Backups" are actually located on the same physical harddrive(on different partitions), I'd like to know how to determine this info.
Thanks!
Wes
Sonork ID 100.14017 wtheronjones
|
|
|
|
|
Try checking out this site: http://www.users.intercom.com/~ranish/part/primer.htm
|
|
|
|
|
Thanks for the informative link, but I'm looking for API's that I'd be able to use to figure this out.
Thanks!
-Wes
Sonork ID 100.14017 wtheronjones
|
|
|
|
|
Not sure if this will give you the right info, but check out the GetVolumeInformation function on MSDN and the lpVolumeSerialNumber parameter.
Like it or not, I'm right.
|
|
|
|
|
I thought might be it, but I hadn't tested it yet...
thanks!
Wes
Sonork ID 100.14017 wtheronjones
|
|
|
|
|
Can an ISAPI Filter be used to catch content being sent to an FTP site?
Thanks,
ed
'Love is an obsessive delusion that is cured by marriage.' Dr. Karl Bowman
|
|
|
|
|
No. I believe ISAPI only filters HTTP requests.
Hope this helps,
Bill
|
|
|
|
|
Thanks...that is what I thought.
ed
'Love is an obsessive delusion that is cured by marriage.' Dr. Karl Bowman
|
|
|
|
|
How can I get IP address of any computers that connect to my computer through a CSocket variable ?
Ex: My computer run a program as a server, using a CSocket variable, listen to connection.
Client run a program connect to server at port 0 by a CSocket variable.
I want to get IP address of the client !
How to ?
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
Use <a href="http://msdn.microsoft.com/library/en-us/winsock/wsapiref_8woi.asp">getpeername</a> .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want my app to open a TCP communication thread to work with a certain device, which is not "dumb" in a way it can receive commands and even transmit some data back to my app in its own time. So I created a static thread function inside my control class for this reason only.
But, when I was trying to work with CSocket/CAsyncSocket *inside* the thread's context - MFC started to throw unhandeled execptions at me. so just to check things up - I moved the socket handling code into the main thread/process, and it worked fine there.
again - ALL the socket handling (including object declaration, creation, connect, ect) was done within the thread.
so what's the problem? anyone?
thanks for your help.
|
|
|
|
|
Are you using a worker thread created with AfxBeginThread and a AFX_THREADPROC ? If so, I think you got to use your CSocket s inside a CWinThread -derived object --use the second form of AfxBeginThread .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I suffered this problem a lot, and managed to sort it out.
My app has CSmtpListener in the main thread.
I created:- class CSmtpThread : public CWinThread
and gave it a member var of class CSmtpSocket : public CAsyncSocket
Then in CSmtpListener::OnAccept :-
void CSmtpListener::OnAccept(int nErrorCode)
{
WaitForSingleObject(m_hConnCountSemaphore, INFINITE);
CAsyncSocket s;
Accept(s);
CSmtpThread *p_SmtpThread = (CSmtpThread *)
AfxBeginThread(RUNTIME_CLASS(CSmtpThread),
THREAD_PRIORITY_NORMAL,
0,
CREATE_SUSPENDED,
NULL);
p_SmtpThread->Setup( s.Detach(), m_hConnCountSemaphore);
p_SmtpThread->ResumeThread();
}
The CSmtpThread::Setup function stores my semaphore handle and socket handle. Then, The CSmtpThread::InitInstance() attaches the handle to the member socket.
I used semaphores to control the number of child threads: it works quite nicely becuase the listener will sit and wait until the number of children drops before accepting the connection.
Jon
Signature space for rent. Apply Within.
|
|
|
|
|
Hello,
I have a "Wizard / Property page" type dialog app.. I am having problems pulling information from an edit box on page 1 from page 3.. Anyone have any ideas? It's probably something dumb..
Thanks,
Rob
Rob
|
|
|
|
|
See some code in this page (section Dialog&Windows)
http://www.codeproject.com/dialog/wizard2000.asp
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
The actual window control(s) are not created until you are on that page. Therefore, pull the data from member variables.
|
|
|
|
|
' anyone know if it is possible to use DirectDraw in windowed mode in a MFC application ?
What i would like to do is some graphic stuff whiere things could be triggered by the user clicking on buttons for example.
RaGe
|
|
|
|
|
The wgl* functions act on rendering context which is initialized
as
HGLRC wglCreateContext(
HDC hdc // device context of device that the rendering context
// will be suitable for
);
so you need to initialize the rendering context and continue doing
your directdraw, and release the hdc when the window is getting destroyed.
|
|
|
|
|
The wgl* functions are for OpenGL, which is completely separate from DirectDraw.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Why yes it is possible.
In fact, if you have the DirectX 8.1 SDK, there are a ton of sample programs included on this disk, three of which are MFC specific examples. Also, there is a base framework that you can use to develop MFC applications in both windowed and full screen mode.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Actually , I´m running my application under windows NT 4.0, but i´ve have not find any directX 8.1 SDK running under this OS ( for sure i´m such a lame i did not understand how the microsoft download "search" works ). In my MSDN (6.0), there is only a few examples running in Win32 apllication but without MFC (Well, MSDN and DirectX 8.1 SDK are not the same thing, I know) ... Meantime, I actually managed to display something even if it is still not what i want, but i´m sure it will eventually work
Anyway, thanks for your help.
RaGe
Unfortunately, brute-force solutions tend to be slow
even when performed by modern-day microcomputers,
which are capable of several MIPS except when I'm late
for an appointment and want to finish a compile and
run just one more test before I leave, in which case
the crystal in my computer is apparently designed to
automatically revert to 1 Hz.
-- Michael Abrash
|
|
|
|
|
Rage wrote:
Unfortunately, brute-force solutions tend to be slow
even when performed by modern-day microcomputers,
which are capable of several MIPS except when I'm late
for an appointment and want to finish a compile and
run just one more test before I leave, in which case
the crystal in my computer is apparently designed to
automatically revert to 1 Hz.
-- Michael Abrash
anybody who quotes michael abrash is cool by me
"... and so i said to him ... if it don't dance and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I'm able to load a bitmap into a HBITMAP. I want to put that HBITMAP on a CStatic control. Does anybody know the steps to take to make that happen?
Thanks
|
|
|
|
|
Look at
CStatic::SetBitmap and LoadImage
Michael
|
|
|
|
|
Sorry, I guess I should have also noted that I was able to get this far. The last piece is to resize the bitmap to the size of the CStatic control. Do you know how to do that?
Thanks
|
|
|
|