|
Hello everybody,
I want to learn atl. I don't
know anything about atl please
tell me a good link or page about
it.
Best wishes.
thanks.
|
|
|
|
|
I am currently using
Begining ATL 3 COM Programming - by Richard Grimes -- Wrox Publication
I found this book to be good enough for beginning ATL
Hope this helps
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Estamos identificando um profissional para atuar em nossa empresa com o seguinte perfil :
Programação em Visual C++ utilizando WTL;
Bons conhecimentos em programação Internet.
Disponibilidade para início imediato.
Os interessados deverão enviar currículo para rh@techway.com.br
Solange Gomes
|
|
|
|
|
Hi all,
I am trying to convert an existing DCOM component into a web service. I personally find DCOM is great but is of poor interest in a firewall-dominated world. My good old objects have EVENTS, and I exploited them in order to prevent clients from polling the remote application status. Is there anything similar in web service?
Did anyone meet the problem?
Any help will be appreciated.
Thanks a lot in advance.
Best regards,
Andrea
|
|
|
|
|
Hi Andrea,
I was wondering about same thing (What if my objects support events?) when going thro web service Why's and How's
What I found is "Web Service Notification Design Pattern" that sounds something on same track as Events. Check the following search I did on Google -
web service notification[^]
I haven't done any implementation for it because I was just curios to know why and where one should use Web services and not DCOM.
I hope the above link will help you to some extent.
Please let me know if you find anything substantial on this Topic.
Thanks
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
What is the way to give flat look to DateTime control.
Thanks
|
|
|
|
|
Hi All,
I have to implement the collection classes in ATL. I have very little idea about the collection classes.
Could anybody provide me some code snippets which just explains the following thing:
1 - I have an exposed interface IRecord which reperesents a record from a database table.I want to return a collection to myclients(specially VB) which will conatin mutilple Records.Iknow for this I need to define a interface "IRecords" with one property defined as _NewEnum. Als I have to define a iterator class derived from the IEnumVARIANT which will iterate through the class.
2- Implementation of class IRecords with 2 or more functions like AddItem(which will add a Record to the collection).
3 - I want to use the vector as the container for the IRecord.
Please provide the information as soon as possible.
Thanks and Regards
Deepak
|
|
|
|
|
|
Hi Igor,
Thank a lot for your help.It really helped me a lot to understand the basics of the problem.
But if you dont mind I will keep pinging you for any clarification in the program.
I have gone through the code and now I am trying to implement it in my project.As i wil come across the problems I will mail you.
Thanks a ton agin for the help.
Regards
Deepak
|
|
|
|
|
Thanks Igor,
i am also in need for collection type of like this
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello
Please help me with this nasty problem,its appear so easy to solve but i can't.
I try to create an Add-In use standard wizard of VC7(Use C++\ATL property).
One of generated rows from code is:
hr = pCommands->AddNamedCommand(m_pAddInInstance, CComBSTR("MyAddin6"), CComBSTR("MyAddin6"), CComBSTR("Executes the command for MyAddin6"), VARIANT_TRUE, 59, NULL, EnvDTE::vsCommandStatusSupported+EnvDTE::vsCommandStatusEnabled, &pCreatedCommand);
This row add to Tools menu my AddIn when it necessary.Then i simple want to change icon of this AddIn on generic (had IDC_BITMAP1 id).And alter the row on following:
hr = pCommands->AddNamedCommand(m_pAddInInstance, CComBSTR("MyAddin6"), CComBSTR("MyAddin6"), CComBSTR("Executes the command for MyAddin6"), VARIANT_FALSE, IDC_BITMAP1, NULL, EnvDTE::vsCommandStatusSupported+EnvDTE::vsCommandStatusEnabled, &pCreatedCommand);
change VARIANT_TRUE on VARIANT_FALSE and 59 on IDC_BITMAP.
I think it must work bu it didn't.
The menu instead of my picture had nothing.Icon just disappeared.
Please help.
THANK.
|
|
|
|
|
Hello!
I ran into a problem, which, at first, looks like a bug in the implementation of STL. It can be simplified like this, consider the following code:
----8<--------8<--------8<--------8<--------8<----
#include <fstream>
using namespace std;
int main(int argc, char* argv[])
{
ofstream("myFile.txt") << "Hello" << endl;
return 0;
}
---->8-------->8-------->8-------->8-------->8----
I would expect this to put "Hello" in the file, but it prints the string address there.
I can't see why.
If you write:
ofstream("myFile.txt") << "Hello" << " men" << endl;
then " men" will be printed correctly, while "Hello" will be printed as the address.
Please note that this happens ONLY if you are using a temporary as the destination stream and ONLY with the leftmost object and ONLY if it's a string constant.
All the following versions behave as I would expect:
ofstream("myFile.txt") << (char*) "Hello" << endl;
//
ofstream("myFile.txt") << 123 << "Hello" << endl;
//
ofstream("myFile.txt") << 1.5f << endl;
//
ofstream myFile("myFile.txt");
myFile << "Hello" << endl;
//
I tried this with Visual Studio 2003 under WinXP and with the GNU compilare under Linux: same result, so it seems to be an intended behavior, because I tend not to think that I found any STL implementation issue. However, I found nothing in the STL documentation about this issue (hey... I found nothing, but maybe something is there hidden to my eyes ).
I am pretty much convinced that I forgot something very obvious and I'm being stupid, so if anyone can bring some light, it would be nice.
Thanks everyone.
Note: the original problem was found while creating a class deriving from basic_ostream to handle a custom error console, I also found several code sinppets around using temporary unnamed objects derived from basic_ostream but none of them was ever using a string constant as the leftmost object... -_-
C++U,
FrOYd
|
|
|
|
|
IIRC the C++ spec says that temporary objects hang around until the end of the statement, so to me it looks like a bug. I would put breakpoints on the ctor and dtor of ofstream to double-check the object's lifetime.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer."
-- Michael P. Butler in the Lounge
|
|
|
|
|
Hi all,
Someone please explain me why COM doesnot support Multiple Inheritance incase of Interfaces
I mean why I shouldn't have
IDerived:IBase1,IBase2
I did read about it in Don Box book, but I would appreciate if someone explains it in detail (A link to some online resource would work fine too )
Thanks
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I can't really answer your question. My guess is that it may be quite a restriction on the ABI if multiple inheritance is allowed. A restriction too high for other compiler vendors to cope with.
But, one has to ask oneself: is multiple interface inheritance really needed? I don't see why it is needed at all. Why not let the class implement the interfaces one by one...?
--
Arigato gozaimashita!
|
|
|
|
|
Its all about the binary layout thats results due to multiple inheritance among interfaces...
I wanted some details about it. Hope someone does help regarding this
Thanks Jörgen Sigvardsson
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hain Sohail,
according to me,Com is Binary standared that can be used by every language,as there are many language which don't support the Multiple Inheritance,then they can't use this type component and that the failure for COM.
so i think M$ try to find a middle way to stop Multiple Inheitence in COM COmponent.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
sohailkadiwala wrote:
Hi all,
Someone please explain me why COM doesnot support Multiple Inheritance incase of Interfaces
I mean why I shouldn't have
IDerived:IBase1,IBase2
I did read about it in Don Box book, but I would appreciate if someone explains it in detail (A link to some online resource would work fine too )
Com interfaces are required to have a certain binary structure. Specificly, an interface referes to a table (simple array) of function pointers. The first three members of this table are always QueryInterface, AddRef, and Release. Additional interface functions come right after these. Therefore, both IBase1 and IBase2 would have members in the fourth slot (unless one is IUnknown). Multiple inheritence of interfaces would require the fourth slot to contain both the IBase1 member and the *Base2 member, which is not possible.
When you use C++ multiple inheritance with classes that have virtual functions, it creates multiple tables of function pointers. This makes it easy to create an object with multiple interfaces, but isn't useful for creating interfaces with multiple base classes.
It seems to me that what I've explained so far would all be in your book, so please feel free to ask for clarification.
Nathan Holt
|
|
|
|
|
Hi Nathan,
Thanks for the detailed explanation. I agree about the Binary Structure that must be standard for all interfaces and thats why COM avoids multiple inheritance among interfaces
Nathan Holt at CCEI wrote:
Multiple inheritence of interfaces would require the fourth slot to contain both the IBase1 member and the *Base2 member, which is not possible
Can you please explain me more on this. I am confused abt the above quote. What I know is there can be multiple inheritance possible among structures. COM interface is nothing but a Structure. So why would it be not possible to have multiple inhertance amongst interface ?
Thanks again
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
sohailkadiwala wrote:
Can you please explain me more on this. I am confused abt the above quote. What I know is there can be multiple inheritance possible among structures. COM interface is nothing but a Structure. So why would it be not possible to have multiple inhertance amongst interface ?
Sure. Multiple inheritance in C++ can rely on detailed information about the object. If both base classes have virtual functions, then the derived class will have two pointers to two different virtual function tables. (The virtual function tables are the tables I described in the previous message.) I don't know if C++ specifies the order the pointers occur in, and I'm pretty sure it doesn't specify how far apart the pointers are. This would make it difficult to specify a binary standard for multiple inheritance in interfaces.
In practice, I suspect that Microsoft could have defined their own standards for windows C++ compilers that would have made multiple inheritance of interfaces possible, but they didn't. In fact, there are a disturbing number of people who seem to think multiple inheritance was a mistake.
Nathan Holt
|
|
|
|
|
Thanks Nathan.
Very informative. Helped me understand the concept in a much better way.
Thanks Again
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I've created a get / put property inside an activeX control. I know the functionality is working ok because i've tested it with script <param =="" />
What i now need to do is copy the BSTR into a char* or c style array.
I've tried:
char str[MAX_PATH];
CComBSTR m_bstrString;
put:
ATLTRACE(_T("String assigned to: %ls\n"),newVal);
m_bstrFileString = newVal; //assign btr to CComBSTR
//do conversion
BSTR var = m_bstrString.Copy();
strcat(str,(LPCTSTR)var);
It only seems to be copying the first char?
Please help
|
|
|
|
|
|
The following line has undefined variable m_bstrFileString (could be typo)
m_bstrFileString = newVal; //assign btr to CComBSTR
Note : W2A macros has limitation, can not be used in loop. It can convert max 500KB of chars
One more soln would be using _bstr_t class..
For Ex:
char str[MAX_PATH];
_bstr_t str1(newVal);
strcpy(str,(char *)str1);
Sandeep Naik
|
|
|
|
|
thanks i will try that.
Could you please have a look at my thread 'ATL activeX control Initialize', directly below this one.
|
|
|
|