|
have you defined the DSN in control panel>administrative settings>odbc..?
hope you have not.
gud luck.
---------------------------------------------
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Hey, I've done it correctly
I found a nice book there in the library, and according to that book I think it is easy to use SQLOLEDB.1, simply OLEDB connection.
What you think of it. Actually I'm on the right way now. Open the SQL database and write some values to it.
I appreciate your help all the time...
Eranga
|
|
|
|
|
nice that you got your problem solved.
i have practically not used sql with vc++.
so i cannot suggest you any thing in that area.
gud luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Thank you. Let see what can I do for it.....
I appreciate your help all the time...
Eranga
|
|
|
|
|
How do I open a file with spaces (ex. read me.txt). I know this can be done using getline(Input_File, File_Name), I've tried doing that, but with no luck.
Here's my function:
<br />
void TextInfo(void)<br />
{<br />
ifstream Input_File;<br />
string File_Name;<br />
do<br />
{<br />
Input_File.open( GetString( "Enter name of file to read: " ).c_str() );<br />
if ( Input_File )<br />
break;<br />
cout << "Bad file name, try again." << endl;<br />
Input_File.clear();<br />
} while ( true );<br />
<br />
HoldScreen();<br />
}
|
|
|
|
|
It sounds like your issue is really with your GetString() function...
What does it do and how does it work? What does it do with leading and trailing spaces? Or the carriage-return?
Filenames are allowed to have spaces in them.
Are you sure you're in correct directory when attempting to open the file?
What if you put the file in your root folder, and then attempt to open: C:\read me.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
This is my GetString function, I open from root, but it will say: Bad file name, try again. But when I open a file without spaces, its okay.
<br />
string GetString( string Prompt )<br />
{<br />
bool Done = false;<br />
string InputValue;<br />
do<br />
{<br />
cout << Prompt;<br />
cin >> InputValue;<br />
if ( cin )<br />
{<br />
Done = true;<br />
}<br />
else<br />
{<br />
cout << "Bad Input!" << endl;<br />
cin.clear();<br />
cin.ignore(99,'\n');<br />
}<br />
} while ( !Done );<br />
<br />
cin.ignore(99,'\n');<br />
<br />
return InputValue;<br />
}<br />
|
|
|
|
|
VistaXP wrote: cin >> InputValue;
This will stop at the first whitespace character. Use getline() instead.
"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 think this is the perfect time for you to learn to use the debugger.
You would have found this problem yourself...
And you would have felt very smart to do so.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
could anybody tell me,
How to i know memory usage and CPU usage of any specific application/Process using VC++ application?
ThankXXXXX.
|
|
|
|
|
|
abhijit bhopale wrote: How to i know memory usage and CPU usage of any specific application/Process using VC++ application?
See here and here.
"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
|
|
|
|
|
Thank You Hamiod & David
-- modified at 22:30 Wednesday 24th October, 2007
|
|
|
|
|
Hi All,
I am using VC++ MFC Application.
I want to know the typeof my variable at run time, how can I do that? I hope it is possible with the typeof operator, but it gives me error like this identifier not found.So, is it possible with VC++ to use something like typeof operator??
Thanks in Advance.
Ashish Bhatt
|
|
|
|
|
Try to see 'CRuntimeClass' in the MSDN Library. Good luck
|
|
|
|
|
ashishbhatt wrote: I hope it is possible with the typeof operator
Where is that function? Or did u mean typeid() ?
|
|
|
|
|
|
The following represents standard C++ code, no Microsoft specifics involved.
void add_c_set(nfa_type& nfa, const string_set_type& c_set, bool and_flag) const;
void add_id_set(nfa_type& nfa, const ccid_set_type& id_set, bool and_flag) const;
The above problem occured, in long standing code, when I seperated some unrelated methods from a seperate template class, as they could stand on their own. Although I considered it a seperate issue, this must be related, the "Visual C++ 6.0" compiler started complaining about heap space (for symbols) when compiling for Unicode (not for ASCII). When compiling with "Visual C++ .Net" there are no problems.
The "string_set_type" is an STL set of STL strings (char or wchar_t) and "ccid_set_type" is a set of special identifiers. A "ccid" is basically a type derived from a template class that wraps an "unsigned char" value.
If you have any ideas, or have seen this problem before, please throw it out there, as I need a clue.
Thanks.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John R. Shaw wrote: string_set_type
John R. Shaw wrote: ccid_set_type
I think this use of macros is dumb and makes code unreadable. Can you provide the actual macros so we can see what we're dealing with ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Christian Graus wrote: Can you provide the actual macros...
Christian,
Why would you think I was using macros? That would be counter productive and bad practice in C++. The code is pure standard C++, and applies nothing but the best practices. Using “typedef” is common practice, as examining any STL container will show.
typedef std::set<string_type> string_set_type;
typedef std::set<ccid_type> ccid_set_type;
The template takes the same arguments as “basic_string” and “string_type is defined as:
typedef std::basic_string<_CharT_, _Traits_, _Alloc_> string_type;
I am using a C++ STL style of coding, because this code is intended to be familiar to anyone use to using the STL.
The code has been working for months, but it needed some minor improvements. The “add_set” methods worked perfectly until yesterday, when I separated those other methods from a separate template class that has nothing to do with this one.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Looks like the compiler cant tell the differnce between string_set_type and ccid_set_type.
Is it possible that when this code is compiled the compiler only has a forward declaration of one or both of these?
ie...
class ccid_set_type;
class string_set_type;
class Foo
{
void Add(const ccid_set_type&);
void Add(const string_set_type&);
};
|
|
|
|
|
I don't think they are classes, I think they are #defines for stl containers.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Josh Gray wrote: Is it possible that when this code is compiled the compiler only has a forward declaration of one or both of these?
No, everything is declared where it is supposed to be. Until yesterday it compiled perfectly with both methods named “add_set”, as it has for months. As a matter of fact I had not touched this template until this unexplained phenomenon occurred.
It has to have something to do with making those other methods, I mentioned, stand alone, as that is when it started happening. It only happens with VC 6.0, as VC .NET has absolutely no problems with it, even at warning level 4.
Why it can not tell the difference between two types that have totally different signatures is very confusing. It has to be related to the compilers heap space, but it never gets this far if that error occurs.
error C2535: '…' : member function already defined or declared
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
This is a long shot but you could try using the typename keyword
void add_c_set(nfa_type& nfa, const typename string_set_type& c_set, bool and_flag) const;
void add_id_set(nfa_type& nfa, const typename ccid_set_type& id_set, bool and_flag) const;
|
|
|
|
|
It was a long shot, but I tried it anyway. It had no effect, as expected.
I am getting offline now, but tomorrow I am going to reverse the changes I made yesterday and proceed with the changes one step at a time using the VC 6 environment instead of VC .NET, so I can see precisely when the error first appears.
Thanks for trying.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|