Hello, Has anyone any experience with Forward Referencing in Attributed COM programming in Visual Studio 2005 ? In Visual Studio 2003, I was using the following to forward reference an interface. [export] __interface IMyDefinitions; This basically used to insert a line in the IDL file "__interface IMyDefinitions", for forward referencing. But it no longer works in Visual Studio 2005. No such line is inserted, and hence it fails during IDL compilation. Thanks & Regards, Arun Gupta
arun1405
Posts
-
Forward Referencing in VS2005 (Attributed COM) -
Using Interface type from the imported TLB (Attributed COM)I am writing a attributed COM component in Visual Studio .NET 2003 (VC++ 7.1). For reusing the types defined in some other TLB, I want to import this TLB that I do by inserting the following line in stdafx.h. [ importlib("test.tlb") ]; This 'importlib' attribute places this line in the library block of the IDL file. However, now if some of the interface methods in my COM component want to return an interface defined in test.tlb, it gives me IDL compilation error. Perhaps, it is probably since the automatic IDL generation by the compiler puts all the interface declarations of my component outside the library block, and the importlib attribute generates the importlib line inside the library block... and, so the interface declarations of my component are not able to recognize the interface types defined in the imported type library. Can anyone suggest me if I am importing the library in a wrong way, or if there is any other solution to it ? Thanks & Regards, Arun
-
Using Interface type from the imported TLB (Attributed COM)I am writing a attributed COM component in Visual Studio .NET 2003 (VC++ 7.1). For reusing the types defined in some other TLB, I want to import this TLB that I do by inserting the following line in stdafx.h. [ importlib("test.tlb") ]; This 'importlib' attribute places this line in the library block of the IDL file. However, now if some of the interface methods in my COM component want to return an interface defined in test.tlb, it gives me IDL compilation error. Perhaps, it is probably since the automatic IDL generation by the compiler puts all the interface declarations of my component outside the library block, and the importlib attribute generates the importlib line inside the library block... and, so the interface declarations of my component are not able to recognize the interface types defined in the imported type library. Can anyone suggest me if I am importing the library in a wrong way, or if there is any other solution to it ? Thanks & Regards, Arun
-
MSXML4: Cannot load XMLHi, I am trying to load the following XML through MSXML4 APIs. But it does not load. It says "Reference to undeclared namespace prefix 'ns0'". The code is:
CComBSTR bstrXML = "Arun"; MSXML2::IXMLDOMDocumentPtr pDoc(__uuidof(MSXML2::DOMDocument30)); VARIANT_BOOL b1 = pDoc->loadXML(bstrXML.m_str);
Could anyone tell me how to resolve this ? Thanks in advance, Arun. -
BUG: ATL 7.0 fails if chunk size is 07ff (2047 bytes)Hi Folks, I am using Microsoft Visual Studio .NET 2003 (Visual C++ 7.1) to access a webservice. Scenario is: I make a call to one of the methods of webservice. The call goes succesfully through the webservice. However, it fails while reading the response back from the webservice. This happens for a specific case if the chunk size is 07ff or 0800 bytes. Here, chunk size is the size of the SOAP response (it does not include HTTP header & footer size). Technically it is the value calculated as nChunkSize on line 1818 in atlhttp.inl. The code line is: cresult = get_chunked_size(chunk_buffer, chunk_buffer_end, &nChunkSize); The call fails because a value of LEX_ERROR is set by the "consume_chunk_footer" function of atlhttp.inl. It seems to me that in this particular case, the socket reads 1 byte less than the actual no. of bytes to be read, and so, it does not find the character '\n' which makes this function to return LEX_ERROR instead of LEX_OK. I have tested this taking various data. But it fails only for the above scenario. This seems to be a definite BUG. However, I am not sure if the patch already exists for it. If someone has any workarounds, do let me know. Regards, Arun Gupta.
-
SPROXY is not able to process WSDL FileHi Folks, When I try to "Update Web Reference" in Visual Studio .NET 2003, I get the following error: Creating web service proxy file for MyService ... sproxy : error SDL1000 : Not enough storage is available to complete this operation. sproxy : error SDL1001 : failure in processing WSDL file: "d:\Projects\Ser\ItaXML\FolderManager\MyService\MyService.wsdl". It used to work fine previously. It has started giving error very recently. I think I have installed some Critical Updates as instructed by Windows Update service and after that, it has started giving me this error. My operating system is Windows 2000 service pack 4. Does anyone has any idea what could be the error ? Regards, Arun Gupta
-
Accessing HTTPS Webservice using VC++ 7.1Hi Folks, I have a webservice written in Java successfully deployed on Tomcat 5.5.9. I have updated the server configuration file of Tomcat to support SSL communication on port 8443. After restarting the tomcat server, I am able to access the webservice also on the following URL through web-browser. https://localhost:8443/mywebservice As before, it is also accessible on http://localhost:8080/mywebservice. Now, I am developing a COM client in Microsoft Visual Studio (Visual C++ 7.1) that uses this webservice. The stubs are automatically created using the tool SPROXY of Visual Studio. Everything works fine as long as I give the URL of the webservice as http://localhost:8080/mywebservice. But, if I try to give the HTTPS URL "https://localhost:8443/mywebservice", the method invocation on the webservice fails. Infact, the call does not reach at all to the webservice. The call reaches the corresponding method in the stub file (the file generated by sproxy). In the method, it fails while executing "SendRequest" method. While debugging, I found that SendRequest is actually routed to atlsoap.h from where it goes to "Navigate" function in atlhttp.inl. Here, it fails while executing SetDefaultURL function. The exact line where it fails is Line 2142 of atlhttp.inl, which is following:
if ( currScheme != ATL_URL_SCHEME_HTTP && !TSocketClass::SupportsScheme(currScheme) ) return false; // only support HTTP
Could anyone suggest what changes I might have to make to successfully access HTTPS URL from my COM client in the similar way I access HTTP URL ? Thanks & Regards, Arun Gupta -
How to change name of coclass ?Hi Folks, I am writing an Attributed COM component in Visual C++ 7.1. In standard cases, the name of the coclass is the same as the CLASS name. I want to know if it is possible to change the coclass name ? For instance, in the following code of mine, IDL will be generated with the coclass named as "CMyData". But, I want to have the coclass name as "MyData" without changing the actual class name. [CODE] [ object, uuid("19088A64-4E82-4FD7-A8A5-A9FEE2577FE8"), dual, helpstring("IMyData Interface"), pointer_default(unique) ] __interface IMyData : IDispatch { [id(1), helpstring("method MyMethod")] HRESULT MyMethod(); } [ coclass, threading("apartment"), support_error_info("IMyData"), vi_progid("MyComponent.MyData"), progid("MyComponent.MyData.1"), version(1.0), uuid("4AF80BC4-6A51-4E83-A3A0-9184230CD2AD"), helpstring("MyData Class") ] class ATL_NO_VTABLE CMyData : public IMyData { public: CMyData(); virtual CMyData(); DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } STDMETHOD(MyMethod)(void); } [/CODE] Any help would be appreciated. Regards, Arun.
-
Handling Events in COM takes timeOne more clue: This COM component accesses a webservice and invoke some methods on it. The webservice is deployed in the Tomcat Container. (May be this is creating some problem)
-
Handling Events in COM takes timeHi Folks, I am trying to add EVENT HANDLING in the COM component (attributed) in Visual C++ 7.1. But, it takes a lot of time (around 250 ms on my machine) while executing "__raise" method call for each event. This is a serious problem for me as a typical operation in my program throws around 50 events and when 250 ms are clubbed together for these 50 events, the overall operation takes hell lot of time) Following is the event related code I have added in my program: ***************************************************************** [ dispinterface, nonextensible, uuid("4700BB55-A9D2-46f8-A453-EF8F9658E56F"), helpstring("_IMyEvents Interface") ] __interface _IMyEvents { [id(1), helpstring("method OnDataChanged")] HRESULT OnDataChanged(); } class ATL_NO_VTABLE CMyData : public IMyData { public: CMyData (); virtual ~CMyData (); __event __interface _IMyEvents; HRESULT FireOnDataChanged() { __raise OnDataChanged(); // THIS CALL TAKES TIME } ---------- ---------- } ***************************************************************** I would look forward to your suggestions & comments. Regards, Arun.
-
Passing Array of Strings as BSTR*Hi Folks, I am trying to access a java webservice from Visual C++ .NET. This java webservice has following method. public void CreateDoc(String[][] values); When I add webreference to this webservice in my visual studio .net environment, it changes the method to look like as following. HRESULT CreateDoc(BSTR* arrayOfarrayOfString_1, int arrayOfarrayOfString_1_nSizeIs); So, now in my visual c++ code, I have to pass a string array in this above format of BSTR*. I have tried a lot achieving this but no success ! Can anyone give me some idea how to do that ? Thanks in advance, Arun.
-
SDL1009 error while using Java Webservice from .NET 2003Hi Folks, I am trying to use a Java webservice from Visual C++ 7.1 (VS.NET 2003). This webservice exposes one function that returns an OBJECT (java.lang.Object). When I try to add web reference to this webservice in VC++7.1, it generates following error while creating webservice proxy. ----------------------------------------------------------------------- Creating web service proxy file for MyJavaService ... sproxy : error SDL1009 : could not resolve element, with [ namespace = "http://www.w3.org/2001/XMLSchema" name = "anyType" ] sproxy : error SDL1002 : failure in generating output file: "MyJavaService.h" ----------------------------------------------------------------------- I do not know why Visual C++ is not able to recognize "anyType" in WSDL file generated by Java. Does anyone has any idea? or is there any workaround possible ? Thanks & Regards, Arun Gupta
-
ASP. NET Webservice and IISHi Folks, I am writing an ASP.NET webservice in VC++7.1. It is deployed on IIS 5.0 WebServer running on Windows 2000 machine. My webservice is nothing but a simple wrapper over the existing code written in C. This existing C code requires custom environment and some third party DLLs. My questions are: 1. How can I make my webservice running on IIS, to search for these dependent DLLs? (My webservice runs successfully if DLLs are located in the system32 directory, otherwise not. I have even tried to set the path to the DLLs in the system environment variables of My Computer but it does not work) 2. Is it possible for IIS to load environment by some environment file (.env) ? I mean I have an environment file having something like PROJ_HOME="\project" PROJ_TMP="\project\temp"; can IIS read such a file and load the environment accordingly ? Regards, Arun.
-
ATL7.0 and Error HandlingHi All, Does anyone has any idea if ATL7.0 has introduced some better ways of handling errors in COM components ? Regards, ARun.
-
Forward declaration of interfacesI am facing the same problem and have not able to find out any solution yet. I tried inserting interface declaration statements in IDL file using "cpp_quote" attribute also but that does not work even (it inserts the line including "cpp_quote" :() Rowan, have you been able to find out any solution yet. If you had already, do post it... it would be a great help ! Thanx & Regards, Arun.
-
BUG: Registration of Attributed ATL Component fails with Web ReferencesHi, I am developing an attributed ATL COM component in VC 7.0. Everything works fine until I add a web reference. When I add a web reference to some webservice (created in Java), the BUILD process of ATL COM component generates following error while performing registration. Performing registration Project : error PRJ0019: A tool returned an error code from "Performing registration" The point is that if I make the same ATL COM component without using Attributes, the BUILD process returns no error even after adding the web-reference to the web service. Could anyone be able to help me out in resolving this issue ? Regards, Arun