|
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.
|
|
|
|
|
I'm thinking you'll have to write the image as a file in the web server filespace and write a URL as the result of ShowImage
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
that should work as long as you are calling SetResponseType to "image/png" or whatever the format is
The bomb lives only as it is falling
|
|
|
|
|
hi
i made a mfile function. instruction digitalio, addline,getvalue,
used in the program.
intruth for relation with parallel port used of this instruction.
i have no problem in run program but i have a problem in construct
exe of mfile and take place error in said instruction . error is
current matlab compiler not supported....
please help me .
thanks
|
|
|
|
|
I did a CScrollContainerImpl<> derived class that works fine, if I use Create().
What I wan't to do now is subclass a control on a dialog, so I can set the initial size and position via the dialog editor.
Now my problem is, that if I use a Static label as my placeholder I can't get the scrollbars to work.
If I click them nothing happens, what did I do wrong.
I also tried to use a custom contol as a place holder, but i don't know how to register Controls Window class correctly.
This must be a common problem, and maybe some pro can tell me the correct solution to it?
-- modified at 4:55 Tuesday 13th September, 2005
|
|
|
|
|
Come on somebody, please.
Some Pro to help me?
|
|
|
|
|
Did you call SubclassWindow() in OnInitDialog() like so:
CMyWindow m_wnd;<br />
<br />
BOOL bRet = m_wnd.SubclassWindow(GetDlgItem(IDC_MY_CONTROL));<br />
ATLASSERT(bRet);
And why did you use a static control, probably you should use a scrollbar control.
|
|
|
|
|
Hi Igor, thank you for answering.
I got exactly this code in my project (but the Variable names).
But it does not work. Scrolling via the mouseweel works fine, but there is no reaction when clicking the up/down buttons of the scroll bar. Neither when I'm trying to drag the scroll bar marker up or down.
Can I use a scrollbar here, that is going to be subclassed? I need a entire control, that can have a vertical and a horizontal scrollbar. Showing or hiding the scrollbars im managed by CScrollContainerImpl<>.
My class declaration looks something like that:
<br />
class CtrlPanel : public CScrollContainerImpl< CtrlPanel ><br />
{<br />
public:<br />
DECLARE_WND_CLASS( _T("CtrlPanel") )<br />
<br />
BEGIN_MSG_MAP_EX( CtrlPanel ) <br />
MSG_WM_ERASEBKGND( OnEraseBkgnd )<br />
CHAIN_MSG_MAP( CScrollContainerImpl< CtrlPanel > ) END_MSG_MAP()<br />
<br />
public:<br />
CtrlPanel( void );<br />
virtual ~CtrlPanel( void );<br />
<br />
HWND Create( HWND i_hParent );<br />
<br />
void UpdateLayout( void );<br />
void DoPaint( CDCHandle i_DCHandle ) {};<br />
<br />
private:<br />
LRESULT OnEraseBkgnd( HDC i_hDC );<br />
};<br />
This class later creates controls that are placed on it.
in UpdateLayout() I compute the size and position of each control, than i set the scrollsize...:
<br />
<br />
SetScrollSize( std::max( 1, ScrollSizeX ), std::max( 1, ScrollSizeY ) );<br />
Still, what am I doing wrong
|
|
|
|
|
Just a thought - maybe you need to handle all events yourself. Check codeproject articles on this subject (even MFC), see how what approach is used there. Sorry, can't give you more help.
Good luck.
|
|
|
|
|
Here I got an other approach to the question.
"How do I correctly subclass a CScrollContainerImpl?"
I guess a huge amount of developers has done this, but I simply cant gat it to work right. Still the scrollbars of static refuse to work.
So, if you managed to it - tell me how, please .
What contol do you put on your dialog to be subclassed?
Do you take care for any WMessgas, but those handled by CScrollContainerImpl<>?
|
|
|
|
|
Hello everyone,
Im new to the world of ATL and COM and am trying to create a wrapper class for a eVC++ library. I had the library working fine in a simple MFC app I wrote but the Linker fails in an ATL COM project I've created. Following is the error I receive.
wrapper.obj : error LNK2019: unresolved external symbol __imp__Read referenced in function "public: virtual long __cdecl CReader::InitReader(void)" (?InitReader@CReader@@UAAJXZ)
I'm guessing this error is due to a mis-understanding (on my part) of how ATL and COM link in external libraries. I was able to force the same error message in my MFC app by removing the .lib in "Project->Settings->Link:Object/Library Modules" which tells me that the Linker isnt seeing the library for some reason.
Any help is much appreciated!!
Thanks,
Ryan Bradley
|
|
|
|
|
Did you __declspec(dllexport) your class from your DLL, and __declspec(dllimport) from the DLL client?
Good music: In my rosary[^]
|
|
|
|
|
The library was provided to me by a vendor. Using "dumpbin.exe /exports" I can see the calls I need to make. I'm using the same .H file to __declspec(dllimport) in my ATL/COM project as with the MFC project that works.
That is what is confusing me. I'd guessed there is something different about how an ATL/COM project would attempt to link. This has to be something elementary that Im just missing.
Ryan Bradley
|
|
|
|
|
Now this is interesting...
The symbols the linker errors out on are slightly different between the ATL/COM and the MFC app. The ATL/COM object is looking for __imp__Read while the MFC app is looking for __imp_Read.
I can open up the .lib file in notepad and see __imp_Read. Any ideas??
Ryan Bradley
-- modified at 18:07 Friday 9th September, 2005
|
|
|
|
|
Hmm.. I think I know what it could be. IIRC, __cdecl functions are always given an _ prefix, while __stdcall aren't. Try with __cdecl or __stdcall (I'm too tired to sort out which one you need right now.. )
Good music: In my rosary[^]
-- modified at 18:15 Friday 9th September, 2005
|
|
|
|
|
Thanks for mentioning that. I think it is a piece of the puzzle. __cdecl decorates names while __stdcall does not. I've added #error directives to my header to ensure that __stdcall is used and it is. I've tried using __cdecl and it simply gives additional errors.
My header prototypes "__declspec(dllimport) int __stdcall Read()"
Despite all this sanity checking the linker is still looking for __imp__Read and not __imp_Read as it should.
Ryan Bradley
|
|
|
|