|
On NT, this is pretty easy using the performance data helper library (PDH.DLL). I think it's a bit more tricky in Win9x system though.
If you need any sample code, then drop me a line, though a search on the MSDN for PDH will point you in the right direction.
|
|
|
|
|
Take a look at GlobalMemoryStatus().
With this function you can get all the information you need about memory
|
|
|
|
|
I want to implement the "Send To" command, that sends the application document. This is provided by MFC in the CDocument class, however it uses MAPI and MAPI doesn't support HTML mails (i.e. "Content-Type: text/html").
I could use SMTP to do this, but then the user has to manually enter the SMTP server address, recipient address, etc, etc.
Can anyone tell me what the best way of doing this?
Thanks,
Ed
|
|
|
|
|
I have a problem with CComBSTR's. I create them using new , work with them a bit, pass them to a COM interface with string->Detach(), and after that I delete them with delete .
Every string leaks 8 bytes
Can anyone tell me why?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Once you call Detach(), the CComBSTR object no longer manages the string, so the leak you're seeing is probably the contents of the string.
Pass the string as (*string) which will call CComBSTR::operator BSTR to do the conversion.
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
Nope, it's exactly 8 bytes for each string, no matter how long they are...
If I call Copy() it the same
I'll try the (*string) tomorrow at work...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello,
I'm trying to make my last program easier and more powerful, in order to do this I would like to allow the user to choose the language that the program use, there's only a problem: I don't have any idea of how to begin... what should I know?
the other thing I would like to do is to prepare the same program to work with and without touch screens, then I would like to be capable to redimensionate some controls in order to allow the fingers work as the mouse pointer. Should I create two kinds of dialog for each window? (one for the touch and the other for the normal screen?).
As always thank you very much.
|
|
|
|
|
|
thank you very much for your redirection, it's a beggining, now I will try to look for more information, thanks
|
|
|
|
|
|
Hi everyone
I'm currently trying to develop a product with an interface very similar to Outlook's.
My question is how would I go about doing this? Do they use a SplitterWnd to split the left and right panes? and if so is the toolbar on the lef just a custom view that draws icons vertically?
I want to change the pane on the right depending on what is clicked on the menu in the left pane. ie if you click the hierarchy icon then a tree view will appear in the right pane and if you click the users icon then a list view will appear on the right.
I am thinking of making it an SDI app and just swapping the views depending on the users selections. Does this make sense to do it this way?
i found an article that outlined how to make an outlook style menu on codeguru
http://www.codeguru.com/menu/contentmenu.shtml
but this uses a dialog resource to shape the menu. Im guessing outlook uses a custome view which is what i will have to implement i guess. Unless anyone knows of an easier way..
Thanks for any help
Ash
|
|
|
|
|
I implemented an Outlook UI using the popular BCG library - dead easy and there is also an "Outlook SDI" sample that ships with the source. Visit http://www.bcgsoft.com for more info.
Basically, you start with a splitter window, split vertically into two panes, with the Outlook bar view on the left. The right hand pane contains another splitter window which is split horizontally allowing a "list" view and a "preview" view.
Regards.
|
|
|
|
|
|
You only have to look in MSDN at CString::CString , CString::GetBuffer , CString::ReleaseBuffer
1)LPCSTR->CString
CString constructor---CString::CString( LPCSTR lpsz );
2)CString->LPTSTR
LPTSTR GetBuffer( int nMinBufLength );
Make sure you understand the ReleaseBuffer method.
|
|
|
|
|
Thank you Daniel !
Is the type LPCSTR is present in every language in windows ?
|
|
|
|
|
typedef const char* LPCTSTR
|
|
|
|
|
Is there anybody knows how to find the names of the shared files and folders on a remote computer like "network neighborhood" does?
"FindFirstFile" function doesnt seem to work. Maybe the path i use is not correct or it doesnt work at all on the subject.
Ex: FindFirstFile("\\Comp_name\\fold_name\\*.*" ,.....)
PS:
And more... Im very curios to find out how "network neighborhood" manages to obtain those shared files and folders? What's the mechanism it use?
Thank you.
|
|
|
|
|
FindFirstFile("\\Comp_name\\fold_name\\*.*" ,.....)
You're missing a slash at the beginning (well, two actually):
FindFirstFile("\\\\Comp_name\\fold_name\\*.*" ,.....)
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
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 !
|
|
|
|