|
I banged them into a paint program, made them greyscale, then turned the contrast down and messed with the curves.
--
Andrew.
|
|
|
|
|
Use Hot and Cold bitmaps
See sample here
http://www.codeproject.com/docking/toolbar_hotbuttons.asp
|
|
|
|
|
Hi all (again), I`m stuck (again). I just can`t figure out how to copy a HBITMAP to a completely new HBITMAP (i.e. I don`t want them handling the same image, rather I want a new image which contains the same colours). Anyone know? I`ve tried copying the handle but that doesn`t do what I want it to do (rather obviously) since when I try modifying the new image the old one gets modified too, this is what i *don't* want. I have heard something about memcopy, but haven`t got a clue how I`d use it in conjunction with the HBITMAP and "the bits" of the DIBSection. Any help, or links or ideas or anything = very many thanks.
Cheers guys (and gals)
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
You need to create the second HBITMAP to be the same size, copy them both into DC's and then do a BitBlt between them. If they are both DIBSections, I'd presume you can create the second one the same size as the first and memcpy the bits from one to the other.
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
|
|
|
|
|
Thanks for the response Christian, I would love to be able to memcpy the bits from the one HBITMAP to the other (they will both be DIBSections and they will both be the same size). But how does it work, do I have to create a new HBITMAP first using CreateDIBSection and then use memcpy? If this is correct, how do I use memcpy in that situation, without creating a memory leak from losing the pointers to the original "bits". I would very much like it if you could elaborate a little bit on this direction of solution,
Many thanks, again
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
memcpy copies the contents of the memory, so what happens is this:
1/ You create a new DIBSECTION the same size and bit depth as the first.
2/ You now have two DIBSECTIONs and two pointers to byte arrays, which are the same size. You use memcpy, which copies the contents of one byte array into the other. You're not allocating memory, you're copying the values of the pixels into the location that already holds the values of the bitmap as it was created, making them identical to the first.
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
|
|
|
|
|
Many thanks Christian, I`m off to implement your suggestion, I`ll get back to you and amend this message with the results.
Thanking you lots,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
No worries - glad to help.
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
|
|
|
|
|
I'm trying to figure out how to receive/send data of different types (including standard types AND my own objects) not using MFC CSocket-CSocketFile-CArchive trio. I've got the socket part already, now I want to use << >>
to actually start transferring data. I'm new to STL but have a feeling
that's the way to go. Right? How? Or no?
|
|
|
|
|
I don't quite catch your point, but if what you're looking for is iostream-like classes for data communication thru sockets, then please note that the C++ standard does not cover this issue. Nevertheless, iostream was designed with such kind of extensions in mind, and there are a number of libraries out there to do socket communications à la iostream. To name a few:
- Socket++ is probably the most popular library in this area. Originally written by Gnanasekaran Swaminathan for UNIX environments, it's been later ported to Win32 by Greg Lavender.
- Maciej Sobczak releases an iostream-compatible socket wrapper along with his article on the current (December 2001) C/C++ Users Journal issue, which in addition features other articles about C++ and sockets you might find interesting to look at.
- socketstream library, written by a Korean guy whose name I haven't been able to decipher Haven't tested myself, nor do I have any reference about it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi, everybody
I'm using CArchive constructed on CSocketFile and i'm
trying to serialize CMsg objects like this :
(note : ar is my archive and msg my message to serialize)
ar.WriteClass(msg.GetRuntimeClass()); //it works fine
ar.WriteObject(&msg); //works fine
and at the other side of the network i have :
CRuntimeClass * pClass = ar.ReadClass(); //this throw me an error CArchiveExceptionError::badIndex
Any ideas about this ?
|
|
|
|
|
hai all,
i am a new person who is working in vc++ fro 2 month
i am facing some problem in starting the dialog box in windows machine. whila compilng it's giving this messages is any thing missing.
Loaded 'D:\etnnew\ethnew\Release\ethnew.exe', no matching symbolic information found.
Loaded 'C:\WINNT\System32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\MtoMLAN.dll', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\KERNEL32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\USER32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\GDI32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\ADVAPI32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\RPCRT4.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\WINSPOOL.DRV', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\COMCTL32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\WSOCK32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\WS2_32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\WS2HELP.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\mfc42.dll', no matching symbolic information found.
LDR: Automatic DLL Relocation in ethnew.exe
LDR: Dll qaphooks.dll base 10000000 relocated due to collision with C:\WINNT\System32\MTOMLAN.dll
Loaded 'C:\WINNT\SYSTEM32\qaphooks.dll', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\RNR20.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\RPCLTC1.DLL', no matching symbolic information found.
First-chance exception in ethnew.exe (NTDLL.DLL): 0xC0000005: Access Violation.
Loaded 'C:\MOUSE\SYSTEM\ccmsghk.dll', no matching symbolic information found.
Loaded 'C:\WINNT\SYSTEM32\msidle.dll', no matching symbolic information found.
The thread 0x201 has exited with code 120 (0x78).
The program 'D:\etnnew\ethnew\Release\ethnew.exe' has exited with code 120 (0x78).
Suleman
|
|
|
|
|
Are you sure it is compiling. It looks more like it is debugging and can't find debug info.
-Matt Newman
-Matt Newman
|
|
|
|
|
How do you mean W95 only ? The system dll's being loaded are under c:\WinNT, and 'no mayching symbolic information found' is not unusual or broken.
You need to post some code. What are the details of your project ? How was it created ?
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
|
|
|
|
|
I have a class that implements the thread operation(not
inherited from MFC)-"MyCDialogThread" - that open a CDialog on it's run method with either DoModal or create.
I create that threat from another thread and i need to kill
my "MyCDialogThread". How can that be done?
|
|
|
|
|
Can you send a WM_CLOSE message to that CDialog ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
No. in my case - i open the dialog with DoModal and that thread donot response to any sendmessage.
The other thread that should send the SendMessage to my thread could not be proccessed until my thread(that own the CDialog)could execute, but it couldn't because my thread is blocked until it will be finished.
I read about it in Josheph M.Newcomer article "Using Worker Threads" here in the Code Project.
|
|
|
|
|
Try with TerminateThread
best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Can you use a UI thread instead of a worker thread for the owner of the CDialog (and proceed then with sending WM_CLOSE )?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, All!
=======
What is IDISPATCH ?
What should I do with it?
How to use it?
10x
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
IDispatch is a way for pointer-challanged programming languages to call COM components. It simply gives an extra layer of abstraction to the calling procedure.
Assuming you know what interface your IDispatch you could use it in two steps:
1) Get DISPID:s for the functions you want to call with GetIDsOfNames
2) Set parameters and call Invoke with the chosen DISPID.
Example: Calling a function showWindow(BOOL show) in IDispatch idispatch
DISPID dispid;
OLECHAR* name = L"showWindow";
idispatch->GetIDsOfNames(IID_NULL, &name, 1, GetUserDefaultLCID(), &dispid);
VARIANT arg;
arg.vt = VT_BOOL;
arg.boolVal = VARIANT_TRUE;
DISPPARAMS param = {&arg, NULL, 1, 0};
idispatch->Invoke(dispid, IID_NULL, GetUserDefaultLCID(), DISPATCH_METHOD, ¶m, NULL, NULL, NULL);
Or you could just QueryInterface for the interface you want..
/moliate
|
|
|
|
|
Got a complex class which depends on data files opened in the constructor. Does anyone have any neat ideas about how to handle error conditions? If the files don't exist I don't want the object to be created but I can't see how to do it.
TIA
Dave Cross
|
|
|
|
|
I don't have any neat ideas, I just want to point out that the constructor is not the best place for doing a large amount of work that might fail.
Michael
|
|
|
|
|
Exceptions. Just throw an exception when your constructor fails and catch it in the code contructing the object. I think that is actually the *only* right way to do it.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Doing a lot of work in the constructor is generally considered bad OOP, but if you must do it than exception handling is the best technique to deal with errors, at least if this is going to be a widely distributed class.
"But, daddy, that was back in the hippie ages..." My twelve year old son - winning the argument.
"Stan, you are an intelligent guy who responds in meaningful ways" Paul Watson 16/10/01
|
|
|
|