|
You'll need a system wide hook which will reside in a dll.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
1) SetWindowsHookEx with parameters WH_KEYBOARD, WH_KEYBOARD_LL, WH_MOUSE, WH_MOUSE_LL
2) http://www.codeproject.com/shell/systemtray.asp
|
|
|
|
|
Hi
I need to serialize objects without using MFC (no CArchive).
Does naybody have any code or examples to do this?
I don't mind using iostreams but ultimately the data will be in memory as a BYTE[] not strstream, and on disk accessed using Read/WriteFileEx() and not fstream.
The functions will look something like StreamIn(const vector<BYTE>& Data) and StreamOut(vector<BYTE>& Data).
Regards
Pieter Viljoen
|
|
|
|
|
I've downloaded the latest STLPort and I'm having a hell of a time setting it up. Has anyone had any success/like to give me some pointers ? I've read the readme, I've done the nmake thing and I get it looking for a lib file which I have not built. ARGH !!!!!
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Well, man, did the same thing about a half year ago.... and nothing... Now I'm not using STL at all, except what is included in VC. I know it is out-of-date... but for me it's enough
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
I got it going, I had to uncommet a #define. However, it appears to deviate from the stanard ( size_t is unsigned int instead of int ), and declare stuff in the global namespace. I wrote functor and had to rename it because it crashed with something global introduced by STLPort.
The VC STL is quite fine, and still a bajillion times better than awful MFC containers, but we're writing a cross platofrm app, so we need a cross platform STL implimentation.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Oh, yes, you are right. I had a problem I remember with some define inside STL, that was a reserved word in VC++. Don't remember exactly what it was actually. I just didn't used it in my own code all worked fine, but we have a lot of existing code that used this reserved word, so I didn't want to go and change it in all code of my company...
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
>> ( size_t is unsigned int instead of int )
Isn't "size_t" unsigned by standard???.
>> I got it going, I had to uncommet a #define
I have neither with VS7 nor with VC6 had any problems installing STLport.
You simply should open a DOS box (with VC environment), go into the STLport 'src' directory and run "nmake vc6.mak".
>> I wrote functor and had to rename it because it crashed with something global introduced by STLPort.
What was the name which caused the conflict?
|
|
|
|
|
Alexander Berthold wrote:
Isn't "size_t" unsigned by standard???.
MAybe it's not size_t - it's the return value of *container*.size() and a friend who has X3J16 in hardcopy looked it up and said the standard says int.
Alexander Berthold wrote:
I have neither with VS7 nor with VC6 had any problems installing STLport.
You simply should open a DOS box (with VC environment), go into the STLport 'src' directory and run "nmake vc6.mak".
That is true, if you want their IOStreams. I couldn't get that to compile, so I just followed the instructions without their IOStreams, which involves uncommenting a #define.
Alexander Berthold wrote:
What was the name which caused the conflict?
I don't recall. I was hoping in posting this to find out if all of STLPort is in global space, or not. It may have been something like hide or delete, which may explain it. ( The code is at work ).
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Does anyone know if it is possible to retrieve the name of the current monitor on a system?
If you were to select Window control panel, system, device manager, monitors, the display driver name is shown. I want to get and use that name in my program, but I'm not sure how to do it.
I'd appreciate any suggestions. Thanks in advance.
- Greg
|
|
|
|
|
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
|
|
|
|