|
I implemented a ATL service in VC++ which notify me if any new file is created at certain path. But i want to know to the information about the file like it's name, creation time, size etc.
How can i do this.
please help me.
|
|
|
|
|
i'm able to add methods to an Interface that returns integer value, like i declared
[Add method]
method name : MathAdd
parameters : int x,int y,[out,retval]*int sum;
[/Add method]
and the implementaion,
STDMETHODIMP StATL::MathAdd(int x, int y, int *sum)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
*sum = x + y;
return S_OK;
}
and i'm using this in a VB application thru referncing.
Now, how do i make a method thats gonna return a char value,
i tried like ,
[Add Method]
Method Name : ReturnString
Parameters : char * inpString,[out,retval]char *outString
[Add Method]
STDMETHODIMP StATL::ReturnString(char *inpString, char *outString)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
strcpy(outString,inString);
return S_OK;
}
but i get the following errors, (see the following thread, it looks akward if i put it here)
plz note : this is my first attempt in ATL
thankx
Vdio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
[/stink] .
how to go
plz note : this is my first attempt in ATL
thankx
V
|
|
|
|
|
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class cstatl="">' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long __stdcall IStATL::ReturnString(unsigned char *,unsigned char *)' : pure virtual function was not defined
d:\proj\stratl\stratl.h(80) : see declaration of 'ReturnString'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class cstatl="">' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long __stdcall IStATL::ReturnString(unsigned char *,unsigned char *)' : pure virtual function was not defined
d:\proj\stratl\stratl.h(80) : see declaration of 'ReturnString'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
V
|
|
|
|
|
|
yeah.. i get u . thanks
V
|
|
|
|
|
did it work for you? how? because I tried it out using BSTR as the type of property to return but when I tried to put a string or even a character to the variable
STD....... (BSTR *pVal)
{
....
*pVal = "Hello";
}
error about conversion occurs for the above code snippet
|
|
|
|
|
hi
i m new to atl and want to learn any books or the help regarding the atl classes and their documentation.
ddd
|
|
|
|
|
Teach yourself ATL in 24 hours is a good book; quick and dirty "how to"
COM+ Programming. A Practical Guide Using Visual C++ and ATL is another great book.
Hit the programming fourms here as well, you'll find plenty of "How to's" and beginning guides for development.
:..::. Douglas H. Troy ::..
Fold with us|Development Blogging|viksoe.dk's site
|
|
|
|
|
I have an ATL windows service that exports a couple of com objects that implement connection points.
If I just use the exe as a com server the connection points work if I use it as a service I get permission denied when I declair a new instance of my object.
a programmer traped in a thugs body
|
|
|
|
|
The failure is in the Advise function.
I call query interface on the interface return from GetConnectionInterface() and I ret a permission denied.
a programmer traped in a thugs body
-- modified at 17:21 Tuesday 20th September, 2005
|
|
|
|
|
What happens if you allow the service access to the desktop?
Ctrl Panel\Administration\Services
find your service, right click Properties
Log On
check "Allow service to interact with the desktop"
-Warren.
|
|
|
|
|
I was using a user account to log the service on with, not with the service account. If I switch to the system account the connection points work but I don't know how to map to foreign share using the system account.
a programmer traped in a thugs body
|
|
|
|
|
Without knowing specific details, here's what I suspect is happening. You are using a service logged in as a certain type of user with certain restricted priveleges, you are then trying to make a connection point talk to something with higher privelege. This opens up possibilities for elevation of privelege attacks, this is probably why you are getting Access Denied. What happens if you use an Admin account for the service?
Cheers!
Warren Burch
(PS: traped is spelt "trapped" )
|
|
|
|
|
Answer.
if I call coinitilazesecurity on the vb client everything is magicly solved.
a programmer traped in a thugs body
|
|
|
|
|
I wish I was here yesterday. Then I could've saved you a couple of hours. But then again, you gained more by finding it out for yourself. Happy hacking!
|
|
|
|
|
I have a set of activeX controls. These controls are invisible at runtime. i have to create a project that use them like the follow way.
The methods defined in the activeX controls will be utilized by some aplication. They(ActiveX controls) will call methods in a dll. This dll makes interface with some devices like printers.
I'm not knowing how to create the correct projects in The Visual C++ and how to link ocx and dll.
P.S.: If helps, all this is about OPOS DRIVER!
I wait for reply!
Greatiful!
Hélio
-- modified at 9:53 Tuesday 20th September, 2005
|
|
|
|
|
Hi there,
i try to fire a VARIANT from ATL object.
So, the ATL wizard creates a xxxCP.h file that implements the Fire_XXX function.
However, the wizard writes wrong statement:
pvars[0] = &Data;
since pvars is CComVariant type then the operator '=' for bool is called instead of the operator '=' for VARIANT.
I needed to change the code to 'pvars[0] = Data;' (without the '&').
Changing the xxxCP.h file is dangerous since the ATL wizard can overwrite it.
Can anyone help me with this?
|
|
|
|
|
It is a known bug. Take a look at article Q264985 and Q250847.
|
|
|
|
|
Hello,
I recently downloaded some ATL/SOAP C++ sample code, which is hosted on CodeProject (but doesn't compile under VS.Net 2003) and on MSDN (compiles with no problems). The idea is to run an ATL/SOAP server without having a webserver (eg: IIS) installed. The links are below:
http://www.codeproject.com/dotnet/soaptransport.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/vcsamSOAPTransportSample.asp
I can start the "HttpListenerServer" in debug mode, and receive connections without any problems. However, when I try to query the server for its WSDL (using IE, i simply type in "http://localhost:333/Default?wsdl"), it seems to get an error inside the "Render" method of "atlstencil.h". If I comment out the HTTP_SUCCESS error check in "HttpSoapListen.h" so that the server outputs the incomplete WSDL, this is what I get:
<?xml version="1.0"?>
<!-- ATL Server generated Web Service Description -->
<definitions
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s0="urn:SimpleSoapAppService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:atls="http://tempuri.org/vc/atl/server/"
targetNamespace="urn:SimpleSoapAppService"
xmlns="http://schemas.xmlsoap.org/wsdl/"
>
<types>
<s:schema targetNamespace="urn:SimpleSoapAppService" attributeFormDefault="qualified" elementFormDefault="qualified">
<s:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
</s:schema>
</types>
<message name="HelloWorldIn">
<part name="bstrInput" type="s:string"/>
</message>
<message name="HelloWorldOut">
<part name="return" type="s:string"/>
</message>
<portType name="SimpleSoapAppServiceSoap">
<operation name="HelloWorld">
<input message="s0:HelloWorldIn"/>
<output message="s0:HelloWorldOut"/>
</operation>
</portType>
<binding name="SimpleSoapAppServiceSoap" type="s0:SimpleSoapAppServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="HelloWorld">
<soap:operation soapAction="#HelloWorld" style="rpc"/>
<input>
<soap:body use="encoded" namespace="urn:SimpleSoapAppService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:SimpleSoapAppService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="SimpleSoapAppService">
<port name="SimpleSoapAppServiceSoap" binding="s0:SimpleSoapAppServiceSoap">
<soap:address location="
So as you can see, the ATL code rendering the WSDL based on the stencil seems to be failing on the "location" token. I have no idea why this is happening, as my only experience with ATL/SOAP has been via the normal Web Service wizard, using IIS.
I was hoping someone might be able to help, or download the sample and try it out to check if they get the same problem.
Thanks,
Christopher
PS: I use WinXP Pro SP1 with VS.Net 2003
The bomb lives only as it is falling
|
|
|
|
|
Problem fixed.
I traced it down into (atlsoap.h) method HTTP_CODE OnGetURL().
It tries to do GetServerVariable("SERVER_PORT") which hasn't been defined inside the implementation in CHttpListenerSDLGenerator. I added the following, and it generated the WSDL fine afterwards:
else if( strcmp(pszVariableName, "SERVER_PORT")== 0)
szVal = "333";
The bomb lives only as it is falling
|
|
|
|
|
Hi.
How can I put a property in a category other than misc in an ATL ActiveX.
thanks...
|
|
|
|
|
when i user IDispEventImpl to catch the HTMLInputTextElementEvents,and do my own things when the button was clicked.So I DispEventAdvise my own fun when I catch the OnDocumentComplete(),But why I only can DispEventAdvise just one fun in the OnDocumentComplete()?how can I DispEventAdvise the html controls more than one?
Thank you for answer this question for me!
|
|
|
|
|
Setup:
I have a out of process COM exe which exposes a couple of objects
Object A is created and has a connection point interface.
On initialization Object A Creates a hidden window using the create function derived from CWindowImpl that listens for a custom message. Object A then creates a worker thread
Worker thread does some stuff and sends a message to the hidden window to notify the original thread and have that thread fire an event on the com object
Problem:
Nothing happens. The reason is that there is no message pump on the thread that contains Object A if it were and in process server the message pump for the client would work. I put a message pump after the thread spawn except it locks up the client since it is waiting for a return from the object creation. I tried to look at the ATL base classes to see if I could find how to add a message pump while still returning, but it was to no avail.
|
|
|
|
|
You can't make outgoing COM calls in a handler for a sent message. Change it to a posted message and it should work.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
I have to show a image in this way in a srf file. The {{ShowImage}} is explained by the method of OnShowImage() which can response a imge by gdi+.But when I run my program what I get is not a image but unknown codes in my srf file.Why can not I get my image? Please help me.
|
|
|
|