|
Hi all...
i have one file *.pck file....as what i know this is the compression image file...how i want to uncompress this file to the valid omage file such as *.jpeg or *.bmp file....
Rgds
;);P ((
:_Rocket_:
|
|
|
|
|
I don't know but the smileys are obviously working just fine.
Or are you somewhat emotionally unbalanced today?
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
PCK, are you sure? if it is PCT or PCX try the excellent freeware conversion prog from:-
http://www.xnview.com or http://perso.wanadoo.fr/pierre.g
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
What I want
(1)I create a modeless dialog like the following code. See, MainWndProc triggers a modeless dialog "Data", and "Data" triggers another and destroy itself...
Main->Data->Intro->Exper
(2)I want response to key 'A' always to be processed in the dialog function "Parameter_Window_Exper".
What it does now
(1). "Intro" can't be displayed. Why?
(2). 'A' is taken care by MainWndProc still when "Data" has been triggered.
LRESULT CALLBACK MainWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
hwnddlg = CreateDialog(app_instance, "PARAMETER_WINDOW_DATA", hwnd, (DLGPROC) Parameter_Window_Data);
break;
case WM_CHAR:
switch(wParam) {
case 'A':
MessageBox(hwnd, "top box","response A", MB_OK);//for temporary test
break;
...
}
BOOL CALLBACK Parameter_Window_Data(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
case IDC_OK:
hwnddlg = CreateDialog(app_instance, EXPER_INTRO_DIALOG, hWnd, (DLGPROC) Parameter_Window_Intro_Func);
DestroyWindow(hWnd);
....
}
BOOL Parameter_Window_Intro(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
case IDC_TRAIN_DONE:
DestroyWindow(hWnd);
hwnddlg = CreateDialog(app_instance, "EURO_PAIR", hWnd, (DLGPROC) Parameter_Window_Exper);
}
BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
case WM_CHAR:
switch(char(wParam))
{
case 'A':
MessageBox(hWnd, "dialog box", "correct A response", MB_OK);
break;
}
....
}
|
|
|
|
|
"Intro" can't be displayed. Why?
"Intro" is created as a child of "Data", so it gets destroyed along with it. Make it a child of "Main", this should fix the problem.
(2). 'A' is taken care by MainWndProc still when "Data" has been triggered.
Not sure what's going on here. Does "Data" have the focus when you press the key?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Anonymous wrote:
'A' is taken care by MainWndProc still when "Data" has been triggered
You have to use IsDialogMessage instead of DispatchMessage .
rechi
|
|
|
|
|
so you mean I should do this? But it seems that the key can't get response from the dialog still.
extern HWND hwnddlg;
int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst, LPSTR lpszCmdLine, int nCmdShow)
{
...
while (GetMessage(&msg, NULL, 0, 0)) {
//TranslateMessage(&msg);
IsDialogMessage(hwnddlg,&msg);
//DispatchMessage(&msg);
}
return (msg.wParam);
}
|
|
|
|
|
You are right, it's not enough; the 'A' is stolen by the control that actually has the focus in the dialog box.
You could fix it by subclassing the controls able to gain the focus or you could create a hidden button with 'A' as mnemonic key.
rechi
|
|
|
|
|
"Hidden button with 'A' as mnemonic key": So clever an solution!!
so by "mnemonic" you mean that I should define a so-called "acceleration key"?
But how to define acceleration key to a button in a dialog? can you explain more? I only know the acceleration key to a menu in the main window--a newbie of windows programming.
Thank you.
|
|
|
|
|
Just type & before the key you want to use as mnemonic for that button.
For example: Butt& on will have the o key as mnemonic.
rechi
|
|
|
|
|
thanks. I am using the studio.net. How to add mnemonic? In the property session, there is no such choice to add/change mnemonic.
Can I add an (text) accelorator description in my .rc file like this?
Exper_Menu ACCELORATORS
{
"1" IDC_FIRST
"2" IDC_SECOND
}
Thanks
|
|
|
|
|
Great, I got it, following your advice and online help.
I appreciate!!
|
|
|
|
|
I have some text and I would like to draw a black outline around it. How does one do this? Do I use pens or do I use another font with differant attributes?
I tried the latter and I got weird results.
Could someone please help!
Cheers,
Cline
|
|
|
|
|
I can't even spell my name
Cheers,
Clint
|
|
|
|
|
I have a C++ client app. that will be used publically within and outside the U.S. What type of encryption can be used to encrypt the packets between the client and server(Win2000)?
|
|
|
|
|
i think 54-bit DES or lower is OK. but, even then, i think you will have to ask the US Dept of Defense. last i checked (a couple of years ago) every application needs to be approved individually.
maybe Bush relaxed the rules on crypto ...
;P
-c
I'm not the droid you're looking for.
|
|
|
|
|
I was thinking of using the Rijndael (symmetric block cipher) for packet encryption. Am I right in thinking that I have to use something like RSA(public key) to transmit the key to the client at the start of the session since symetric cyphers require the same key at both ends?
Couldn't find any examples of this on CP.
|
|
|
|
|
Yes, you will need to use some sort of public key encryption to securely pass the session keys between the server and the client.
Then you can use the symetric encryption between the two.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I remembered seeing an article on Rijndael encryption a couple weeks ago here on CP:
http://www.codeproject.com/cpp/aes.asp[^]
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
I am spawning a CDialog from an MFC MDI view.
I am presuming that I will put in stuff (RECT rcNormalPosition ) from the struct in the registry when I shut off the app:
typedef struct tagWINDOWPLACEMENT {
UINT length;
UINT flags;
UINT showCmd;
POINT ptMinPosition;
POINT ptMaxPosition;
RECT rcNormalPosition;
} WINDOWPLACEMENT;
Q1. I am not clear about what to store in ptMinPosition, and the corresp. maxpos. CAn I leave these NULL?
When I run the app gain, I want this CDialog excatly where it was and same size etc when I last shut down the app.
Q2. So in what part of the MFC code shall I make the CDialog show up again
( I'll do pDlg->Create() and then MoveWindow to rcNormalPosition ....correct? )
THese CDialogs are not within the mainframe....so will rcNormalPosition put them at those positions from the
computer screen origin? I'll have several CDialogs and I need them to reappear at the precise positions the user chose before he quit.
Appreciate your help,
ns
|
|
|
|
|
Check out this[^] article of mine. In particular, you can use the PlacementHook[^] class to easily accomplish what you need.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
I am optimistic I'll be able to figure out your class and use it<> only question is this:
The CDialogs were spawned by an MFC MDI view menu. SO now when the app is rerun, its the MDi part that will be running. I was reading the registry in pre-create of the mainframe so far to restore the mainframes status quo. Shall I in this same place do the modeless create for the CDialogs? I feel intuitively (thats a laugh - I am not old enough in this stuff for gut feelings!!!!) that this isnt t he place. SO maybe I should in the OnInitialUpdate of the view do something like:
If the registry says there are nonzero number of CDialogs information saved, then do
i =0; i < nCDialogs; i++
restore( what instead of the this that you have in your docs?)
You do a restore (this) but what should I restore? What should I have saved in my mainframe OnDestroy trhat I can use here?
DO you agree that I need to restore in OnINitiaUpdate?
Appreciate your help,
ns
|
|
|
|
|
I have a 4 character array which contains a hex number (ie. 02D1). I want to output the characters matching \x02 and \xD1 to my file. It works fine if I hard code it as "\x02\xD1", but the problem is the values are variable.
Anybody know of a function similar to CHR() that would handle this for me?
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
Can't you use CString.Format, or an ostringstream to build the string with the \x values in it ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I tried using format(), but \x requires a number after it.
Anyway I ended out with the following:
<br />
CString sHeader;
int nHigh; <br />
char sHigh; <br />
nHigh = strtol(sHeader.Left(2),NULL,16);<br />
sHigh = nHigh;
Seems to work fine so far.. Thanks for your help.
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|