|
|
I understand what you've said here, however I cannot find why I constantly receive the error: error C3358: 'CSoapHandler': symbol not found
I have the code exactly like the sample OnlineAddressBook from the MSDN library yet I get the error whereas that app does not. Such simple things can stop a programmer for hours.
Here is the code I am using. Note that the Web Service this code is in compiles fine, it's when I compile the SRF (ATL Server) project that the error occurs, let me know if you need to see more code.
// DataConsumerWS.h : Defines the ATL Server request handler class
//
#pragma once
namespace DataConsumerWSService
{
const wchar_t MYDATASOURCE[] = L"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=me;Initial Catalog=mine;Data Source=SERVER;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False";
// all struct, enum, and typedefs for your webservice should go inside the namespace
// IDataConsumerWSService - web service interface declaration
//
[
uuid("2E179D71-E436-42EE-A1D6-00758BF3D7AA"),
object
]
__interface IDataConsumerWSService
{
// HelloWorld is a sample ATL Server web service method. It shows how to
// declare a web service method and its in-parameters and out-parameters
[id(1)] HRESULT GetStudents([out] int *arrSize,[out,size_is(*arrSize)] BSTR **NameList,[out,size_is(*arrSize)] LONG **IDList);
// TODO: Add additional web service methods here
};
// DataConsumerWSService - web service implementation
//
[
request_handler(name="Default", sdl="GenDataConsumerWSWSDL"),
soap_handler(
name="DataConsumerWSService",
namespace="urn:DataConsumerWSService",
protocol="soap"
)
]
class CDataConsumerWSService :
public IDataConsumerWSService
{
public:
// uncomment the service declaration(s) if you want to use
// a service that was generated with your ISAPI extension
CDataConnection m_dc;
HTTP_CODE InitializeHandler(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider)
{
if (HTTP_SUCCESS != CSoapHandler<cdataconsumerwsservice>::InitializeHandler(pRequestInfo, pProvider))
return HTTP_FAIL;
|
|
|
|
|
Hello
I've written a logfile class that writes the logentries in xml format.
A typical usage:
mylog.WriteLog(LOG_PRIO_HIGH, "Agroup", "This is a text with %d some %s
vars", 34, "diffrent");
output
<entry date="2003-01-01" time="20:01:32:1234" prio="1"
group="Agroup">This is a text with 39 some diffrent vars
I want to accomplish the same thing by using streams/stringbuf.
But I've not found any good examples that show me how I should do.
What i've found is a couple of examples that derives a class from stringbuf and from ostream.
I would be nice of I can get something like this:
log << log_prio(1) << log_group("test") << "hello" << nIntVar << strBuf << log_end;
log << "this is a string";
log << " something more" << log_end;
log << log_prio(2) << "last line" << log_end;
would look like:
<entry date="2003-01-01" time="20:01:32:1234" prio="1" group="test">hello1yeye
<entry date="2003-01-01" time="20:01:32:2200" prio="1" group="test">this is a string something more
<entry date="2003-01-01" time="20:01:32:6600" prio="2" group="test">last line
How do I accomplish this?
Thanks,
Jonas
|
|
|
|
|
try overloading the "<<" or ">>" operators.
|
|
|
|
|
Yep. I've started to do so.
class CDtLog
{
private:
std::ostringstream m_os;
bool bNewEntry;
int m_nPrio;
char* m_szGroup[40];
public:
CDtLog()
{
bNewEntry = true;
m_nPrio = 2;
m_szGroup[0] = NULL;
}
template<class T>
CDtLog &operator<<(const T &item)
{
if (bNewEntry)
{
m_os << "<entry prio=\"" << m_nPrio << "\" ";
if (m_szGroup[0]) m_os << "group=\"" << m_szGroup << "\" ";
m_os << ">";
bNewEntry = false;
}
m_os << item ;
return *this;
};
void print()
{
printf(m_os.str().c_str());
}
};
int _tmain(int argc, _TCHAR* argv[])
{
CDtLog test;
int i = 10;
test << "hejsan" << std::setfill(' ') << std::setw(10) << 12 << i;
test.print();
return 0;
} I need a modifier that tells me that a debugentry is done, similiar to endl, but instead of just flushing, it ends the xml tag and then flush it to the file.
I also need to check every entered character to see if it's a < or >, if so I need to translate it to > or <, or it will ****up the xml.
I also want modifiers that I can use to change the prio and group.
|
|
|
|
|
I am writing an ATL component to do some data access using ATO. I want to pass a _RecordsetPtr pointer or a _ConnectionPtr to a ATL function. I use code like this:
<br />
<br />
STDMETHODIMP CMyAtlObject::ReadData(LPDISPATCH pAdoRecordset, BOOL *pbSuccess)<br />
{<br />
_RecordsetPtr pRecordsetPtr;<br />
<br />
if (FAILED(pAdoRecordset->QueryInterface(IID_IDispatch, (void**) &pRecordsetPtr)))<br />
{<br />
return S_FALSE;<br />
}<br />
<br />
<br />
<br />
<br />
return S_OK;<br />
}<br />
<br />
But this doesn't work. The recordset pointer gets closed during the function call. If I pass an _ConnectionPtr as LPDISPATCH, the pointer becomes invalid.
So how can I pass valid ADO _RecordsetPtr's and _ConnectionPtr's to an ATL Object?
|
|
|
|
|
Although I use OLE DB directly rather than ADO, unless the function explicitly requires a smart pointer, I'd be inclined to use a regular interface pointer instead, to save an AddRef and Release on construction/destruction of the temporary object.
Steve S
[This signature space available for rent]
|
|
|
|
|
|
Where does your LPDISPATCH come from in the first place? That's an IDispatch, so using QueryInterface(IID_IDISPATCH, ...) is a no-brainer, it should just AddRef().
Are you using #import to pull in the ADO stuff?
To get the recordset ptr, you should use
__uuidof(_Recordset)
in place of IID_IDISPATCH. This will either fail or fill in your _RecordsetPtr properly.
Probably need more context to help more.
Steve S
[This signature space available for rent]
|
|
|
|
|
I have a windows installer .msi file problem. I updated my Features and Components and updated the old .msi file call it old.msi into a new msi file say new.msi. When I run new.msi it calls old.msi, why is that? What have I done wrong?
I am not an expert on windows installer, please help.
Actually, I want to run an Upgrade but old.msi does not have an Upgrade table, so I am trying to do a reinstall to the upgraded product.
If this is not the right location to post this question please let me know where to post it.
Thanks,
Ann
|
|
|
|
|
I need to implement IPropertSheet for ATL ActiveX Composite control.
How can I do ?
Any pointers or suggestions on the same.
Thanks in Advance
|
|
|
|
|
I am developing ATL ActiveX composite control. It contains some AtciveX controls and windows controls.I am inserting these controls in resource view.
I need to insert this composite control into some other composite control.
When I am doing so, i am not able view the composite control, which is inserted.Only the white has come up.
What should I do to get it to be shown? should I over-ride OnDraw function?
If so, how can i draw the Active controls, which i inserted in resource view?
Pls give some suggestions to how should I proceed?
|
|
|
|
|
I am looking for a book on ATL.
It must:
1.) Teach how to use ATL. Not just a browse through of ATL concepts/technologies, but in
depth explanation, expounding, and analysis on usage of ATL.
2.) Explain the workings of ATL.
In short I am looking for an ATL version of Bjarne's "The C++ Programming Language"
Can any of you guys suggest what should I read?
I am a Win32/MFC programmer. I think - am I right? - that common controls were implementated as ActiveX controls. If it is, can any of you guys provide/suggest an article/book that explains how the Redmondtians did this. Basically how an application through the Win32 api instantiate and interact with the common controls (Not an explanation of windows messaging or message routing, but on how message routing was implemented in Win32 api).
|
|
|
|
|
These are two excellent ATL books.
Developer's Workshop to COM and ATL 3.0 by Andrew Troelsen
ATL Internals by Brent Rector, Chris Sells, and Jim Springfield
Kuphryn
|
|
|
|
|
|
I'm fairly new to COM/ATL and found a couple tutorials at MSDN that I wanted to do. But they are all designed for VS7. The wizard looks different and has a tab for stock properties, interfaces, appearance. But I'm not sure how to accomplish the same things in VC++6. Is there a comprehensive article and what I have to do to get the same results as the vs7 wizard without installing VS7? Thanks for the feedback
paully
|
|
|
|
|
I'm trying to register an atl com object.
The self-registration succeeds in windows NT but not in win98.
http:??iesharp.8163.com
|
|
|
|
|
Are all of the required DLL's for the ATL object in the PATH variable for both operating systems?
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
YES
sdfsdfffffffffffffffffffffffasdf
|
|
|
|
|
When you use events with ATL, the default implementation of the Fire_XXX function is to to loop thru the clients list and invoke the event. the problem is that the client might hang when the event is called, so it will not return, and the hole atl server is stuck until you release the client.
This is not an acceptable situation. So what I've done is a try to do the invokation of the event in a diffrent thread for each client. It works most of the times, but some times it hangs the server, as if i got a dead lock.
So I figured, I'm probably not the first one to try to do it. Why not use a working implementation?
So everyone that have an idea / code of what can I do to make the invokation of the event in a diffrent thread for each client, please post me back.
thank you.
Arik Poznanski
COM is NOT dead.
|
|
|
|
|
see to this one: Q157437 Fireev.exe Fires Events from a Second Thread
it's for MFC , but it's a good starter.
The whole thing lies in fact, that you have to marshall the 'callback' interface when you pass it between threads.
If you're interested, sometime ago we did developed a specialized version of atlcom.h header, that does it automatically - you just have to include atlcommt.h instead the original atlcom.h . But it's for VC6 and I didn't test it on the new versions yet. But might be useful as source to look into.
|
|
|
|
|
Hey..
since I work with VC6, it would greatly help if you give me the atlcommt.h file, and some info about what you have changed.
mail me please at arikp@hotmail.co.il
and thank you very much..
Arik Poznanski
|
|
|
|
|
|
Hello ppl, i was going through Nishant's winsock tutorials and was trying them with WTL. In a simple console application, including winsock2.h works like a charm. but when i try it with WTL appwizard generated code, i get a huge list of 114 errors!!! (mostly type/macro redefinition errors). But if i change it to winsock.h, it works. i have included ws2_32.lib in my project settings also. can anyone give me a clue on this? thanks in advance.
I am using VC++ 6.0 with February 2003 platform sdk and wtl 7.0 on WinXP Pro.
-Tareq
|
|
|
|
|
Can anyone suggest the easiest way to print html documents from an ATL applications?
The computer will have Internet Explorer installed, can I use it to do all the work? And just specify the printer and document name?
Joanne;)
|
|
|
|