|
Try this out:-
enumerate all keys under :-
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class
For each key check the defaul value. For one of them the default value will be "Monitors"
Open that key. For me it was this key :-
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96E-E325-11CE-BFC1-08002BE10318}
It will have subkeys. I had only one called "0000". Open that key :-
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96E-E325-11CE-BFC1-08002BE10318}\0000
See the value of this string - DriverDesc. For me it was "Default Monitor" as I hadnt installed my monitor's driver yet. The info you see in device manager is taken from this key. You'll also find other interesting details here like DriverDate, InfPath etc.
Good luck
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
|
I want to learn more about Client/Server programming over LAN using MFC.
Can you tell me a place to find a e book or just a name of a book?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Hey good luck! I don't know of any books addressing this particular topic, but it depends on what exactly is it that you are trying to find out.
By saying "Client/Server programming", I assume you mean networked programming? I recently had to take up this subject as well, and I can point you to two excellent sources of information (though neither one is definitive):
For general sockets (and therefore TCP/IP) programming NOT using MFC, I have read almost every word of the Winsock Programmer's FAQ (http://tangentsoft.net/wskfaq/) and have found out a lot about the subject, though it does not go over the MFC classes for network programming.
For an MFC angle on it, there is a good chapter in "SAMS Teach Yourself Visual C++ 6 in 21 Days" that covers sockets programming.
Of course, this site is a source of a lot of knowledge, but my suggestion is to start with the FAQ site above and work through the examples. This should give you an understanding of how C/S works from a networking perspective. MFC just adds a nice, clean layer on top of this.
All in all, I have found it to be a very easy to understand subject.
If you are looking for something other than network programming, post here and maybe myself or someone else would have some good pointers.
"If ye love wealth better than liberty, the tranquility of servitude better than the animating contest of freedom, go home from us in peace. We ask not your counsels or your arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
--Samuel Adams
|
|
|
|
|
Is there a programmatic way to determine the process/thread ids of threads waiting on a mutex? I need this for diagnostic purposes.
Thanks for the help,
Bill
|
|
|
|
|
I've successfully modifyied my PropertySheet to use vertical tabs rather the top/horizontal default tabs. The only problem is the tab labels are displayed horizontal instead of vertical. How can I make them vertical?
-ken
Ken Goguen
Principle Design Engineer
EMC Corporation
|
|
|
|
|
I'm working on an ATL DLL that will be used as a helper tool for ASP and scripting applications. The apps run inside a managed environment with a service-level COM architecture based on VB and VC++ DLLs that implement various interfaces, which the v-table challenged languages can't get at. The idea goes something like this:
STDMETHODIMP CDispatchHelper::CreateInstance(BSTR ProgID, BSTR Interface, IDispatch **pReturn)
The code will take the progID, call CLSIDFromProgID(), then CoCreateInstance and then invoke QueryInterface on the pointer, which is then returned with no more than an AddRef() call (the helper DLL is a pure IDispatch implementation, obviously). The problem is getting the IID of the interface, which is passed as a simple string (no GUID). I figure I can:
- Load the implementation typelib, look at the coclass and follow the tlb chain down to the interface. This is OK, but it's kinda hacky. Plus it's kinda slow, I think.
- Enumerate HKEY_CLASSES_ROOT\Interface until I find the string. I have the GUID already (the name of the parent key) so I just call StringToIID() and I'm done. I figure this is what COM is doing anyways. It takes just a couple of milliseconds to go through the entire branch, but my feeling is that Microsoft can write better code than me any day.
- ... and I'm all ouf ideas. Is there a reliable way to take the name of an interface and get its GUID? Some undocumented COM API or something like that?
Thanks for any thoughts....
___________
Klaus
[www.vbbox.com]
|
|
|
|
|
Try this
CLSID ID;
CString strObjName = "Object.Interface";
HRESULT hr = CLSIDFromProgID( strObjName.AllocSysString(), &ID);
if (hr != S_OK)
Hope this helps,
Bill
|
|
|
|
|
Hi Bill,
That won't do the trick. The IID of the string I'm trying to get cannot be retrieved through a simple CLSIDFromProgID, since it's an interface, not an implementation coclass. It's in the system registry, but it's not recognized by COM as a progID (rightly enough).
But thanks anyway
___________
Klaus
[www.vbbox.com]
|
|
|
|
|
I was just wondering what the 'right' way to save data from a listbox is because so far i've always just written functions that get the text from each item and write it to a file with a seperator like '\n' or something. Isn't there like a universal way to save the data??
Kuniva
|
|
|
|
|
No, You have not a universal way to save the data, You can save de data in files or in the registry...
If you use the CStdioFile class, you can save the data in very few steps...
Best Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I was just wondering....
In visual basic you have two modes of filewriting: random access and binary or something. With the random thing you can specify a string to write and an index so it will automatically give the string an index in the file. I'm not sure how this works but i would like to know if there's a similar thing in MFC?
Kuniva
|
|
|
|
|
I'm sorry you don't have something like random access, but you have binary access or Text Access and different modes like, Write, Read, etc...
Look in CFile::CFile();
Best Regards!!!
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
oh, ok then, Thanks for your help!
Kuniva
|
|
|
|
|
oops, i took a look in the MSDN and there appears to be something as random file access afterall i think, allthough i dont fully understand it, here's what it said:
CFile::Seek
This method repositions the pointer in a previously opened file. The Seek method permits random access to the contents of a file by moving the pointer a specified amount, absolutely or relatively. No data is actually read during the seek. If the requested position is larger than the size of the file, the file length will be extended to that position, and no exception will be thrown.
Kuniva
|
|
|
|
|
The Seek make that you can move into the file, the bytes that you enters in the first parameter...
If you want to go to the beguin of the file you must to put 0 or CFile::begin in the second parameter.
You can read from that position.
For example if you have that you need to read 4 bytes from the 30th byte, you need to do
<br />
...<br />
pFile.Seek(30, CFile::begin);<br />
pFile.Read(pbuf, 4);<br />
...<br />
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
In Python there is a method called CPickle which will dump data structures into a binary file. that way many executables could share a data structure. It was accomplished using C. Does anyone know how this could be achieved for MFC's template data structures.
-JD
|
|
|
|
|
If it's just data, then no problem If they're classes, with virtual functions, then it's a big problem. Part of your data includes the virtual function table, which will not be the same between processes (or even between invocations of the same program).
Simply:
fwrite(&data, sizeof(data), 1, file);
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
> If they're classes, with virtual functions [...]
Or even structures with virtual functions...
> If it's just data, then no problem
You do, of course, need to be smart enough to consider alignment and packing issues (and sometimes endian-ness!) when dealing with reading and writing data structures in such a way.
Peace!
-=- James.
|
|
|
|
|
can anyone tell me what the include file is for WM_KICKIDLE??? When i try to compile it tells me that WM_KICKIDLE is an undeclared identifier.
Kuniva
|
|
|
|
|
|
thanks, damn why didn't i think of that...
Kuniva
|
|
|
|
|
Could you please explain me what WM_KICKIDLE is for?
Never heard about it...
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Kick idle is an internal MFC message used to support idle time processing.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
WM_KICKIDLE is a Hook. It force an idle to kick
RunModalLoop sends this MFC-private message repeatedly when there are no messages in your dialog's queue—just the way CWinThread::Run calls OnIdle.
Look in the MSDN and you will see several samples using WM_KICKIDLE...
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|