|
it's amazing how well that function is hidden... right in plain site. i swear, it took me over a year to find it.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
it took me over a year to find it.
So did it take to me! In fact, before knowing about this command, when I wanted to insert a 16x16 only icon, I resorted to such an icon of my own and imported it into Visual Studio (then I'd change it inside VS). That little icon I took great pains to obtain in the first place, and was one of my little treasures --stupid as it may seem now
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
No kidding.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Oh,thanks Joaquin,I never knew there is something like that.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
an icon resource contains both 32x32 and 16x16. There's a little drop down box in the icon editor to select between them.
bitmaps are more suited to imagelists.
jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Is it possible to get the HWND of the Window which has focus (not only a window of my app but any opened window) ?
Thanks !
|
|
|
|
|
This is taken straight from MSDN:
"
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
HWND GetForegroundWindow(VOID);
Parameters
This function has no parameters.
Return Values
The return value is a handle to the foreground window. The foreground window can be NULL in certain circumstances, such as when a window is losing activation.
"
Hope this helps.
Roger
|
|
|
|
|
|
Today I was trying to fool around with ATL. I found something quite puzzling. Even though I was on Win2K I was not getting Unicode. I mean when I used an API call -GetPrivateProfileString, GetPrivateProfileStringA was getting called instead of GetPrivateProfileStringW. Finally I got fed up and manually used GetPrivateProfileStringW. I thought GetPrivateProfileString would automatically get converted to GetPrivateProfileStringW on Win2K.
One other very annoying factor was having to prefix L for Unicode strings. Is there some setting by which I can get everything enclosed between "s to be treated as Unicode strings?
Regards and Thanks
Nish [ATL Ultra Newbie]
My most recent CP article :-
A newbie's elementary guide to spawning processes
www.busterboy.org
|
|
|
|
|
If you add UNICODE and _UNICODE in your preprocessor settings you should get Unicode-ness automatically.
As for the prefixing L I'm afraid there's no simpler solution. By the way, if you want to write code working both for Unicode and ANSI settings, you might want to have a look at a macro called TEXT , along with its merry friends TCHAR , LPTSTR , etc.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Nish, just one more thing to add , instead of TEXT macro , use _T macro instead, it's same thing, but is shorter , I known i'm lazy
Use something like this , xpto is a TCHAR* allocated with some space:
the _tcscpy expands either to strcpy or wstrcpy.
_tcscpy(xpto,_T("sample"));
Cheers,
Joao Vaz
|
|
|
|
|
|
Nish [BusterBoy] wrote:
I thought GetPrivateProfileString would automatically get converted to GetPrivateProfileStringW on Win2K.
No, using the Unicode APIs is a compile-time decision. If you used the ATL AppWizard, change the active config to one of the Unicode versions to link to the Unicode APIs.
As for the string literals, enclose them in the _T() macro. Using L"" means the code will only work in Unicode builds, whereas using _T() makes it work for ANSI as well.
--Mike--
Fetchez la vache!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Michael Dunn wrote:
No, using the Unicode APIs is a compile-time decision
Thanks. I thought it was kinda OS dependent.
Michael Dunn wrote:
As for the string literals, enclose them in the _T() macro. Using L"" means the code will only work in Unicode builds, whereas using _T() makes it work for ANSI as well.
I wish there was a compiler switch to automatically prefix _T to all string literals.
Nish
My most recent CP article :-
A newbie's elementary guide to spawning processes
www.busterboy.org
|
|
|
|
|
And when you start to use _T() and TCHAR for all text, you should use the _tcs* functions, they work both with and without UNICODE and _UNICODE defined.
When not unicode the preprocessor converts _tcscpy() to strcpy(), and with unicode defined it converted to wcscpy().
And remenber, if you malloc a TCHAR do it like this:
TCHAR *s = (TCHAR*)malloc(wantedsize * sizeof(TCHAR));
Then it works both with and without unicode defined
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
I need to remotely debug an ISAPI filter. I have proven that I can remotely debug an EXE (between the two machines in question). I can also attach to a local process using Visual Studio and debug my local ISAPI filter. However, I can't seem to get Studio set up properly to attach to the inetinfo.exe on the remote machine.
Any thoughts?
Thanks in advance.
--G
|
|
|
|
|
Never mind. According to Microsoft, this can't be done.
|
|
|
|
|
Hi !
My App has an Explorer-like interface, with a leftview and a rightview. The leftview is a Tree control and the right view is a List control. I would like to enable the drag'n drop, to allow the user to drag items from the list (right view) and drop them into the tree (left view).
What I cannot figure out is how the tree (left view) will be notified of an item dropped on a tree-item ? I implemented the 'BeginDrag' in the right view, with the WM_MOUSEMOVE, and WM_LBUTTONUP, but when I drop an item on the left view, no messages is sent to the left view. I tried to use SetCapture() with my MainFrame window, but it's not working !
Any help of hint will be greatly appreciated !
Thanks !
Jerome
|
|
|
|
|
It has been a while since I have had to implement drag and drop for a control, but I believe that you need to register your tree control that will accept the dragged object as a drop target. This will let OLE know that it will look at the data a possibly accept it.
Then you will handle the function calls in the interface IDropTarget, there are functions like DragEnter, DragLeave and Drop.
|
|
|
|
|
When using MFC, you can create a member variable of type COleDropTarget and call Register() passing in your CWnd*. Then the virtual methods OnDragEnter() , OnDrop() , etc. will be called (if they are implemented).
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
You have to send the message yourself, from the right view.
When you call setcapture from the right view, it's that view that get the drop message, then you can send a message to the windows undr the mouse, that you are dropping things in it...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi, I'd like to ask if anyone knows any good method to access a view's member functions or methods, from an outside class, in MFC Doc/View architecture, without using friend operators or methods, or with the scope resolution operator because that things does not work well on my project... (I'm trying to access from a TreeCtrl or TreeView potected code, some public functions and members from an other view and i got a compiler message "illegal call of non-static member functions").
What i ask is if there is a general way to override such member function calls or sth else to make this work. (The project i'm developing is an Image Viewer app which i will post in future, like ACD See or PolyView).
Sorry if these may sound funny for some experts, but although i program c/c++ 4 years i tried MFC the last months...Thanks.
|
|
|
|
|
"illegal call of non-static member functions"
The message seems to imply that the problem has not to do with public /private access, but rather with calling a non static member function as if it were static. Does this ring a bell for you, or am I totally off track?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|