|
My ATL web server is continously loaded and unload. The ISAPI extension fortunately not. Why this happen? I would like to have my web server always loaded because loading it requires many CPU cycles.
Could you please help me?
Best Regards,
Andrea
|
|
|
|
|
Say! If I create an ATL proj in .NET studio there is "References" item in project tree, what is that and how to use it? I mean are they like in C# and VB? If yes - how to use after I add a reference?
|
|
|
|
|
I am not sure of the real meaning of the question, however, if you are trying to use an ATL com server in a ATL project you can use "smart pointers".
Use #import directive in order to import the .tlb table then you can use these magic stuff.
If you have a IFoo intf and Foo coclass:
<br />
MYCOMLIB::IFoo m_foo;<br />
m_foo.CreateInstance (__uuidof (MYCOMLIB::Foo));<br />
m_foo->DoSomething ();<br />
Hope this helps.
Regards,
Andrea
|
|
|
|
|
Hi all,
I need to access a COM object from my ATL web service.
The COM object is propely registered in the target machine and can be freely
accessed from a VB client.
I am using smart pointer in order to create an instance.
When I invoke _com_ptr_t::CreateIntance I get as HRESULT "class not
registered".
What was wrong?
Please help me!!!
best Regards,
Andrea
|
|
|
|
|
Your client computer does not know anything about your COM object, mainly where it is located (this info is taken from the registry).
I have not done it for a long time, but I recall that the correct way to create a component remotely is by using CoCreateInstanceEx() . Look up the MSDN, it should have enough info.
|
|
|
|
|
Thanx a lot,
I found the problem, and this could be interesting for you, too.
My COM dll server was properly registered in a substituted volume (V that does not exists at Windows startup. For some reason this prevents the interface from being accessed in inetinfo processo. Placing my COM dll (ATL COM inproc server, by the way) in %windir%\system32 all works well.
Thanks a lot for your help.
Best Regards,
Andrea
|
|
|
|
|
Hi
I am trying to stream a map container to and from a file...
map<string , string > testMap;<br />
testMap.insert(pair<string , string>("one" , "This is string one"));<br />
testMap.insert(pair<string , string>("two" , "This is string two"));<br />
testMap.insert(pair<string , string>("three" , "This is string three"));<br />
<br />
copy(testMap.begin() , testMap.end() , ostream_iterator< pair<string , string> >(ofstream("C:\\myfile.txt") ));
It won't even compile! I've done similar with vectors without a problem....
vector<string> testVector;<br />
testVector.push_back("This is string one");<br />
testVector.push_back("This is string two");<br />
testVector.push_back("This is string three");<br />
<br />
copy(testVector.begin() , testVector.end() , ostream_iterator< string >(ofstream("C:\\myfile.txt") ));
This is really only a pre-amble to my next question...
If I got the above to work the file would look similar to...
<br />
<br />
oneThis is string onetwoThis is string twothreeThis is string three<br />
<br />
This is string oneThis is string twoThis is string three<br />
So reading in would be 'not easy' to say the least. Using an istream_iterator would not know where to break the string. There must be an easy way of streaming maps (or vector<string> ) to a file and reading them back in....
Somebody must have a snippet of code they can post....?
Cheers
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
I wouldn't start from here; I'd probably write something to load/save from/to XML, possibly using TinyXML or something similar.
Steve S
Developer for hire
|
|
|
|
|
Yes, there's a trick to it. The iostreams library breaks input on any whitespace (sounds a bit silly at first but in some situations it can be helpful). To get around this you need to save each element of the pair with spaces in it to a separate line. To make things easy for yourself, save the size of the container as well.
You can see the basic idea from the snippet below
#include <iostream>
#include <map>
#include <string>
#include <sstream>
using std::cout;
using std::endl;
typedef std::map<std::string,std::string> PairContainer;
void writeMap(std::ostream& os, PairContainer& v)
{
os << static_cast<unsigned int>(v.size()) << "\n";
PairContainer::const_iterator end(v.end());
for(PairContainer::iterator cur(v.begin()); cur != end; ++cur)
{
os << (*cur).first << "\n";
os << (*cur).second << "\n";
}
}
void readMap(std::istream& is, PairContainer& v)
{
unsigned int npairs = 0;
std::string tmp;
std::getline(is,tmp);
std::istringstream iss(tmp);
iss >> npairs;
for(unsigned int i = 0; i < npairs; i++)
{
std::pair<std::string,std::string> p;
std::getline(is,p.first);
std::getline(is,p.second);
v.insert(p);
}
}
I agree with the last poster that serializing data in this way is not a long term solution - it won't scale and can be hard to maintain and read, although I would recommend going with an XML api with a high level of abstraction if you head down that road, and even then it can be frustrating in some situations.
At times scripting languages like python and lua can be godsends for loading complex or heirarchical data, mainly because they are based on full parsers that do all the work for you, rather than SAX and DOM and many of the current XML API's which seem to only partially solve the problem.
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 your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Thanks to both of you - the code sample is excellent and meets my reqs perfectly. Ultimately the data will come from an SQL server which can dump out the data in XML so we'll read in eventually from that.
Thanks again.
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Hello,
how to import dll created with MFC into WTL project? The problem is with COleDateTime class which require ATLComTime.h to be included. But ATLComTime.h defines some types like CString which are also part of WTL library. It causes ambiguity problems.
How to solve this problem?
|
|
|
|
|
|
Hello everyone,
I want to create an ATL Dll and want to
Have a good article about it?
Any Ideas or links?
Best Wishes,
Thanks.
|
|
|
|
|
|
I have an ATL Server application (combined DLL), with server mappings set to all the extentions available. How do I, for example, handle requests for Image.jpg? I need to build a custom security system, and this is a very important aspect. So how to I catch all the extentions and call a specific function on their request?
|
|
|
|
|
During the work i have provided the task for Creating the
#1 evaluation version Component or ActiveX Dll
#2 Developer Version DLL
#3 Runtime DLL.
i have almost sorted out First task By producing a Modeless Atl dialog box .
but i still can't understand what about Developer DLl and Runtime Dll ,as i was told that you have to stop runtime dll to connect to IDEso that only application can use that.
can any body provide me any good pointer towards it.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I have create a atl propertypage, and use OleCreatePropertyFrame to create a framework for it. When I open this propertypage, press F1 on it, no help message is appears, why? And how can I let this function work, who can help me?
I have use Spy to monitor the message, the framework has received this WM_HELP message. If I add one EDIT in the propertypage and set the focus to it when open this propertypage, press F1 can get the help message, why this occurs?
Thanks very much.
I had written n bugs today.
|
|
|
|
|
I know HOOK can resolves this issue, but is there any other way to resolves this?
|
|
|
|
|
I added CAxDialogImpl to an ATL project using (insert -> new ATL object -> misc ... -> dialog).
I also added Web Browser ActiveX control to this dialog. I tried to catch Web Browser's events by simply going to the dialog box resource and right-clicking 'events' but I didn't work. For some reason I was not able to catch any of the Web Browser events.
Then, I tried to convert the dialog into a COM object by adding CComObjectRootEx, CComCoClass, IDispEventSimpleImpl ... but it didn't even compile!
How do I implement CAxDialogImpl derived control that hosts a web browser and sinks its events?
THANK YOU VERY MUCH, any help will be appreciated
andreytab@hotmail.com
|
|
|
|
|
|
Hi,
I'm new to COM and ATL so I think this is a simple question!
How can I add my structs and enums to my type library?
I'm using the export attribute like this:
<br />
[export]<br />
typedef enum<br />
{<br />
MyEnumValue = 1,<br />
}MyEnum;<br />
this creates the enum in the auto generated idl file, but doesn't show up in the type library.
What am I missing?
Thanks!
|
|
|
|
|
I had this problem about a month ago as well.
I found a way around it by actually creating a method that has the enumeration variable as a parameter (but actually does nothing). The presence of a method that uses the enumerator seem to export it to the final library.
This is definitly not a solution, just a workaround, and I have no idea why this works; so If anyone wants to enlighten me..feel free.
I Dream of Absolute Zero
|
|
|
|
|
Do you need to put your struct and enums under "library " section of you IDL as well ???
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
When I run my WTL program I get a resource leak in atlframe.h line 1225:
HWND CreateEx(HWND hWndParent = NULL, ATL::_U_RECT rect = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, LPVOID lpCreateParam = NULL)
{
const int cchName = 256;
TCHAR szWindowName[cchName];
szWindowName[0] = 0;
#ifndef _WIN32_WCE
#if (_ATL_VER >= 0x0700)
::LoadString(ATL::_AtlBaseModule.GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);
HMENU hMenu = ::LoadMenu(ATL::_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));
#else //!(_ATL_VER >= 0x0700)
::LoadString(_Module.GetResourceInstance(), T::GetWndClassInfo().m_uCommonResourceID, szWindowName, cchName);
HMENU hMenu = ::LoadMenu(_Module.GetResourceInstance(), MAKEINTRESOURCE(T::GetWndClassInfo().m_uCommonResourceID));
#endif //!(_ATL_VER >= 0x0700)
I'm using WTL 7.5 and ATL 3.0. Is the leak because the two are incompatible? If so, how do I update ATL? I only found ATL 2.0 on the MS web site.
-thanks.
|
|
|
|
|
What is RPC? How we implement that?
|
|
|
|