|
Has anyone successfully used ICM? I’m trying to write some color correction software using ICM and am running into what appear to be major bugs. I have the same software running on the Macintosh with ColorSync (the Macintosh equivalent of ICM) very well. If anyone does know ICM I’d really like to hear what you think of the following problems:
Originally, my calls to TranslateColors would often crash. I was passing arrays of the ICM COLOR structure along with pixel counts. After hours of pouring through all code and documentation, I debugged into ICM's 80x86 assembly code and found that it
expects 16 bytes per pixel. The COLOR structures are only 8 bytes per pixel so this doesn't make any sense. I can work around this immediate problem by allocating twice as much space for my buffers as necessary but this is a strong warning sign that either I’m doing something seriously wrong or that the current release of ICM isn’t usable.
My image comes through roughly correctly which indicates that I’m formatting my pixel data as ICM is expecting it. However I often get strong bizarre casts in the images I get back from TranslateColors. Especially when going from CMYK to RGB, the images look terrible.
Is anyone aware of sample code that uses TranslateColors?
Is anyone aware of free software that will use ICM (preferably through TranslateColors) on an image?
Are there any other Internet resources for ICM development?
Thanks,
Kurt
|
|
|
|
|
Hi!
I wonder how to get the parent process of a child process.
My problem is that when the father accidently dies - the son should too.
thanks, peters
|
|
|
|
|
http://www.codeproject.com/threads/interprocesssync.asp
|
|
|
|
|
hi , i am very new to programming hook function and creating dll . I need to know how to use this sysmsgfilter hook function to detect wm_paint message for all active application so that i can detect when an active application refreshes its screen. I know i need to write this into a dll but dont how to do it.
|
|
|
|
|
Hi,
You need to write this into a dll. Here is an example that implements keyboard hooks. Yours is similar. You can modify this:
<br />
<br />
#include "stdafx.h"<br />
#include "SystemHook.h"<br />
#include <stdlib.h><br />
<br />
#define ID_CMD_KEYPRESSED WM_USER+200<br />
<br />
HWND ghWndMain;
static HHOOK hHook;
static BOOL bHookInstalled;
<br />
HINSTANCE ghDLLInst;
<br />
<br />
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved)<br />
{<br />
switch (ul_reason_for_call)<br />
{<br />
case DLL_PROCESS_ATTACH:<br />
case DLL_THREAD_ATTACH:<br />
case DLL_THREAD_DETACH:<br />
case DLL_PROCESS_DETACH:<br />
break;<br />
}<br />
ghDLLInst=(HINSTANCE)hModule;<br />
return TRUE;<br />
}<br />
<br />
<br />
SYSTEMHOOK_API int nSystemHook=0;<br />
<br />
SYSTEMHOOK_API int fnSystemHook(void)<br />
{<br />
return 42;<br />
}<br />
<br />
CSystemHook::CSystemHook()<br />
{ <br />
return; <br />
}<br />
<br />
SYSTEMHOOK_API LRESULT CALLBACK KeyboardProc(<br />
int code,
WPARAM wParam,
LPARAM lParam)
{<br />
if (code>=0) <br />
{<br />
if(HIWORD(lParam) & 0x8000) <br />
{<br />
if(!GetKeyState(VK_RMENU))<br />
{<br />
HWND h=::FindWindow(NULL,"WinScheduler");<br />
PostMessage(h, ID_CMD_KEYPRESSED , wParam, lParam);<br />
}<br />
else<br />
{<br />
}<br />
}<br />
}<br />
return (int)CallNextHookEx(hHook, code, wParam, lParam); <br />
}<br />
<br />
SYSTEMHOOK_API int WINAPI InstallHook (HWND hWnd, BOOL bCode )<br />
{<br />
int nReturn = 1;<br />
ghWndMain = hWnd;
<br />
if (bCode == bHookInstalled) <br />
return 0; <br />
<br />
if (bCode) <br />
{ <br />
hHook=(HHOOK)SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc,ghDLLInst,0); <br />
if (!hHook) <br />
return 0; <br />
bHookInstalled = TRUE; <br />
} <br />
else <br />
{ <br />
nReturn = UnhookWindowsHookEx(hHook); <br />
bHookInstalled = FALSE; <br />
} <br />
return nReturn; <br />
}<br />
<br />
#ifdef SYSTEMHOOK_EXPORTS<br />
#define SYSTEMHOOK_API __declspec(dllexport)<br />
#else<br />
#define SYSTEMHOOK_API __declspec(dllimport)<br />
#endif<br />
<br />
class SYSTEMHOOK_API CSystemHook {<br />
public:<br />
CSystemHook(void);<br />
};<br />
<br />
extern SYSTEMHOOK_API int nSystemHook;<br />
<br />
SYSTEMHOOK_API int fnSystemHook(void);<br />
<br />
SYSTEMHOOK_API LRESULT CALLBACK KeyboardProc(int code,WPARAM wParam,LPARAM lParam);<br />
SYSTEMHOOK_API int WINAPI InstallHook (HWND hWnd, BOOL bCode );<br />
Mustafa Demirhan
|
|
|
|
|
Does anyone know how to catch the 'Stop Build' event? I need this feature in an add-in. It's the intention to detect when the user has pressed this button while a make is running. So far, I couldn't find anything on the net about this subject.
The add-in framework is made with the Mfc AppWizard (Dll).
Thanks in advance for any help.
Geert Vancompernolle
Belgium
|
|
|
|
|
Hi,
I really have a big problem about sending keystrokes to other applications. i am able to send many of the keys by using keyb_event() . However, i am not able to send keys like .,!'^+%&/()= since these keys do not have any virtual key codes. I am able to send these keys by sending shift or 'alt gr' with some other keys. However, this is not a good solution since it depends on the type of the keyboard.
Thank you for any helps in advance.
Mustafa Demirhan
|
|
|
|
|
Why is it that is some projects I can right click on a class and add a Windows Message Handler (from the menu)and If I go open another project (the one I want to manually add the message handler to) I dont have the option in the right click pull down menu. Also the .clw file is messed up and I dont want to restart the project. So how can I add a message handler without the class wizard method.
HELP
thanks
|
|
|
|
|
See: http://codeguru.earthweb.com/bbs/wt/showpost.pl?Board=vc&Number=164155
Does that help?
|
|
|
|
|
How do I manually add a class to a project without using the class wizard in Visual 6?
I added the name.cpp file to the FileView area under the Source files and put #include name.h" in the appropiate file. But I keep getting an error that says "error C2509: 'ONSIZE' :memember function undeclared" and it is declared in name.cpp. Is there something I'm missing? I'm new to MFC and appreciate you help.
thanks
|
|
|
|
|
You will need to add both the CPP and H files into the project. Right click on the project in the Workspace view and select add files to project. You can then add the cpp and h files. The IDE should automagically put the cpp in the source files section and the h file in the header files section.
If you want to have Classview support for those new classes...And, there may be an easier way to do this but this is how I do it.
Delete the *.clw file from the project folder. After you delete the file, bring up the classwizard. It will then prompt you to create a new file based upon the project files. When its done, your new classes will be included in the list.
Good luck,
Frank
|
|
|
|
|
|
I have been trying to place a background image on a CListCtrl using the SetBkImage(..) function, but have run into a problem. If I use a URL for the image on my local hard drive, then I am able to display the image with no problem, however, If I try to use a bitmap loaded from a resource ( via the CBitmap HBITMAP operator) then I am unable to get the CListCtrl to display the image. For example, the following code works fine:
m_ctrlList.SetBkImage(TEXT("file://c:\\temp\\image.bmp"));
But code such as :
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
m_ctrlList.SetBkImage((HBITMAP)bitmap);
Will not work at all. Am I simply missing something here, or has anyone else experienced this problem as well. Any information is greatly appreciated!!
|
|
|
|
|
Look at the docs for the LVBKIMAGE struct and you'll see that the hbm member is "Not currently used" which I infer to mean that supplying an HBITMAP for the background isn't supported yet.
|
|
|
|
|
The includes should read
#include <stdio.h>
#include <vector>
sorry about that
|
|
|
|
|
How on earth does one get stuff to compile with VC++ with the language extensions turned off ( compiler switch /Za)?
The following simple program won't compile and generates 102 error - almost all relating to the utility and xstring headers
#include <stdio.h>
#include <vector>
int main(int argc, char* argv[])
{
std::vector<int> m;
printf("Hello World!\n");
return 0;
}
I am running Win2000 pro, VC++ 6.0 (no VC service packs)
Any help will be greatly appreciated !!
|
|
|
|
|
You don't. It cannot be done.
|
|
|
|
|
I'm using GetCapture() to notice when the mouse leaves a CWnd-area. The problem is that this approach seems to block the F-Key events: While the mouse is over such a window, no F-Key events are not delievered. It's MFC...
|
|
|
|
|
There is a library to read ICQ 99a/99b/2000a/2000b database in www.icqroaming.com.
It is very interesting and useful.
|
|
|
|
|
|
It is an ATL component that fire events. I have asked their vb and vc++ examples on how to use the component.
|
|
|
|
|
Hi,
I am working on a MFC app that basically draws its own controls etc on a view that is maximized.
I am having quite some trouble, it seems, with device contexts. I have drawing code in lots of functions all over the place, e.g. when a mouse click comes in, the OnLButtonUp calls a function in my code that does drawing, and sometimes things do not appear on the screen or appear delayed, weird effect.
I am sure I am making a big mistake drawing things directly in reaction to OnLButtonUp() but I have no clue how to do it better.
If someone could give me a set of just the basic pointers how to organize a program like that, I'd be very grateful. The main problem I am having is drawing my GUI elements (Text, Lines, Rectangles).
TIA
Lutz
|
|
|
|
|
Would you be able to use one of the flicker-free drawing classes (here at CP) instead? That will significantly speed up screen updates, since the screen DC only gets written to once; everything else happens in memory.
|
|
|
|
|
You are right, you shouldn't be drawing in response to any event other than a WM_PAINT message.
Generally speaking, you should draw only in the OnDraw() or OnPaint() methods. If it's a view, the OnDraw() method is provided for you. If it's a dialog, then you need to add a WM_PAINT handler and then draw in the OnPaint() method provided by the handler (and the DC that it provides).
Generally speaking, when you click something and want to update, then you invalidate your window (if possible, only the portions of the window you need to update).
The Scribble tutorial that comes with VC++ should be enough to illustrate this for you. Use the Totorials Luke!
|
|
|
|
|
I recvently split my program into two modules (to save computer memory for unneeded components), but this the code in this dll file for some reason can't load Bitmap resource, the command simply doesn't work.
HELP
Joel
|
|
|
|