|
I think the answer is in my previous post. Use it if you have to and you don't have a better/easier solution.
|
|
|
|
|
I think that these technologies still using by Microsoft and I think also that they are very important.
but it's not wrong to use a new software builder and coder , they all the same but the new are easier to use.
|
|
|
|
|
Dear friend,
Iam currently developing window application using VC6 and VC2008 and interested to learn ATL, STL, WTL and COM. I have refered many article and tutorial in the net. But I felt difficult to understand the concepts and explanation. Friends kindly suggest me any material or site which many helpful to learn it from beginning.
Thanks and Regards,
S.Shanmuga Raja
|
|
|
|
|
Introduction to COM - What It Is and How to Use It.[^] by Michael Dunn, is an excellent introdiuction, as are his other articles on the subject. Scott Meyers has written some useful books on STL which you can probably find on Amazon. I don't use ATL/WTL so cannot offer suggestions for those. However, I would say that if you find these subjects difficult to understand then it is important to focus on only one at a time.
Use the best guess
|
|
|
|
|
Inside COM by Dale Rogerson (very good intro)
Professional COM Applications with ATL by Sing Li and Panos Economopoulos (more advanced)
COM IDL & Interface Design by Al Major (everything you ever wanted to know about interfaces)
Of course they're all a bit dated...
|
|
|
|
|
hi,
i will suggest to start with Inside COM by Dale Rogerson and then start with ATL/WTL
for STL - start with Nicolai M. Josuttis books/online resources.
regards,
Ajay
|
|
|
|
|
I am trying to use WTL but i need the ATL headers.
I install vs 2012 express and the SDK v7.1.
but I still cannot find the ATL headers.
like: atlbase.h
what I have to do?
and , is the ATL still included in some microsoft packages for free?
|
|
|
|
|
I t6hink you have to pay for one of the full Visual Studio editions, same as MFC.
Use the best guess
|
|
|
|
|
Hi all,
When using jscipt9 (Chakra) from C++ with the AddNamedItem() / GetScriptDispatch() functionality to create a module-like behaviour (context separation) I get E_OUTOFMEMORY from GetScriptDispatch() .
This happens only when omitting the SCRIPTITEM_GLOBALMEMBERS flag with AddNamedItem() , no matter what other flags are given.
I tried already everything, including different flags (all possible flags, not only the known ones), changing the order of calls to IActiveScript , calling it in different states of the script engine, invoking different versions via SCRIPTPROP_INVOKEVERSIONING , implementing all requested interfaces in my IActiveScriptSite etc - no result.
For older versions (means: not using jscript9) of jscript everything works as expected. But as soon as I switch the CLSID to Chakra it breaks.
I posted already on msdn: "AddNamedItem() / GetScriptDispatch() broken in jscript9?" [^] and filed a bug report [^].
You can reproduce with a most simple sample I put on github: https://github.com/IUnknown68/ascptest [^]
My main questions is: Am I doing something wrong? Is there something undocumented I have to do? Or is it really a bug?
Thanks,
imagiro
Edit: Run the sample from the command line with 9 as argument to invoke chakra. Otherwise the old jscript engine will be used.
modified 4-Jul-13 7:03am.
|
|
|
|
|
Hi, I have a critical problem, please help.
I'm developing a web game, which uses ATL based ActiveX control to display the 3d game world. When the game activex control was loaded by IE, a seperate game thread was created and the game HWND was created in the thread as child window of the activeX window. Then a message loop was running in the thread to process game logic, rendering,..etc.
In the game thread, I created a windowless mode Shockwave Flash player COM interface to display 2D content, which uses OleDraw to render the image to a texture.
Ok, All these things runs fine in IETab on chrome, BUT not in the IE! The flash player displays nothing in IE! In fact, some web browser which used IE core does work correctly, except IE!
So what could be the reason, and how can I fix this problem?
BTW: Sorry, my english is not good
|
|
|
|
|
Hi Guys,
Reading about COM Threading since two days..
But still i Couldnt understand Exactly " What is an Apartment ".
Kindly can any one explain in simple terms or show some source to understand more.
Thanks,
TV Krishna Rayalu
|
|
|
|
|
A good description can be found on this MSDN page[^]. Basically it is whether the COM object can support multi-threading or not: crazy Microsoft terminology again.
Use the best guess
|
|
|
|
|
Thanks Richard.
That link is informative.
i could able to understand STA and MTA, i got more discription
on what STA and MTA do then what exactly Apartment is.
Can you please define it in simple words.
Thanks & Regards,
TV Krishna Rayalu
|
|
|
|
|
KRISHNARAYALU wrote: Can you please define it in simple words. Define what? The link I gave you uses fairly simple words, and explains exactly what the difference is. If you do not understand the difference between single-threaded and multi-threaded code, then you should avoid using COM.
Use the best guess
|
|
|
|
|
Richard,
I may missed something vital in that article or Some basic in that concept.
I will re read the article. Thanks for Support.
Thanks & Regards,
TV Krishna Rayalu
|
|
|
|
|
First of all an apartment is an abstract concept, means, there is no physical thing behind. When a thread starts it decides in which apartment it wants to "live". It does so by calling CoInitialize or CoInitializeEx .
An apartment is a kind of a convention how to handle things. A thread that initializes a single-threaded apartment states, that it does not allow any other threads to enter the same apartment. COM knows then, that all objects living in this apartment can be accessed only from this same thread and makes sure that these objects are used only from within this thread.
A thread that initializes a multi-threaded apartment allows other threads. COM knows then, that multiple threads might access the objects in this apartment and relies on these objects to handle thread synchronization by themselfs.
So how do other threads enter the same apartment? Simply also via CoInitializeEx . By requesting a multi-threaded apartment they will automatically resist in the same apartment as the other MTA threads since there can only be one MTA.
So in the end each thread that initializes a STA creates its own apartment, while threads initializing MTA enter the one and only MTA. And the same is of course valid for all COM objects created from this thread.
|
|
|
|
|
|
my code:
class ATL_NO_VTABLE CSysLog :
.....
{
public:
[export]
enum EnumLogLevel
{
LogNone = 0,
LogError = 1,
LogWarning = 2,
LogInfo = 3,
LogDebug = 4,
LogDebug1 = 5,
LogDebug2 = 6,
LogDebug3 = 7,
LogDebug4,
};
......
it takes errors likes:
c1xx : error C3174: ....
LINK : fatal error LNK1250: ...
how to correct it?
|
|
|
|
|
Declare it in IDL e.g.
typedef [v1_enum] enum LogLevel
{
None = 1,
Error = 2,
Warning = 3
}LogLevel;
Use it in an interface parameter if you need to export a method:
interface IMyErrors : IDispatch {
HRESULT GetCurrentError(LogLevel udtLevel,...
...
Compile and and export as a type library or .dll or import the IDL into a .h file
|
|
|
|
|
#include<stdio.h>
#include<conio.h>
int *val1,*val2;
int *oper;
void calc(val1,val2,oper)
{
switch(*oper)
{
case '+':printf("%d",*val1+*val2);
break;
case '-':printf("%d",*val1-*val2);
break;
case '*':printf("%d",*val1 * *val2);
break;
case '/':printf("%d",*val1 / *val2);
break;
default:printf("invalied input");
}
}
void main()
{
int num1,num2;
int oper1;
printf("Enter 2 number and an operator\n");
scanf_s("%d%d%d",&num1,&num2,&oper1);
//fflush(stdin);
calc(&num1,&num2,&oper1);
_getch();
}
it is showing all of the following ERRORS
Error 2 error C2017: illegal escape sequence c:\users\lina\desktop\project7\project7\source.cpp 33 1 Project7
Error 1 error C2448:
Error 3 error C3861:
6 IntelliSense: variable "oper" is not a type name c:\Users\Lina\Desktop\Project7\Project7\Source.cpp 7 21 Project7
4 IntelliSense: variable "val1" is not a type name c:\Users\Lina\Desktop\Project7\Project7\Source.cpp 7 11 Project7
5 IntelliSense: variable "val2" is not a type name c:\Users\Lina\Desktop\Project7\Project7\Source.cpp 7 16 Project7
|
|
|
|
|
Please format the code block properly, and identify line 33.
Use the best guess
|
|
|
|
|
Replace
int *val1,*val2;
int *oper;
void calc(val1,val2,oper)
with
void calc(int* val1,int* val2,int* oper)
|
|
|
|
|
Windows 7, Visual Studio 2008, MFC, C++, Dialog
My application makes use of an std::map, inserting records with the following:
m_tmats_definition_map[ the_key ] = m_one_definition_record;
the_key is a CString and m_one_definition_record is a structure of several CStrings and a few various fields such as integers.
That seems to be working. Now in the event something does not work out right I want some error checking. I am not finding much of anything concerning run time checking on this insert operation. Probably not looking in the right places or using the right search phrase. Where can I look to find a good discussion on this topic?
Thanks for your time
If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig_106/
|
|
|
|
|
ouch - hard question - I just had a look and its a right PITA - 'Dinkumware' and SGI used to have good manuals (and even finding what exceptions are thrown within is hard enough)
SGI's manual page for MAP is ... http://www.sgi.com/tech/stl/Map.html[^]
that may give you a start point - what sort of error's do you expect ? dont forget that map doesnt throw an error for a duplicate key value (the commonest issue I guess) - it simply replaces the existing value... for that reason, you should use find() first on the map to see if the value already exists
'g'
|
|
|
|
|
I don't know what sort of errors to expect. Isn't that one of the joys of software? <grin>
Good link.
Good point with the Find(). I do want to know if there are duplicates and will incorporate that.
Thanks for your time
If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig_106/
|
|
|
|