|
i want to get records from an SQL database, but i want the recoord to be displayed one by one. i know i should do it by surfing the records going to the next until End of File. But I also need to store the the data one by one in an array for use. Can someone please tell how to store each data in an array.
|
|
|
|
|
You can create a template(I'm not sure of the declaration syntax... so just search on msdn and you'll find...) array and then add the data in.
or
The better way I see is to create a struct and add one by one each elements to an array.
or
you can search msdn about recordset... if I remember well when you do a query in a database(for example : SELECT * FROM table) the query returns an array containing all element.
|
|
|
|
|
reenacutie wrote:
Can someone please tell how to store each data in an array.
If you are using MFC, check out the CArray class. The STL has a similar construct.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Can someone tell me if a modal property sheet can remain open while the control moves to the child.
I have an application where i have to display something on a new window .THe data comes from the modal property sheet but when I click on Close it clses the app .I tried using OnActivateChild but the program gave me a debug Assert failure.
Also if I have an existing modal dialog how do I change it to a modeless form??
Thanks
|
|
|
|
|
Hello all.
I cannot decide that HOW "to add text to a rectangle"
HELP ME !!!
|
|
|
|
|
What are you working on? Be more specific
<italic>Work hard, Work effectively and a bit of luck is the key to success.
|
|
|
|
|
Hello My name is Yun Hi Kim. I am a Korean. So I am sorry that my english is bad.
I am working UML application. I am using Visual C++6. It is my first application. So I cannot to do anything.
My UML application must to edit text in the shape such as ellipse and rectangle. Like as Visio(graphics diagram). How to do this.
|
|
|
|
|
|
NEED MORE INFORMANCE
Vengeance is savage kind of justice
|
|
|
|
|
Hello My name is Yun Hi Kim. I am a Korean. So I am sorry that my english is bad.
I am working UML application. I am using Visual C++6. It is my first application. So I cannot to do anything.
My UML application must to edit text in the shape such as ellipse and rectangle. Like as Visio(graphics diagram). How to do this.
|
|
|
|
|
|
I need to write a Windows VC++ 6.0 Web service client that requires to
Allow user to browse all WebService Methods and arguments dynamically w/o WSDL using MFC/SDK/ATL.(NO .NET)
Allow user to call the methods.
How to write that?
I am new to C++. You are welcome to give samples or links.
Thanks in advance
|
|
|
|
|
Hello Friends,
I the following code given below
#include <iostream.h>
void fun()
{
cout <<"in function one " << endl;
}
int main()
{
fun();
return 0;
}
The above program is complied and the output is shown
"in function one".One thing please notice that the function prototyping is not done here.
In the second the cpp program
#include <iostream.h>
int main()
{
fun();
return 0;
}
void fun()
{
cout <<"in function one " << endl;
}
In the second cpp program the function "fun()" is defined after the main().
This cpp shows an error which is given below.
//////////////////////////////////////////////////////////////////////////////
mpiling...
fun2.cpp
d:\c++\fun2\fun2.cpp(6) : error C2065: 'fun' : undeclared identifier
d:\c++\fun2\fun2.cpp(11) : error C2373: 'fun' : redefinition; different type modifiers
Error executing cl.exe.
fun2.exe - 2 error(s), 0 warning(s)
//////////////////////////////////////////////////////////////////////////////
In the first the cpp program the , the function declaration and the body is done before the main .In the cpp program the function declaration ie function prototying is not done here.
In the scecond cpp program, the funtion is defined, after the main function. the cpp program shows the error which is given above.If the function prototying the funtion is given ie. declaration function before the main , the above error can be avioded.
Can any one tell me what is the difference between the two programs.
Hoping for a reply.
Yours,
Phijo
|
|
|
|
|
You've pretty clearly said what the difference is. C++ requires the prototype of the function before it is used. In the first case, you've defined the function itself before its use, so it compiled fine. In the next case, the compiler was not able to see the prototype for fun() when it was used in main(), so it complained.
In C, you can get away without declaring a function if the function takes no parameter and returns an int. The C compiler assumes that prototype if it doesn't see one. That is not legal in C++ though.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
your first sample program.....
#include
void fun()
{
cout <<"in function one " << endl;
}
int main()
{
fun();
return 0;
}
workz fine coz the compiler lookz for all the function that are defined above it!!!!!
your second program......
#include
int main()
{
fun();
return 0;
}
void fun()
{
cout <<"in function one " << endl;
}
doesnt work coz as said the compiler lookz for all the function definitionz that are defined above the main function.....
if u have to get thiz above code working.....u have to give the compiler the indication that there is a function defined by giving a formal definition function prototype.....
coz once it reaches the void main it executes the code and findz ur function that is defined(with no prototype) as an undeclared type!!!!!.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
I have this app that opens a bitmap image and displays it in the dialog. However, when I move it off screen then back on, the portion that was offscreen but is now on screen is not refreshed. I think I have to handle some kind of message like WM_PAINT somewhere but I don't know quite where to do this exactly. I'm thinking of overriding CCmdTarget::OnCmdMsg and doing it in there somehow. Rather than making an uninformed guess at the best way at doing this and wasting time writing code I don't need, I'd like to ask up front as to what's the best way to do this. I'd like to redraw when the window is placed in it's final location (after left mouse button is released) but I would like to redraw it more intelligently after I get this part figured out. Any help would be greatly appreciated and thanks to all the people that have helped me in the past with this app.
|
|
|
|
|
You should do all your drawing in your WM_PAINT handler. Your window will recieve WM_PAINT messages from the system whenever it needs redrawing, for whatever reason.
"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! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
|
hey use the WM_PAINT directly!!!!!.....dont waste ur time writing a fuction such as OnPaint() by urself when there is an already well handled one.....it will do all the repaintz that are required automatically!!!!!
hope thiz helpz.....
just select ur class wizard and set the class name as the class name of the dialog,then in the messages box,look for WM_PAINT,double click it and it adds to the member function box as "OnPaint()".....click on the OK button.....
then in ur dialog cpp go to the added function(OnPaint()).....
then write the code that is needed to diplay the bitmap on the screen using BitBlt().....
if u have to load an image in to ur screen u must be using the dc memory.....
herez a n example code.....
void CXYZDlg::OnPaint()
{
dc.BitBlt(offsetx,offsety,m_size.cx,m_size.cy,m_dcMem, 2, 0,SRCCOPY);
}
look into BitBlt for more info.....
maybe thiz article could aso help u out!!!!!......
http://www.codeproject.com/bitmap/bmpscroll.asp[^]
the time taken to writing ur own paint finction is a waste of time and unnessar effort when the OnPaint() od the MFC handles thiz cery neatly!!!!!
:-Dcheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
You no need to handle any other messages for this. Just write your code that displays the image inside the OnPaint or WM_PAINT.
|
|
|
|
|
Is there anyone who knows Trojans???please help me and give me some knowledge abort Trojans~~thank u~~
Jack
|
|
|
|
|
Personally I think they are like having a shower in a raincoat.
Or do you mean you want to know how to write destructive software ? In that case, grow up and go home.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Trojans:
1) Universify of Southern California (USC) students (or at least the school mascot)
2) The people of Troy that were tricked into dragging in that very big wooden horse into their walled city.
Steve
|
|
|
|
|
Oh, I thought they were condoms.... *grin*
He's written to tell me that he wants to capture the screen, including the contents of video files that are playing. Still trying to work out what that has to do with trojans.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|