|
for examples with c# we can do somethings like this:
string sqlStr ="SELECT * FROM studentTable;";
dAdapter = new OleDbDataAdapter(sqlStr,myConn);
dset = new DataSet();
dAdapter.TableMappings.Add("Table","studentTable");
dAdapter.Fill(dset);
DataSet.DefaultViewManager property this.dviewmanager=dset.DefaultViewManager;
this.comboBox1.DataSource=this.dviewmanager; this.comboBox1.DisplayMember="studentTable.StudentID";
i want to do the same things with vc++ .net its possilbe?
thanks
|
|
|
|
|
Whoa thats some Sql database access (i dont know those), I cant help you with that, maybe if you look at CDaoDatabase, you can access databases with it.
But IMHO you have to get records from database and set them to the combo box one by one, there is probably not such command.
|
|
|
|
|
Hi everyone.
In my application, I use WebBrowser control to send HTTP request and get HTTP response. The response result is the HTML source(am i right?) which can be viewed by clicking View Source in the popup menu.
The problem is that the response is not the HTML code , but application-defined data. and I find that the following code works when the response is HTML code,but fails when my application-defined data:
IHTMLDocument2 * pDoc = (IHTMLDocument2 *)(m_ie.GetDocument());
BSTR str;
IHTMLElement * pElement = NULL;
pDoc->get_body(&pElement);
pElement->get_outerText(&str); //get_innerText
Because sometimes my application data is XML-like format , get_outerText(or inner) will remove the XML tags, that's not what I expect. get_outerHTML(or inner) will add some tags in my application data because there are tags in it.
I just want to implement a function that just like "View Source" menu item to get the full actual HTTP response.I use WebBrowser control because it can manage session automatically.
Thanks.
|
|
|
|
|
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?
|
|
|
|