|
FindFirstFile(\\\\Comp_name\\fold_name\\*.*" ,.....).
I still dont get how this function works...
|
|
|
|
|
FindFirstFile returns a handle,
so one's code would look like this... (a snipped from my production code)
WIN32_FIND_DATA fd;
CString sQualifier = sPath;
sQualifier += _T("\\*.*");
HANDLE hFindFile = FindFirstFile(sQualifier, &fd);
BOOL bBool = hFindFile == INVALID_HANDLE_VALUE ? FALSE : TRUE;
if (!bBool)
return FALSE;
int i=0;
while (bBool)
{
if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
listFiles.insert(FileList::value_type(fd.cFileName, fd));
i++;
}
bBool = FindNextFile(hFindFile, &fd);
}
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
I knew all the things you tell me.Thanx, anyway.In fact wanted to ask something else...
I meant how does a function on my computer like FindFirstFile managed to find out the shared resource on a remote computer? From where that function collects theese informations? What network protocol theese function use?
Why do i ask all theese questions? Just because i want to write a project... I want collect from my LAN how many information i can. All theese informations i want to monitorize on my computer. If i write a socket based client on every computer and a server on my computer then the problem is solved. BUT, I WANT TO WRITE A SINGLE APPLICATION ON MY COMPUTER IN ORDER TO GATHER INFORMATION FROM ALL COMPUTER IN MY NETWORK, ABOUT:IP ADDRESS, PROCESSES, MAC ADDRESS, FREE SPACE ON HARDDRIVES, AND MANY MANY OTHERS. Of course, i make use of SNMP (MIBII) BUT ONLY LOCAL. I dont know how to access SNMP information on remote computer.
I hope i wasnt boring and i made myself clear.
|
|
|
|
|
I think the Windows Networking (WNet) functions could be what you need. See the Platform SDK docs under Networking and Directory Services/Network Management.
|
|
|
|
|
WNet is exactly what i was thinking about!
i discovered WNet looking at "Computers enumeration" article. Now that you told me about WNet i have more trust in it. I have to say my WNet knowledge is zero.
Did you actualy use WNet on your projects? Do you know some articles except MSDN ones?
Thank you a lot!
|
|
|
|
|
FindFirstFile("\\Comp_name\\fold_name\\*.*",... ) works fine.
But FindFirstFile("\\Comp_name\\*.*,...) doesnt return anything...
Then i started the "Command Prompt" and type "dir \\comp_name" and i got the following message:" The share name was not found" !!!!!
i also mention that in Command prompt the following works fine: "dir \\comp_name\\fold_name" !!!!
If i type in Command prompt "NET VIEW \\comp_name" i get exactly what i want. Try yourself if you think i'm jocking.
So, how do i find out the parent directories on a remote computer (in my application, of course)?
Thank you... again:
|
|
|
|
|
I created by Wizard ATL COM DLL that import my MFC extention DLL(from type: base Dialog) in my ATL.
Please check my steps (describes below) and tell me if I miss something.
(because I dont success create instance of it from client program)
------------------------------------------------------------------------
1. I opened project: ATL COM Wizard. [DLL] [MFC Support]
2. I inserted to the library that created the file : MyMfcDll.dll
and attached to the ATL project the files : MyMfcDll.h , MyMfcDll.lib
3. I Added by wizard ATL class [MyClass] [single] [dual]
4. I added by wizard method [ShowMfcDialog] to IMyClass and fill it so :
___________________________________________
#include "MyMfcDll.h"
STDMETHODIMP CMyClass::ShowMfcDialog()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
CMyDialog dlg; //from the imported dll
dlg.DoModal();
return S_OK;
}
______________________________________________
and that's all !
What is missing ?
I will be greatful if you will help me !
|
|
|
|
|
HI !
Now I see that in OLE/COM Object viewer CMyClass class present in the folder : Automation Objects but if I try open it by press on the + I gets the messageBox:
------------------------
CoGetClassObject failed
class not registered
REGDB_E_CLASSNOTREG(..)
------------------------
What is the problem ?
|
|
|
|
|
|
Is this the same machine that you compiled the ATL dll on. If not, then have you registered the dll. regsvr32 <dll filename>
Michael
|
|
|
|
|
How ?
|
|
|
|
|
from the command prompt,
regsvr32 mydll.dll
Michael
|
|
|
|
|
hi,
To Register the component in a Dll, Run:
regsvr32 yourDllserver.dll
To Un-Register the component in a Dll, Run:
regsvr32 -u yourDllserver.dll
Note:
Run the program "regsvr32" in the directory in which you have your Dll.
or,
Specify the full path to regsvr32
Firoz
|
|
|
|
|
Can you answer me on my first question in this thread also ?
I will be greatful !!!
|
|
|
|
|
When I try present the dll by a client program .
now (after the registration of the dll) it create instance successfully but when It come in to the line that execute function of the dll the computer become crazy and I gets the message :
" 'ClientProgName' caused an invalid page fault in module KERNEL32.DLL "
---------------------------------------------------------------------
In the first question in this thread I detailed my steps of creation that ATL. Is something wrong or missing in it ?
______________________________________________________________________
Or maybe the problem is in my client program ?
----------------------------------------------------------------------
Please ! Please ! Help me !!!
|
|
|
|
|
Hi dear fellow programmers!!!
I have an Edit box in my dialog program(actually 3 and all of them have the same problem) whenever I click on them and then I click on another program(for instance, Internet Explorer) my system crashes...it seems that my dialog box hogs all the system resources...and I can't close it even the Task Manager wouldn't work. At the moment I am running Windows XP but I had the same problem in Windows 2000 before..
Please help!!! Why is this happening? and how can I solve the problem??
|
|
|
|
|
We need to see some code to provide more specific help. What message handlers have you got for the edit control? Are you handling WM_KILLFOCUS or the edit change messages?
Michael
|
|
|
|
|
i have a DirectX program which run under a Full Screen mode,
but now i want to make it display in a window,how could i do this?
please help me.thanx.
|
|
|
|
|
Dear Frineds
I want to select content from any application window to modify the selected contents there only using Win32application.Selection should be done either by mouse movement or by keyboard.
So please let me know how to do this.For output display we can use WM_paint message but for other application what i have to do.What is otheralternative for InvalidateRect or InvalidateRgn in this case.
Kindly help me and guide me how to do this.
Thanks in advance.
Binay
|
|
|
|
|
Let me get this right - you want to select displayed information in another application, and change it ? Any application ? To do that you need not just to change what is drawn ( that is easy ) but to change the data in the application itself ( because it will respond to WM_PAINT messages also ). There is no way I can think of to do this generically, if a way exists, I will be amazed.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Dear Graus
Hi
Thanks for replying to my mail.I wanted to select text from any application and want to change it contents their only.Take an example --
i selected some part of a text file say .doc using mouse click and then and i want to modify the same selected content accordingly by my code.
i am doing this by placing the entire/selected content to display/output file and modifying it their.Now i don't want to place the selected content and want to modify it in the same application window, and it can be any application either word,or whereever any text contents.
So kindly help me in doing this.or it is possible or not and if yes then how.
Thanks once again
Bye
Binay
|
|
|
|
|
If you're looking to do it with text, then it may be possible, because if you can get the HWND of the edit box, you can send select, cut and paste messages to it. However, this strikes me as a very strange ( or at least unfriendly ) thing to want to do. Are you wanting to write a program that enters usernames and passwords or something similar to automate a task ? That's the only good reason I can think of.
Anyhow, it's possible to get a HWND from mouse position ( I forget the command ), that's probably as good a place as any to start.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Dear Graus
Hi
Thanks once agian for ur advice.As i written to you before i am doing this using cut and paste method by copying the contents to my window or u can say it as output display.and there only i am modifying it,say changing the font.
But i wanted to do it in another way.now i don't want to paste and put it into output display but want to change their only from where i am copying.
how it will be possible and if possible kindly give me example or please tell me about that instruction.
Thanking you in advance and once again thanks for replying.
Bye
Binay
|
|
|
|
|
I want to load a bitmap from a specified location on my hard drive eg: "C:/bg.bmp" rather then using a resource bitmap like LoadBitmap(IDB_MYBITMAP)
Any suggestions would be excellent, thanks
Ryan
|
|
|
|
|