|
toxcct wrote: so, you voted every answer you got as Bad...
Are you sure it was the OP?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
not that much, but at least, he could defend himself ?! lol
|
|
|
|
|
Stopped voting ! I missed a 5
just kidding.
|
|
|
|
|
Hai!
I am developing a dialog based application for a WINCE device in eVC++.
I cannot use GDI, ImagingFactory, IPicture API's
I need solution/suggestion to any of the following:
1. I have .jp2 image, how can i convert and save it as .jpg file.
or
2. I have the byte array of .jp2 image, how can i convert to .jpg byte array
or
3. How can i get the HBITMAP handle from .jp2 image's byte array.
I am having one more doubt:
Using picture Control i am not able to display a bitmap image
mcsMyImage - is the control variable of the Picture control of my dialog,
MyImage.bmp - is the bitmap file
now i do the following:
CString strError;
DWORD dwError;
HBITMAP hBitmap = (HBITMAP) LoadImageBitmap (NULL, _T("MyImage.bmp"), IMAGE_BITMAP, 0, 0, 0);
// Tring to get last occured error
dwError = GetLastError ();
strError.Format (_T("%x"), dwError);
AfxMessageBox (strError);
// Set the bitmap on the dialog
mcsMyImage.SetBitmap (hBitmap);
Bitmap doesnot get loaded, i get 0x6 as the last error, which says "Invalid handle" How to solve this?
Thanks!
modified on Thursday, May 14, 2009 5:25 AM
|
|
|
|
|
Hi, you may be able to find an implementation of jp2 in the source code for celestia.
Haven't seen the LoadImageBitmap function before. I wonder if it works like LoadImage, if so, you'll need to throw it a copy of the hInstance, you'll also need to throw it the LR_LOADFROMFILE for the load flags.
i.e - using plain GDI:
HBITMAP hBitmap = (HBITMAP) LoadImage(
GetModuleHandle(0),
"MyImage.bmp",
IMAGE_BITMAP,
0,0,
LR_LOADFROMFILE
);
I apologise in advance if my ignorance about mfc has made this a wasted post.
|
|
|
|
|
Sorry i have wrongly typed it,
it's LoadImage () only, when i am using LR_LOADFROMFILE, it gives an error error C2065: 'LR_LOADFROMFILE' : undeclared identifier
Thanks!
|
|
|
|
|
Uh-huh. Okay, have you included "winuser.h" - it defines LR_LOADFROMFILE (as 0x10)
I don't need to include it explicitly using gcc 3.4.??
Taken from winuser.h
#define LR_DEFAULTCOLOR 0
#define LR_MONOCHROME 1
#define LR_COLOR 2
#define LR_COPYRETURNORG 4
#define LR_COPYDELETEORG 8
#define LR_LOADFROMFILE 16
#define LR_LOADTRANSPARENT 32
#define LR_LOADREALSIZE 128
#define LR_DEFAULTSIZE 0x0040
#define LR_VGACOLOR 0x0080
#define LR_LOADMAP3DCOLORS 4096
#define LR_CREATEDIBSECTION 8192
#define LR_COPYFROMRESOURCE 0x4000
#define LR_SHARED 32768
Remember, the first param of LoadImage can be NULL only when loading a bitmap from a resource within the module. If loading from a file, you must (a) pass the hInstance, (b) give a valid filename (c) pass the LR_LOADFROMFILE loading flag.
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">kapardhi wrote:</div>
1. I have .jp2 image, how can i convert and save it as .jpg file.</blockquote>
JasPer
|
|
|
|
|
kapardhi wrote: I am developing a dialog based application for a WINCE device in eVC++.
Chris Losinger wrote: JasPer
Unfortunately Jasper should first be ported to WinCE
Seriously, if you want to get a result in reasonable time, convert your jp2 file to a Imaging supported format(as jpg or png) on a server and use the Imaging API [^]on your device.
cheers,
AR
|
|
|
|
|
How can i detect that ThreadCreation() function has created a thread for a process on windows xp operating system?
And is there any way to read Process Control Block of the kernel?
Thanks
|
|
|
|
|
Your question is a bit unclear. I'm assuming you're asking how to detect thread creation from within the process that creates it. If this is the case one way is to load a DLL into the process and handle the DLL_THREAD_ATTACH notification in its DllMain[^] function.
Steve
|
|
|
|
|
sorry for not mentioning it earlier, it is from outside the software.
Actually, i want to detect the thread creation for a software (black box)running on windows xp. I want to write a software that could give me the following information for each thread in a process running on windows xp:
1. time of its creation
2. associated function (that was given in the lpStartAddress attribute of CreateThread function)
Thanks
islamians the best
|
|
|
|
|
Could you use the Thread32First() /Thread32Next() pair to get a list of threads, and then GetThreadTimes() to get time-related info?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
One way is to create the process to be monitored using the CreateProcess[^] function and passing the DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS flag (and I'd also add the CREATE_DEFAULT_ERROR_MODE flag) in the dwCreationFlags parameter. Alternatively you could use the DebugActiveProcess[^] function to attach to an active process. To find out how to proceed after this start at the WaitForDebugEvent[^] function.
Steve
|
|
|
|
|
naeemmuhammad wrote: i detect that ThreadCreation() function has created a thread for a process
What about API hooking[^] ?
|
|
|
|
|
thanks!
apparently this is what i was looking for
islamians the best
|
|
|
|
|
Hi,
I am new to database but not MFC..Please tell me what are the various way to use database (say ms-access) and some sample example?
|
|
|
|
|
Good articles on database programming - Data Access Programming[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
In my system I have installed windows Vista os. When I entered into Vista, In the Login dialog, User Name and Password textboxes are there. When the Password text box is empty, it is showing "Password" text image. When we entered some character, that Password image had gone and the text which entered is dispalying as *. Here my question is when the Password fields is empty it showing the "Password" text image, whethere it is image or text, how do i get this feature in VC++ 6.0. Awaiting for your reply.
|
|
|
|
|
CEdit::<a href="http://msdn.microsoft.com/en-us/library/kb01s86y(vs.80).aspx">SetCueBanner</a>[<a href="http://msdn.microsoft.com/en-us/library/kb01s86y(vs.80).aspx" target="_blank" title="New Window">^</a>]
Sets the text that is displayed as the text cue, or tip, in an edit control when the control is empty and does not have focus.
|
|
|
|
|
|
gopalraja wrote: how do i get this feature in VC++ 6.0
Madhu's answer is correct for VC2003 and on. For VC6, you need to do the following:
- Download and install a version of the Windows SDK that is compatible with VC6 AND has WIndows XP features[^]
- Use the
Edit_SetCueBannerText [^] macro (which you'll get by #including commctrl.h) to set the prompt text in the edit box. Note that the text you pass as the macro's second argument is a wide-string, something like L"Password"
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi !
I'm desperately seeking, not Susan, but a way to spawn a process on my computer which will not be killed when I logoff. Some sort of a background process ...
My customers are using our software and have the ability to launch a very long process (to compute something). I would like to give them the possibility of logging out (e.g. for the week-end).
Any ideas out there will be highly appreciated.
Thanks.
|
|
|
|
|
andypandy2 wrote: to spawn a process on my computer which will not be killed when I logoff. Some sort of a background process ...
Try windows services; You can find the sample at Creating a Simple Win32 Service in C++[^]
|
|
|
|
|
Thanks, that should do the job !
|
|
|
|