|
eXRange wrote:
I just want to implement a function that just like "View Source" menu item
Check this[^]...
|
|
|
|
|
i have a application that can be minimized to the system tray
what i want is whenever my application is minimized to system tray and user tries to run my application a second time the first app should pop out of the system tray and the second should exit
now i have used CreateEvent to prevent the application from running a second time but i cannot pop out the previous window from the system tray
i used FindWindow to find the previous window it returns NULL whenever window is in system tray
i tried to broadcast a registered message to all toplevel window didn't work either
please help, how can i obtain the HWND of the window in the system tray
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
i donno know abt above
but here i can help
mailMonty wrote:
i tried to broadcast a registered message to all toplevel window didn't work either
what is problem there Register message is not working or
you are not getting handle.
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
application minimized in tray is not getting my registered message
as i don't have the HWND of the minimized app
i use HWND_BROADCAST to broadcast my Registered message to all top level windows but my app never gets it
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
ok send me a blank mail at alok@efextra.com , i will send you a working code for your requirement by tommorow.
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hey, we're here to share knowledges, so let us know...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Ok,Tox
i will put Code here and after writing it,.
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Use the PJ Naughter SingleInstance code here on CP. That's what I use in Surfulater and ED. Surfulater does exactly what you want. See sig.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
http://www.codeproject.com/cpp/avoidmultinstance.asp[^]
The trick when doing this from the system tray is to hide your main window when you minimize it to the tray, that way it is still active and can thus respond to your registered message. When it recieves your registered message just unhide it.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
i have a dialog based application,
i used Showwindow to hide it before minimizing to system tray
still can't get it to work
by the way i am using ur CSystemTray class
why don't you add this in the class
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Recently I find that my application always crashs with invalid double floating value, so I want to determine whether a double floating value is valid or not then I can do some extra work to avoid crashes.
Can anybody tell me is there any function or method to known whether a floating value is valid or invalid??
Thanks a lot
|
|
|
|
|
|
the result looks like 1.#NF, and no divided by zero exception occurs.
|
|
|
|
|
ashxly wrote:
the result looks like 1.#NF, and no divided by zero exception occurs
OK. This makes sense. The error occurs because infinity cannot be truely represented by any numerical value, including floats. You will certainly get a numerical overflow if you try to divide by zero[^].
So I think the cause is not that you have an 'invalid' float value (unlikely), but that you are performing an invalid mathematical action (like dividing by zero).
I Dream of Absolute Zero
|
|
|
|
|
Can you give us an example of an invalid floating point value?
Or more importantly where in your code this is causing the crash.
I Dream of Absolute Zero
|
|
|
|
|
have a look at <float.h>. it provides many functions to manage the infinites, undefined values, and so...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Have you looked at _isnan() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
yacc file:
%{
#include <stdio.h>
#include <ctype.h>
#define YYSTYPE double /* stack data type */
%}
%start list
%token NUMBER
%left '+' '-' /*left associative */
%left '*' '/' /*left associative */
%left UNARYMINUS
%%
list : /*empty*/
| list expr '\n'
{printf("%f\n",$2);}
| list error '\n'
{ yyerrok; }
;
expr : NUMBER
{ $$ = $1; }
| '-' expr %prec UNARYMINUS
{ $$ = -$2; }
| '+' expr %prec UNARYMINUS
{ $$ = $2; }
| expr '+' expr
{ $$ = $1 + $3; }
| expr '-' expr
{ $$ = $1 - $3; }
| expr '*' expr
{ $$ = $1 * $3; }
| expr '/' expr
{
if ($3)
$$ = $1 / $3;
else
{
$$ = 1;
printf (stderr, "%d.%d-%d.%d: division by zero",
@3.first_line, @3.first_column,
@3.last_line, @3.last_column);
}
}
| '(' expr ')'
{ $$ = $2; }
| '(' expr error
{ $$ = $2; yyerror("missing ')'"); yyerrok;}
;
%%
void main()
{
yyparse();
}
int yyerror(char* msg)
{
printf("Error: %s encountered \n", msg);
}
lex file:
%{
#include "cal.tab.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*extern double yylval;
extern atof();*/
%}
digit [0-9]
integer {digit}+
exponant [eE][-+]?{integer}?
num {integer}("."{integer}?)?{exponant}?
%%
/*here! yylval can't get the right value */
{num} { yylval = atof(yytext);
printf("yylval is %f\n", yylval);
printf("yytext is %s\n",yytext);
return (NUMBER);
}
%%
int yywrap()
{
return 1;
}
|
|
|
|
|
What type of Language is That
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
It's Lex and YACC, as the subject says. The program looks like a simple four-function calculator.
|
|
|
|
|
but we are on the Visual C++ forum ... !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
What's the actual problem you are having? How have you tested this and what are the error messages?
|
|
|
|
|
While communicating with a Smart Card and I need to hold the line low and wait a little bit of time and then set the line high again in order to get the Answer To Reset. However, I have never done this before and have no clue as to how to do it. Would it be possible for someone to show me (in C++) how to do this.
Thank you. If you need more info I will be glad to oblige.
P.S. I posted a couple of days ago about having to read 20 bytes from the serial port and that ties into this since the Answer to Reset I want to read is 20 bytes long.
|
|
|
|
|
When creating a dialog based MFC application in VC++.net how does one utilize control variables and other function like UpdateData() inside a user defined function?
|
|
|
|
|
please rephrase your question, i dont understand
|
|
|
|