|
thank you!
Я люблю русский язикь!
|
|
|
|
|
I have been able to get most of the previously published answers to this question to work with Files and with Resources. I am not able to get the
methods working with a BitMap that has been placed in memory (buffer).
The bitmap would have been read into memory from a file, or placed in memory by a conversion routine, so only a pointer to the buffer is available.
Can anyone help?
fjayf
|
|
|
|
|
Are you refering to a BITMAP structure, in which case take a look at CBitmap::CreateBitmapIndirect(LPBITMAP lpBitmap) .
Or are you refering to a HBITMAP , in which case you can use CBitmap::FromHandle(HBITMAP hBitmap) .
Or are you refering to a BITMAPINFO structure, in which case you can use CreateDIBitmap() and CBitmap::FromHandle() .
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I installed the macro as described,after the installation,my program is not working and I am getting an error message
"The ImageGui.exe file is linked to missing export GDIPLUS.DLL:GdiplusShutdown"
After that
Couldnot execute: A device attached to the system is not functioning{Win32 error 31)
ImageGui is my program.
Will this macro helps to give intellisence to the GdiPlus object?
I checked the GdiPlus check box in the Loaded Files but I dint find the 'Bob's your uncle ' check box in the loaded files.
Hope u will help me in solving the problem.
|
|
|
|
|
|
Hello
I have a problem creating menus in a CPropertySheet (tabbed dialog session) ...
Any ways to go about doing that?????? Why doesnt the menu show up?????
Thanks!~~
*** The Power of Belief ***
|
|
|
|
|
Hello!
Is there any way to handle a right-click on a listview column?
The LVN_COLUMNCLICK message is sent when left-clicking a column, but right-click???
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
You probably need to subclass the CHeaderCtrl. Have you read this excellent article[^] ?
|
|
|
|
|
The demo of the article you mentioned also seems only to support left-clicks... Also, the article doesn't mention how to handle right-clicks...
Any more idea?
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Oh, I've found an other article (http://www.codeproject.com/listctrl/wm_rclick.asp) which describes how to handle right-clicks.
Thanks for your answer
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Wow... much easier than subclassing indeed...
|
|
|
|
|
NM_RCLICK notification from header control will do.
Note that it's beeing sent to the listview (parent of the header window), not the listview's parent
Edward
|
|
|
|
|
How is it possible to send the combination of the keys to an application?
I tried using SendMessage, but no matter what i did - it always send only F1, without the CTRL being pressed.
i also tried to send KEY_DOWN of CTRL and then KEY_DOWN for F1, but it didn't work.
Is there anywhere an example that makes it work?
Thanks.
|
|
|
|
|
Try setting the lParam arg in the WM_KEYDOWN message. That lets you specify whether any auxiliary keys like Ctrl/Shift/etc are pressed.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
As i understand from MSDN, the lparam indicates the type of key - not with which key it is being pressed.
Anyway, this is not working.
|
|
|
|
|
|
Hi
i need to create a pointer which will have to be global since it will be accessed in many places in my application.
Can somehow please help since i do not know where to place the declaration of the pointer.
Thanks
Krugger
|
|
|
|
|
krugger wrote:
i need to create a pointer which will have to be global since it will be accessed in many places in my application.
Can somehow please help since i do not know where to place the declaration of the pointer.
BAD IDEA!!!
I suggest you write a pointer manager type class and access it through there, otherwise you will have to continually check the status and validity of the pointer every time before you use it. Also, if you are accessing it via multiple threads, you will have to make sure you lock and unlock it before each access. A small manager class with a Get() and Set() fcn will take care of that for you. Then wherever you need the pointer, just #include your manager header.
Also having bald pointers floating around in "global" space is just plain immoral and causes needless coupling and makes for difficult maintenance.
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
|
OK I suspect you have read Nitron's comment which is valid.
Now if you really want to do this, you have many options
a) Put your pointer in CWinApp if you use MFC
And then everywhere you need it do somehting like this
<br />
CMyApp * pApp = (CMyApp *) AfxGetApp();<br />
void * pMyPointer = pApp->GetPointer();<br />
b) Otherways
Instanciate your pointer in only one c++ file after the #include for instance
void * gpMyPointer;
Then declare your pointer into a .h file this way:
extern void * gpMyPointer;
And include this h file wherever you need it
|
|
|
|
|
If you have a MFC application, a member variable of the application class is probably the best way. Every part of your app can access it as a member of the theApp -object.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
In one source (your main maybe)
CMyDataTypeWhatever *g_pData = (initialization stuff?);
In all other sources
extern CMyDataTypeWhatever *g_pData;
HOWEVER, I must reiterate what others have said. Even though unmanaged global variables can be perfectly safe, if you don't know how to even declare a global variable, I doubt you have an understanding of the pitfalls.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thank you guys. It really helps!!
Krugger
|
|
|
|
|
The safe solution is use a global handle allocated with GlobalAlloc when the app starts. When you need to read or write to the global, lock it with GlobalLock and GlobalUnlock . It prevents you from simultaneous writing, which is the main pitfall of globals in multithreaded apps.
Robert-Antonio
"CRAY is the only computer, which runs an endless loop in just 4 hours"
|
|
|
|
|
When I delete a pointer, p , should I do:
A:
p = NULL;
delete p;
or
B:
delete p;
p = NULL;
~Nitron.
ññòòïðïðB A start
|
|
|
|