|
Insert USES_CONVERSION before using one of the conversion macros.
|
|
|
|
|
W2A means Wide to Ascii
W2T means Wide to TCHAR, and TCHAR is Wide or Ascii, depending on if _UNICODE is defined or not. You will want to use W2A.
Good music: In my rosary[^]
|
|
|
|
|
Hello All,
I am developing two different application in MFC. but i want to access same address space which is created by one. i want to create linklist created by one application and accessing by another.
I am beginner in COM & DOCM. if any one knows please help me.
Thanks in advance
Regards
Rajesh
|
|
|
|
|
rajesh_kapure wrote:
I am developing two different application in MFC. but i want to access same address space which is created by one. i want to create linklist created by one application and accessing by another. I am beginner in COM & DOCM. if any one knows please help me.
These are you options on Windows:
Windows Interprocess Communications[^]
|
|
|
|
|
Thanks, but i want to access same memory location from different application.
and for sharing same address space that artical contain only one solu'n 'File Mapping'.
Is any solu'n for accessing same address space.
waiting for reply.
Regards,
Rajesh
|
|
|
|
|
rajesh_kapure wrote:
Thanks, but i want to access same memory location from different application.
and for sharing same address space that artical contain only one solu'n 'File Mapping'.
Memory for Win32 programs is protected (in principle). You can define global variables that are accessible from more than one program. Don't remember how you do it (you need some sort of pragma) and it's very bad style anyway.
|
|
|
|
|
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
|
|
|
|