|
|
Why do you need to post the same message three times? Post it once and wait; if anyone has the answer they will give it to you, if not you may have to do some research for yourself.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
how can i connect my VC++6 MFC application to sql server? i simply need to know how do i make connection to VC++6 to sql server
plzzzzzzzzzzz help me....
|
|
|
|
|
Why you create multiple thread ??
There are many projects in code project Click here ->[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
how can i connect my VC++6 MFC application to sql server? i simply need to know how do i make connection to VC++6 to sql server
|
|
|
|
|
Use this
#define CONNECT_STRING _T("DSN=mmmmmmm;UID=sssssss; PWD=gggggg")
m_pDBConn = new CDatabase();
BOOL w_bIsOpen = FALSE;
if(m_pDBConn)
{
try
{
//opens a connection to the data source
w_bIsOpen = m_pDBConn->OpenEx(CONNECT_STRING);
}
|
|
|
|
|
Hi all,
i m reading a text file by using CStdio file,i want when i redaing the file and find the purticular line now i want to update it.
please tell me how can i do this.
thanks in advance.
|
|
|
|
|
Hi,
The only updates you can do on a text (sequential) file is appending or shortening.
So if you want to change something 'inside' you must create a new file and write there [unchanged beginning][changed part][unchanged ending].
Then you can delete the original file and rename the new file with the original name.
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
is there no onther option to update file without deleting old file and create new file.
|
|
|
|
|
Hi,
Le@rner wrote: is there no onther option to update file without deleting old file and create new file
There is no other safe option. If you are adventurous you can
1 Shorten to [unchanged beginning]
2 Append[changed part]
3 Append[unchanged ending]
If a power failure (or like problem) occurs during this processing you may have lost [changed part] and [unchanged ending].
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
In addition to the previous answer: most of the case, when manipulating files, you read them completely in memory and works directly with the data in memory. When you modify the information and have to save your changes, you recreate the complete file at once.
|
|
|
|
|
Another way to do this would be to memory map the file.
This way you can simply modify the contents and they will be automatically saved to disk by the Lazy Writer component of the Windows kernel.
|
|
|
|
|
«_Superman_» wrote: This way you can simply modify the contents
If your changed part is exactly same size as original (may happen)
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
The size can be controlled by mapping more views and using SetEndOfFile .
Happens.
|
|
|
|
|
Don't you think it's slightly overkill for the OP?
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
You're right.
There are so many crazy ways to do things.
|
|
|
|
|
Hey, I just came across a little problem and wanted to ask for your guys opinion.
What would be the most elegant solution to fix this little issue.
if (GetDriveType(drv) == DRIVE_FIXED)
{
GetDiskFreeSpaceEx(drv,0,&DiskSpace,&FreeDiskSpace);
itoa(GetTickCount()/1000%60,ds,10);
itoa(GetTickCount()/1000%60,fs,10);
string temp = "test " + ds + " dasd" + fs;
}
error C2110: '+' : cannot add two pointers
Open for any suggestions, greetings !
|
|
|
|
|
ALLERSLIT wrote: Open for any suggestions, greetings !
You did not show how ds and fs were declared, but one way might be:
string temp = string("test ") + ds + string(" dasd") + fs;
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Does not work out for me.
Getting theese errors:
Does not work out for me.
\test\main.cpp(18) : error C2784: 'std::_String_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_iterator<_Elem,_Traits,_Alloc>' from 'char [5]'
1> c:\program files\microsoft visual studio 9.0\vc\include\xstring(440) : see declaration of 'std::operator +'
\test\main.cpp(18) : error C2784: 'std::_String_const_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_const_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_const_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' from 'char [5]'
1> c:\program files\microsoft visual studio 9.0\vc\include\xstring(300) : see declaration of 'std::operator +'
\test\main.cpp(18) : error C2784: 'std::reverse_iterator<_RanIt> std::operator +(_Diff,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'char [5]'
1> c:\program files\microsoft visual studio 9.0\vc\include\xutility(2203) : see declaration of 'std::operator +'
\test\main.cpp(18) : error C2784: 'std::_Revranit<_RanIt,_Base> std::operator +(_Diff,const std::_Revranit<_RanIt,_Base> &)' : could not deduce template argument for 'const std::_Revranit<_RanIt,_Base> &' from 'char [5]'
1> c:\program files\microsoft visual studio 9.0\vc\include\xutility(2003) : see declaration of 'std::operator +'
\test\main.cpp(18) : error C2676: binary '+' : 'std::basic_string<_Elem,_Traits,_Ax>' does not define this operator or a conversion to a type acceptable to the predefined operator
|
|
|
|
|
string temp = string("test ") + string(ds) + string(" dasd") + string(fs);
|
|
|
|
|
ostringstream os;
os << "test " << ds << " dasd" << fs;
string temp = os.str()
|
|
|
|
|
Hi,
This would do the same without ugly and dangerous multiple additions of std::string and const char* :
#include <sstream>
if (GetDriveType(drv) == DRIVE_FIXED)
{
GetDiskFreeSpaceEx(drv,0,&DiskSpace,&FreeDiskSpace);
std::ostringstream oss;
oss << "test " << GetTickCount() / 1000 % 60;
oss << " dasd " << GetTickCount() / 1000 % 60 << std::ends;
std::string temp = oss.str();
}
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
modified on Saturday, October 30, 2010 2:51 AM
|
|
|
|
|
I need to implement a class that offers a client two ways to output data, depending on if they want to display it in ASCII or store it in binary. I figured the best way to implement the ASCII output would be to use a friend function as follows:
friend ostream& operator <<(ostream&, myClass const&); However, to offer a binary output option, I don't know whether I should create a friend function or a class method, and was wondering if there is an accepted best practice in such a scenario. The two options I am considering are:
friend ostream& write(myClass const&);
void write(ostream&) const; If either of these methods (or some other method) is the preferred way of offering such functionality, I would be interested to hear about it.
Similarly, I need to implement the binary input method, for which I have the following three conceivable options:
friend istream& read(myClass&);
void read(ostream&);
static void read(myClass *&, ostream&); Thanks for the help,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
hi all
in neural networks algo of face detection a term is used a lot " training neural network". what does it mean? and a file is used with extension of NNCP which is loaded first. as for as i know that file contains different patterns of faces. i wana implement the neural network algorithm but i don't understand how to train neural network and how to make this NNCp file which contains different face paterens.
any suggestions links will be appreciated.
thanks
|
|
|
|
|
I don't know how many times you plan to ask this question again, but your time would be better spent taking some of the advice that has already been offered. This article[^] has already been suggested as a starting point; try and spend some time learning from it.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|