|
If I already have a bitmap, how can I add that bitmap to the toolbar, right now, I can copy and paste it into the toolbar, but it comes out in different colors. I do not want to redraw it, what am I missing?
Thanks
|
|
|
|
|
You could try to do it by MS Paint
and then save it as 24-bit bitmap...
|
|
|
|
|
where to use critical section and where to use mutex ..
wat is best pratices ..to use this syncronisation elements .
|
|
|
|
|
I think you read this section to know which to use at what time[^] Величие не Бога может быть недооценена.
|
|
|
|
|
For thread synchronization between threads in the same process you should use critical sections as they are faster since they don't have a kernel object associated with them.
For synchronization between processes, e.g. when accessing system resources, you have to use mutexes.
Mutexes will work in either case.
You will find some interesting reading here[^] and here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
critical section can be used to provide synchronization in single process only, so they are faster. Mutex can be used to provide synchronization among different processes..
|
|
|
|
|
Hi all,
i want to replace a exe default icon with any other icon. i have written this code to do this
HANDLE hFile;
DWORD dwFileSize, dwBytesRead;
LPBYTE lpBuffer;
HANDLE hResource;
HRSRC hRes;
HANDLE hUpdateRes;
char *lpResLock;
HRSRC hResLoad;
BOOL result;
HMODULE hSrcExe,hDestExe;
int iLoop;
hFile = CreateFile("E:\\icon.ico",
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (INVALID_HANDLE_VALUE != hFile)
{
dwFileSize = GetFileSize(hFile, NULL);
lpBuffer = new BYTE[dwFileSize];
int aa = ReadFile(hFile, lpBuffer, dwFileSize, &dwBytesRead, NULL);
hResource = BeginUpdateResource("E:\\xyz.exe", FALSE);
if (NULL != hResource)
{
if (UpdateResource(hResource,
RT_ICON,
MAKEINTRESOURCE(1),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPVOID) lpBuffer,
dwFileSize) != FALSE)
{
EndUpdateResource(hResource, FALSE);
}
}
}
but its not updating the icon...
I am not getting where is the problem. Can anybody help me in this...
Thanks in advance
|
|
|
|
|
You do not check the return status from your commands, apart from not executing the UpdateResource()<code> or EndUpdateResource() functions if an error occurs. You should run your code through the debugger to see if everything gets executed correctly, and if not, check any error codes by using GetLastError() .txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
i have seen that everthing is executing fine, then also icon is not getting replaced.
|
|
|
|
|
learningvisualc wrote: i have seen that everthing is executing fine, then also icon is not getting replaced.
Sorry, but I cannot think of anything else to suggest, other than to check that you are using the correct resource id in the destination executable. If each function returns success status then it should work.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Try looking up the WM_SETICON message on the MSDN site,
"An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption."
|
|
|
|
|
Hai,
I am having two applications that run simultaneously. One program writes data to a file and the other program reads data from that file itself and performs some operations based on the value of that file.The problem is that since both are using same file there will be a chance to request to read the file while the file is writing.Is there any method 2 use a single file for two programs.
|
|
|
|
|
Use CreateFile to open the file and specify the dwShareMode parameter as FILE_SHARE_READ|FILE_SHARE_WRITE .
|
|
|
|
|
|
|
hi!
i will the remote sensing row image generate whit c or c++ or delphi . row image formate is bsq.
please help me for this project!!!
Thanks.
|
|
|
|
|
What is meant by remote sensing an image?
|
|
|
|
|
Hi all,
please help me to tell about the the String value of Ctrl+Z.
please tell me what string i use in place of Ctrl+Z.
thanks in advance.
|
|
|
|
|
What is meant by string value of Ctrl+Z?
|
|
|
|
|
i want to use it over serial port so i need this.
i mean How to write ctrl-z to a serial port?
|
|
|
|
|
The value for CTRL-Z (^Z) is 26 (decimal). It is often used as an end-of-file marker (DOS).
You might also find useful to know that CTRL-A (^A) is 1 and that all the others, i.e. CTRL-B through CTRL-Y characters fall in between (CTRL-B is 2, CTRL-C is 3, and so on).
char c[2]; c[0] = (char)26; c[1] = 0;
CString cstring;
cstring = CString( c);SkyWalker
|
|
|
|
|
|
Try this -
CString cs;
cs.Format(_T("%c"), 26);
|
|
|
|
|
Thanks for all ur support its done now.
its real value for serail port is "\x1A\r\n"
|
|
|
|
|
Yes 0xA1 is 26 in decimal.
|
|
|
|