|
use two sockets, one for listen, one for send.
|
|
|
|
|
you're right.
my problem is now how to combine them in one program.
----------
C++ Learner
|
|
|
|
|
The data is in a table in SQL Server 2000, like this
Time Price
2007-01-01 10.00
2007-01-02 11.00
I need to draw something like MA5,MA10,MA20,MA50 in stock software.
My method is:
1. Get current value
2. recordset->Move(-n,adBookmarkCurrent) //some times, n>1
3. Get summary, cycle
4. Get average value
I find it is very slow when drawing.
Who can give me any suggestion?
Thanks.
|
|
|
|
|
I am relative new to VC++ and i am trying to communicate with stage motor connected to serial port i tried going through functions and examples given in code project but still no success can anyone plz guide me as to how can i achieve this my aim to is Open, Close,Read and Write into comport.
|
|
|
|
|
sunny.rana wrote: ...but still no success...
Which means what? Are you having trouble compiling? Are you receiving a run-time error (assertion, exception)?
Assuming the device is sending data, it shouldn't take more than a few lines of code to test the connection. After that, you can start fine-tuning stuff.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I am building a dynamic data table type that can have its metadata defined at runtime,
so the Table class will have a vector containing charater arrays of unknown length when
the class is defined.
I need to make a decision about how to handle memory allocation/deallocation for the Table
class. In the trivial example below, how and when is the memory that is allocated by new, deleted?
If I clear() or erase() elements from the vector, will it also be the same as delete []'ing the contents of the vector (the arrays)?
#include <iostream>
#include <vector>
#include <string.h>
void Add_record(std::vector<char*> &Table){
char *n = new char[80];
strcpy(n, "Hello World!");
Table.push_back(n);
}
int main (void){
using namespace std;
vector<char*> Table;
for (int i = 0; i<10; ++i)
Add_record(Table);
for (int i = 0; i<10; ++i)
cout << "Table.at("<<i<<") = "<<Table.at(i)<<endl;
std::cin.get();
return 0;
}
-- modified at 16:43 Monday 12th November, 2007
|
|
|
|
|
Bevan C Bird wrote: how and when is the memory that is allocated by new, deleted?
Depends. Most modern operating systems will reclaim the memory when the process exits.
|
|
|
|
|
I may need to reuse the memory in this Table or possibly another one.
That is, while the process is running.
|
|
|
|
|
Bevan C Bird wrote: If I clear() or erase() elements from the vector, will it also be the same as delete []'ing the contents of the vector (the arrays)?
somehow I missed that question from your first post... oops.
No it does not free the memory allocated when you used the new operator
Bevan C Bird wrote: I may need to reuse the memory in this Table or possibly another one.
I don't know what you mean by "reuse the memory". As long as you have the pointers in the vector you will have access to them. If you clear the vector, based on the code you posted, you will no longer have access to the memory.
|
|
|
|
|
Don't bother #include ing string.h and using char* : instead use #include <string> and
std::vector<std::string> and forget about memory allocation issues.
Steve
|
|
|
|
|
Is there any simple way how to change frame around the Edit box
(just color, but not for all edits, just for i want)
Or how to subclass Edit?
viliam
|
|
|
|
|
I can not access border in this message.
It draw rectangle around white part, but border are still there.
And when I turn off border in resource editor, my rect is partly covered by text background.
All Edit SubClass codeproject items, I had found, are about behaviour of Edit none of them about painting.
viliam
|
|
|
|
|
simple and it works fine
Thank you
viliam
|
|
|
|
|
search codeproject with keyword "SubClass" you will get many article, which will fulfill your need
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi
I'm new to Visual C++ and .NET Framework; I'm trying to display a bitmap image on a Windows Form in Visual Studio 2005 but am experiencing problems with this.
I have examples for VS 2003 but these don’t seem to work in VS 2005.
Does anyone have any examples of displaying a bitmap in VS 2005?
Any help appreciated
|
|
|
|
|
You asked on the C++ forum so on the c++ you can use of LoadImage for load image and use of WM_ERASEBKGND for show this image.;)
|
|
|
|
|
but he specified to use WinForms, so we can decently understand that he is on the wrong place...
|
|
|
|
|
Yeah I saw his question but I said to him you asked on the c++ forum its meaning if someone answer to him answer will be c++ or c++.net,right!?;)
|
|
|
|
|
Can anyone tell me where I can find an overview, directions, etc. on porting a Visual C++ 6.0 project to Visual Studio 2005?
Visual Studio 2005 says it will convert a Visual C++ Project, but I'm getting compilation errors with the original Visual C++ interface (the one defined in resource.h and the *.rc files), plus warnings like :
"WINVER not defined"
"too many actual parameters for macro 'ON_WM_ACTIVATE'
Should I try creating a new project with the old code?
Thanks.
|
|
|
|
|
Go to Google and in the Search box type: Microsoft Visual C++
Then click the "Search" button.
The first link in the list takes you to the "Visual C++ Developer Center" on MSDN, remember this for future reference (there might be like real information here useful to developers using Visual C++).
In the upper right hand corner of the page there is a box titled "Focus On", in the box the first link is titled "Migrating From Previous Versions of Visual C++"
good luck
|
|
|
|
|
|
Yeah thats right,but it was a prediction or you can solve mysterys!?
|
|
|
|
|
But where in google home page is the search box?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
I was able to address all of the problems and warnings I first mentioned, and the first application I tried to port is working.
However, I then tried to port another Visual C++ 6.0 project, and got a different set of errors.
This second application refers to some ACE include files for definitions shared by other applications.
This application is a GUI used to generate and edit ASCII files.
First, I get warnings of the form:
.../ace/OS.i(516):warning C4996'chdir' was declared depreciated
Then I get errors of the form:
.../ace/Task_T.i(15): error C2491:'ACE_Task<ace_synch_mutex_t,ace_synch_condition_t>::water_marks':definition of dllimport function not allowed.
Let me emphasize: this application refers to some ACE include files but does not include any ACE code. No ACE libraries are referenced in the project.
Any thoughts?
Thanks.
|
|
|
|