|
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
|
|
|
|
|
cjbaltar wrote:
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.
The problem is that stdafx.h is not being included by the code you've added to your project. You can either add it before all other includes in your new files, or change your project to automatically use precompiled headers ( which means it will only for files that include stdafx.h )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian,
Thank you oooooo thank you I just noticed that 1 file yes only 1 file had the stdafx.h 2nd line from the top of other includes.... and in deed it was the problem...
I cant tell you how much time I spent on something soooo basic. I will have to send you my finished code when it is entirely done!!
(we need a jumping for JOY smiley face) cuz thats me right about now!
Best Regards
-Chris
|
|
|
|
|
No worries, glad to help. That one caught me out once upon a time, as well. It's not exactly clear anywhere.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This is repost If you have seen it, but as I getting clearer as to what the questions this few lines of code have presented, I feel it is necessary to repost it because there's something that I knew the answer which I want to share and of course some I don't know and that's for you.
#include <iostream>
using namespace std;
class A
{
int i;
public:
A(int ii = 0) : i (ii){}
friend A operator+(A& left, A& right)
{
return A(left.i + right.i);
}
friend A operator-(A& left, A& right)
{
return A(left.i - right.i);
}
friend ostream& operator << (ostream& os, A a);
};
ostream& operator << (ostream& os, A a)
{
return os << a.i << endl;
}
int main()
{
A a(1), b(2), c(3);
cout << (a + b);
cout << (a - b);
getchar();
}
First of all I'm under VC++ 6.0
Those questions surround the code above are characterized by the following debug error messages:
1. "fatal error C1001: INTERNAL COMPILER ERROR".
2. "'i' : cannot access private member declared in class 'A'"
3. "'operator <<' is ambiguous"
The one of the resolution for the first one is operator foreward declaration which is pretty clear.
But I'm not clear with the 2, 3. For 3, the following statement is my guess and probably wildest guess, since that's the most logical one I can think of, correct me if I'm wrong. It seems once you move the definition for friend operator "<<" out of the class then the Koenig lookup was applied, because it is an unqualified the function, that was what the theory says(function at file scope fit into the unqualified category?). According to the theory cout << A bring the namespace "class A" into the list for lookup and it's ambiguous against the operator "<<" in <iostream> since "using namespace std" is introduced here? bur for the 2 I don't know why the compiler see friend operator "<<" as a function which has nothing to do with class A, Is there correlation exists between question 2 and 3?
Here the right implementation, at least at the compiler perspective
#include <iostream>
using namespace std;
class A;
A operator +(A& left, A& right);
A operator -(A& left, A& right);class A
{
int i;
public:
A(int ii = 0) : i (ii){}
friend A operator+(A& left, A& right)
{
return A(left.i + right.i);
}
friend A operator-(A& left, A& right)
{
return A(left.i - right.i);
}
friend ostream& operator << (ostream& os, A a);
{
return os << a.i << endl;
}};
int main()
{
A a(1), b(2), c(3);
cout << (a + b);
cout << (a - b);
getchar();
}
Probably I'll go to bed with unsolved questions in mind, cuz here's late at night
|
|
|
|
|
LiYS wrote:
'operator <<' is ambiguous"
This means you're passing an unknown type to <<, and it can't work out what to cast it to in order to proceed. It generally means it has one or more options.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Have nothing to do with Keonig lookup?
|
|
|
|
|
Yeah, that's also possible. I'd not have expected that error though, I don't think.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i'm working on a mac machine using CodeWarrior. first when i was compiling my program, it gave me an error that said that the header "net/if.h" couldn't be opened. so i changed my projects settings to include the header file path in the user access paths. now when i compile, it gives me the following error from inside the header file:
illegal use of incomplete struct/union/class "struct if_data". the error is traced to a line in the header file that says: struct if_data if_data (if_data is defined in another header, if_var.h which is included in if.h). Why would there be an error inside the header file? and how can i fix this problem?
Rola
|
|
|
|
|
Hello everybody?
I am trying to know how I can detect changes in data streams.
But I don’t have any practice this field.
I found 1 paper and read it. But I didn’t understand fluently it. (http://www.cs.technion.ac.il/~shai/vldb04.pdf)
If you have any idea about detecting changes in data streams, can you help me?
Also can you explain to me algorithm that presented paper?
What is distance anything?
My e-mail address is u_bulga@yahoo.com.
Thank you so much for your help.
Thank you
|
|
|
|