|
Hi,
if you want to reuse file2 to read another file, you have to reset all error flags.
This one should work:
file2.open("c:/cnu/country.doc");
while(file2)
{
...
}
file2.close();
file2.clear();
file2.open("c:/cnu/capital.doc");
while(file2)
{
...
}
file2.close();
Regards
Achim Klein
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
I tried what you said and it working fine
THANKS FOR YOUR REPLAY
Regards
cnu...
|
|
|
|
|
Hello,
I am working on a project and I am stuck at one place. I have 2 applications.
1-> ActiveX Control (Developed in MFC)
2-> A Windows C++ application.(No MFC...purely Windows)
How can I use the functions defined in ActiveX into this C++ application. I tried adding the ActiveX header file in my C++ application but then I get an error of CWnd, CString etc classes of MFC not found.
Please let me know if you or any of your friends know the solution. Please email me at dubeyashok@yahoo.com
Thanks in Advance.
Ashok Dubey
Ashok
|
|
|
|
|
Hello!!!
I want to store some data in CSV format. It would be like a table.
I would want to sort a column. Also select some records on some condition.
Is there any C++ class implmented for this purpose?
I do not wnat to use any database for this.
thanks..
|
|
|
|
|
I don't know of any classes that do this, I'd think it would be not hard to write one. You'd have a vector of objects, which are a custom class representing the object that's being put in the table. You'd use std::sort with functors to set which column to sort on. Obviously, you'd simply iterate through the collection to write out your CSV, overwritting the file every time.
Personally, I'd use XML and an XSLT to do the sorting.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
IS THIS IN RELATION TO COMP125 ASSIGNMENT 2 AT MACQUAUIRE UNIVERSITY
|
|
|
|
|
No.
I have a requirement in which i am storing some data in a database. This database has just one table. I was using DAO, but now I have to make it work on 64 bit platform. I can port the code to 64 bit if I can store the data in CSV format.
Hence the query.
|
|
|
|
|
Can anybody provides me with a definition for side effects in computing perspective?
for Instance what's the meaning of this term in the following sentence:
However, in C you've always been able to call a function and ignore the return
value (that is, you can call the function for its side effects).
|
|
|
|
|
LiYS wrote:
However, in C you've always been able to call a function and ignore the returnvalue (that is, you can call the function for its side effects).
In this case, it's saying that when a C++ program returns something, you're not forced to even store that value in a variable, let alone do anything with it. The 'side effects' would be what the function does, regardless of the value that it returns. For example, if you call a function that returns the contents of a file, but don't store the contents returned, the side effect would be that the file was opened on disc and read.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello,
We are developing a C++ SOAP client program by using MSSOAPLib. Our development environment is Windows Xp Professional, Visual Studio .NET 2003. Our program works correctly in Xin Xp (local computer). But with Windows 2000, it fails in some computers and works correctly in some other.
Our code is below, the failure point in Win2000 computer is the part where we create the ISoapConnectorPtr object (int hr = Connector.CreateInstance(__uuidof(HttpConnector));)
The CreateInstance method returns the following log:
////////// LOG ////////////////////////////////////////////////////
2005-08-14 08:48:17 - http://127.0.0.1/WebServiceBetek/Service.asmx
2005-08-14 08:48:17 - 2
2005-08-14 08:48:17 - CreateInstance Method
2005-08-14 08:48:17 - Function Return = -2147221164
2005-08-14 08:48:17 - 2.1.1
2005-08-14 08:48:17 - COM ERROR
2005-08-14 08:48:17 -
2005-08-14 08:48:17 - Invalid pointer
2005-08-14 08:48:17 - Error
2005-08-14 08:48:17 - Code = 80004003
2005-08-14 08:48:17 - Code meaning = Invalid pointer
2005-08-14 08:48:17 - Source = (null)
////////// LOG ////////////////////////////////////////////////////
So we have the invalid pointer problem (80004003). But there is no failure with WinXP computers and some other Win2000 computers. As I said above, all computers seem to have the same configuration : Microsof .NET Framework 1.1, MS SOAP Toolkit 3.0 and necessary service packs.
What can be the reason for this failure?
////////// CODE ////////////////////////////////////////////////////
#import "msxml3.dll"
using namespace MSXML2;
#import "C:\Program Files\Common Files\MSSoap\Binaries\MSSOAP1.dll" \
exclude("IStream", "ISequentialStream", "_LARGE_INTEGER", \
"_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME")
using namespace MSSOAPLib;
CString strRequest;
CoInitialize(NULL);
ISoapSerializerPtr Serializer = NULL;
ISoapReaderPtr Reader = NULL;
ISoapConnectorPtr Connector = NULL;
CString strFsmsWebServiceUrl = "http://127.0.0.1/WebServiceBetek/Service.asmx";
printf("WEB SERVICE URL");
printf(strFsmsWebServiceUrl.GetBuffer());
printf("2");
// Connect to the service
int hr = Connector.CreateInstance(__uuidof(HttpConnector));
printf("\nCreateInstance Method\n");
char szErrorTemp[100];
memset(szErrorTemp,0,sizeof(szErrorTemp));
sprintf(szErrorTemp,"\tFunction Return = %d\n", hr);
printf(szErrorTemp);
printf("\n2.1.1\n");
Connector->Property["Timeout"] = "10000";
////////// CODE ////////////////////////////////////////////////////
|
|
|
|
|
try adding this in web.config file of your web service
Generally to if this is not there in web.config, web service doesn't respond call from other machine. this might be possible reason.
Otherwise i'm not seeing any reason why CreateInstance is failing
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
</protocols>
-- modified at 9:31 Wednesday 14th September, 2005
|
|
|
|
|
when you type a code
int a =10;
printf("%d %d %d",a++,a++,a++);
returns o/p
12 11 10
can anybody pls xplain me why this o/p comes
|
|
|
|
|
C++ don't tell in which order the parameters are passed... here your compiler passes the last parameter first, so, this is why the last a++ gives you 10.
as you can see, never make such assertion in your code, and never write such code, because it will behave different ways depending on the compiler you built your code.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
keshava shukla wrote:
int a =10;
printf("%d %d %d",a++,a++,a++);
returns o/p
12 11 10
Funny. I tested this and what I got to print out was:
10 10 10
That would be the behavior I would expect, since those are postfix (++) operators, they should be incremented after the printf() expression. I made sure and put a
cout << a;
statement after the printf() statement, and sure enough a was 13. Are you using C, or C++. The ++ is much more unpredictable in C. As the other person that responded said, just don't do it. If you have to, make three extra values, like a1, a2, a3, and increment a and assign it to each of those values and pass those into printf.
Danny
|
|
|
|
|
thanks i think it will work
|
|
|
|
|
I am just installed Microsoft VisualStudio.Net 2003 in PC.Previously i used Visual Studio 6.0 to do c++ programs.
in vc6 i set project like this
file->New
in that dialog box i selected "win32console aplication" in projects tab and gave name to my project and click ok
and finish
In the workspace i selected fileview tab and click left hand mouse button and i selected 'add file to folder' and i give some name like "test.cpp" and click ok to type my programs
MY QUESTION IS
HOW TO DO THIS IN VISUAL STUDIO.NET 2003?
i tried same process but i am unable to do
please help me
Regards
cnu...
|
|
|
|
|
Right click on the project name and choose add/new file.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks christian graus
with your suggestion i installed Microsoft Visual Studio.net2003 in my PC
thanks for the help
Regards
cnu...
|
|
|
|
|
This is some sample program for testing routine called "showbits() ".But i got compile error like this
"test.cpp(10,12):call to undefined function "showbits"
but i read about this function on Book named "Let Us C" and
"isbn" number of the book is 81-7656-621-7
and objective of the function is to displayy the binary representation of any integer or character value
//this is code abt showbits() function
#include <iostream>
using namespace std;
int main()
{
int j;
for(j=0;j<=5;j++)
{
cout<<"\nDecimal";cout<
|
|
|
|
|
Simply because this function doesn't exists. You have to write it yourself.
|
|
|
|
|
<font color=green>
<font color=blue>void</font> ShowBits(<font color=blue>int</font> iData) {
std::string strResult(<font color=gray>""</font>);
<font color=blue>int</font> iNbBits = <font color=blue>sizeof</font>(iData) * 8;
<font color=blue>for</font> (<font color=blue>int</font> i = 0; i < iNbBits; i++) {
<font color=green>
strResult = std::string( (<font color=blue>char</font>)(((iData >> i) & 0x00000001) + <font color=gray>'0'</font>) ) +
strResult;
}
std::cout << strResult;
}
it's my goodness day...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 10:49 Tuesday 13th September, 2005
|
|
|
|
|
THANK YOU VERY MUCH FOR THE HELP AND REPLY
Regards
cnu...
|
|
|
|
|
toxcct wrote:
it's my goodness day...
Yes, I can see that . I was too lazy
|
|
|
|
|
but i'm sad to see that the only i get is sometimes get voted down when i make an effort to produce a godd and well presented answer to a post...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Sorry for the double post I think this belongs here!!
I pulled some code off of this site to create a nice clean looking LCD. It is called StaticCounter (Nice LCD display)
The code by itself seems to work fine however when I tried to integrate it with my current project or a brand new project I get the error.
C1010 Unexpected end of file while looking for precompled header directive.
I did some searching on both google and code project and found a couple things about stdafx.h no being included in the project, but sadly it has been a part of my MFC project since the beginning.
I tried to email the Author: Jason Hattingh but the code is rather old and I didn’t really expect help but it was worth a shot.
I’m starting to wonder if it is the difference in the fact that the project was not created in the .NET environment, but I have never had this problem in the past.
What I have done to eliminate Problems:
1.Created a brand new project with the MFC wizard.
2.Made it Dialog based.
3.Compliled the project to make sure it was working
3.Added the "proveded files" to the new project
4.Made sure necessary includes where put in place.
5.Compiled and received the C1010 error.
Any help would be greatly appreciated.
-Chris
|
|
|
|