|
Hi Jason,
Using ATL CRichEditCtrl is about the same than using Win32 API call. If you have used MFC, then this is not really a problem, since it provides about the same interfaces (function name). Even though I didn't see how that would fix your problem (having ActiveX container) since your main
window will still capture the focus with every event. It is better to fix that with the main window, why does it need to capture the focus?
Anyway, just create it:
DWORD dwStyle = WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_HSCROLL;
dwStyle |= ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL;
m_ctlRichEdit.Create(m_hWnd, rc, NULL, dwStyle);
BTW, when do you plan to release your game? (it looks good)
Last Article:
Adding VBScript/JScript to C++ App
|
|
|
|
|
Thanks for the quick reply! I was thinking about it a little more after writing it and I thought of two ways that are probably better fixes:
1) Write an actual mini-dialog app that is just the CRichEditCtrl chat dialog and have one COM interface that talks between the main app and the chat dialog. Running two different .exe files would guarantee two different windows.
2) Fix the main app (like you suggest) so that it doesn't steal the focus on game events. Honestly, I didn't actually consider it at first because I figured it would be too complex to try and find every instance where it happened, but I may look at this again.
Thanks for the compliment on the game. If you go to the main site, you can download the current BETA version (0.8.8). The game itself is complete, I'm just working on some remaining UI issues and cleanup before a 1.0 release.
|
|
|
|
|
Thanks, did you consider also having your chat window being able to stay on top?
By the way, I noticed that the chat window didn't have 'close' button. I will wait
for 1.0 release. Thanks and good luck!
Last Article:
Adding VBScript/JScript to C++ App
|
|
|
|
|
I want to create an COleDispatchDriver through class wizzard to call an object within a ATL project.
I have tried implement the object both as a CCmdTarget and an Atl Simple object. But to no joy.
When my Project calls the createdispatch method of COleDispatch driver it just fails.
Can anyone offer me any advice.
Cheers
Richard
|
|
|
|
|
I can now call "simple Atls objects" in Atl Projects, i hadn't called AfxOleInit.
But i still can't call CCmdTargets which are in a Atl Dll projects.
|
|
|
|
|
Hello to all,
I'm using ContourCube. I have the following problem. The grid
displays data at design but when I try to run my application it's
empty. Is any idea how i can make it to work?
Thanks in advance
paul
|
|
|
|
|
You need to expose the property in the property map section
BEGIN_PROP_MAP(...)
I guess you want your control to load these properties at runtime!
|
|
|
|
|
Hi all
I have a property page control and i want to insert another "custom control"(like FlexGrid control) in the property page's resource window. I tried making a CContainedWindow of the control inside my property page control. But unfortunately it got too complicated when it comes to handling events and setting properties for the custom control. Can someone suggest me how to do this (perhaps some sample code)or point me to any prev. article/link.
Thanks
srisan
|
|
|
|
|
Hi Everybody,
Can anyone tell me how to implement a callback function in vc++ client for an ActiveX Server implemented in Visual Basic.
|
|
|
|
|
Hello
With the file explorer on XP or 2000 , you can display image with the pellicule mode (or miniature)
But, windows displays only common format ( .jpg, tif, gif, ...)
So, my soft can read an other format (im5)
How can I complete the explorer display ? with a plug-in ?
with a link in th register table ?
with com object ?
thank you
|
|
|
|
|
Good question. I think it has to be a combination of a shell extension and a deskband. I know that in explorer, for a folder, you can edit the folder.htt file and modify the script to instantiate your COM object like the picture preview control that displays previews of common formats like jpg,bmp etc.
|
|
|
|
|
I have recently been re-evaluating the way our middle tier objects are designed and coded, including looking at their future under .Net
I guess to a large extent some of my methods of coding middle tier objects have been inherited from other people's code without a complete understanding of why. A few questions have arisen regarding the use of ObjectContext to create objects and so forth, especially in regard to COM+, but also wondering how things will change moving to .Net
1) All middle tier object instatiating (BLL creates DAL object, or BLL creates different BLL object) uses ObjectContext.CreateInstance. As I understand it, this will ensure the created object executes within the activity, the transaction (if there is one) and the security context of the client object.
Assuming my object is non transactional and I am not using security roles or such, do I still need to create objects in this manner?
2) Looking at the data access "helper" methods I see that someone has decided to ObjectContext.CreateInstance ADO objects. Is this wise? Are they threaded in such a way as to make them safe to run in an MTS activity?
3) All the documentation on ObjectContext talks about MTS, but there is no mention of it in the COM+ docs. Is there a good reason for this? What happened to ObjectContext in COM+?
4) In .Net it seems that my BLL and DAL objects would live in assemblies placed inteh ASP.Net Application's /bin/ directory and no longer require registering with COM+. Thank god I say, but are these assemblies still going to run under the supervision of COM+? And what happens to ObjectContexts under .Net?
Even if I could be pointed in the direction of some useful reading material that would be swell.
|
|
|
|
|
JBoy wrote:
4) In .Net it seems that my BLL and DAL objects would live in assemblies placed inteh ASP.Net Application's /bin/ directory and no longer require registering with COM+. Thank god I say, but are these assemblies still going to run under the supervision of COM+? And what happens to ObjectContexts under .Net?
From what I've read any COM+ assemblies have to be registered in the GAC, and then referenced by managed code in the usual way. The assembly attributes specify how it is to be installed into COM+ without you doing much. However, if it needs to be referenced by unmanaged code then you have to do a little more (don't remember off the top of my head, sorry). As a result, I don't think you can do a regular xcopy deploy (which is what I assume you were meaning).
That's about the extent of my COM+ knowledge at the moment, looking to tackle it a bit more of the next few days!
|
|
|
|
|
Most of those questions were regarding traditional COM+ dlls. However this last question was really concerning pure .Net assemblies.
Let me rephrase:
4) Rewriting my BLL and DAL objects in .Net, it seems that they would live in assemblies placed in the ASP.Net Application's /bin/ directory and no longer require registering with COM+. Thank god I say, but are these assemblies still going to run under the supervision of COM+ (IS there a COM+ in .Net)? And what happens to ObjectContexts under .Net?
Since part of the role of Contexts was to ensure that MTS could manage security roles, resource management and the like; I am guessing that these benefits are inherant with any managed code. Clearly I need to learn more about what happened to COM+ services with the advent of .Net
|
|
|
|
|
As far as I understand it the assemblies are added to COM+ at the time they are requested by a client (provided you specify all the necessary attributes).
However, the only examples I've seen require that you register the assembly in the GAC, which requires you to run gacutil /i and thus have access to the server's command line. Now, your hosting Company may allow this, and they may be more willing to do it since its very straightforward and is unlikely to break support for anything else already in there.
I'm not too geared up on ObjectContexts (since I've only ever tried to use COM+ with .NET, and never really got into it with traditional VB6/ATL), take a look at the ServicedComponent class and it'll probably give you more info about context.
I'm not too sure whether COM+ security settings over-ride those set by the assembly attributes, or vice versa.
|
|
|
|
|
Hi, i'm trying to create a component so i can implement file-drag&drop on a website.
i have looked at the messages received by IE in SPY++ and it shows no WM_DROPFILES messages :/
or can i receive the drop files message with standard dhtml?
dragging out of the page to the desktop is not a problem at the moment, but into the page.
any suggestions are welcome.
|
|
|
|
|
well, i managed to find another way of doing that (with the COleDropTarget/IDropTarget) and Register/Revoke-DragDrop()
so a solution is near
|
|
|
|
|
well, thanks for all answers, NOT. but i got it working.
|
|
|
|
|
Sounds mighty interesting, any chance I could persuade you to write an article up about it? Sorry I couldn't help, but I had absolutely no idea how to do it
|
|
|
|
|
I try to add Microsoft Comuincation Control to My ActiveX how can I
|
|
|
|
|
I have a COM component(STA). And 7 clients are trying to access that. After 2-3 sucessful calls for each client, one of the method of my COM component throws exception "-2147417848", which has hexa value: "80010108". MSDN does not tell how to rectify this problem. MSDN tells 3 possible reasons for such problem.
1. The server process ends (terminates).
This is not possible, as server is running.
2. The server process calls the CoDisconnectObject function.
I am not calling this method anyway.
3. No network communication is possible between the client and server computer for six minutes or more.
Client and server are on same PC. So, probably this can be ruled out.
Can anyone suggest something in this regard?
Regards.
|
|
|
|
|
Atin -
Atin Kumar wrote:
one of the method of my COM component throws exception "-2147417848", which has hexa value: "80010108".
Without knowing the details of your server, I can guess that this method is crashing the server.
From your description, it seems like other methods work fine.
HTH-
Vivek
|
|
|
|
|
Hi Vivek,
Thanks for replying to my query. I am further explaining the problem to you:
Server::
:::
Method A
Method B
Method C
Method D
:::
All the Clients are calling Method A, B, C, D in sequence. And exception comes in any of the above method. It is not that exception is thrown from a particular method. Chances of method crash are actually very very less.
Regards,
Atin.
|
|
|
|
|
Disclaimer: I am not an ATL guru....want to be but that is another disclaimer!
I have not been able to find any samples to follow that use inheritence and virtual functions in com using atl. I guess the first question should be can it be done? Here is what I am trying to accomplish...
I have a parent object (PObject) that has a virtual function (ExecuteService), and several pure virtual functions such as Display(). I want to extend that class with several subclasses that would implement the specific service. (We need an insert diagram here button on this forum!)
I want a factory which takes a string or int which gives me the correct subclass depending upon the parameter value.
This should work:
void RunService(CString name)
{
IServiceFactoryPtr ptrFact(__uuidof(ServiceFactory));
IPObjectPtr ptrObj = ptrFact->GetServiceByName(name.AllocSysString());
ptrObj->ExecuteService();
}
I've been able to get the factory working, I actually end up with the correct object when I make the call to GetServiceByName, however when calling ExecuteService I get an exception.
So, how do I set up the classes using ATL to get this to work??? It's a basic factory pattern. Good basis for an article if someone could get me past this hump!
Thanks,
ed
|
|
|
|
|
Take a look through the MS documentation (or other sources) for topics pertaining to Aggregation and/or containment. It is possible mimic inheritence in ATL by having one COM component aggregate the implementation of another COM component, expose these interfaces, and extend upon them by exposing additional interfaces. This is how inheritence in practiced in ATL and more specifically COM.
|
|
|
|