|
I need a little advice from someone that's needed to write multi-threaded COM objects to perform time consuming tasks, but that are loaded by IIS and exist on a web server.
My problem is that my COM object provides communication to a set of API's that retrieve data from an IMS database. Most requests for information through my component take 5-7 seconds, but some can take as long as 3-5 minutes depending on the data requested. At any rate, a regular COM component can (to my knowledge) only be loaded once by IIS allowing only a single instance to be loaded at a time. Since this component services a web client, I obviously need to be able to deal with constant incoming requests for data. Originally my component was a straight ATL COM component, developed as an STA (to allow use by scripting code from an ASP page). However, though it's apartment may be Single Threaded, it spun threads for each request so it could always be handling incoming requests without users having to wait on the previous request to complete. I handled adding in a message pump to deal with the problems of having a multi-threaded STA COM component. This worked very well for all the shorter requests. However, the longer requests would cause instability that I could never track down. Ultimately I had to remove the mult-threaded behavior in lieu of handling one call at a time.
The next thing I tried (I've had COM training, but not COM+) was rebuilding my component as a COM+ DLL. I didn't get very advanced, but now the component can be loaded in Component Services and allows pooling (if wanted) and most of the other things available to COM+ DLL's. My hope was to utilize object pooling to let COM+ Services sustain a collection of objects. I thought this would allow IIS to simply take one of the existing pooled objects and use it, basically allowing multiple objects to be created and used and end this wait in line crap. Apparently I've missed something.
If anyone has more experience in this area I could sure use some pointers.
Thanks,
Matt Philmon
|
|
|
|
|
I am currently looking at PHP.
I want to be able to generate my HTML pages from a
spreadsheet. I see that the windows version of PHP
supports COM and I have found a PHP example that puts
text in a word document.
Where can one find out what COM requests applications
support in particular EXCEL.
Thanks
|
|
|
|
|
you can go to msdn and look at the function from mso9.dll
if you have vb
open new project standard EXE
[project] - references find microsoft office
[view] - object browser
from<all libraries=""> dropdown select office
this list all object and functions
|
|
|
|
|
Keith Sloan wrote:
Where can one find out what COM requests applications
support in particular EXCEL.
There are several ways you can do that:
- Browse MSDN
- Within the application being explored (Excel, Word, ...) press Alt+F11 to invoke the VBA environment, which can display the objects structure
- To find out how to perform the particular action via OLE, use 'Record a Macro' and then study the generated code (by pressing Alt+F11)
- Insert the object into ActiveX Control Test Container and browse the methods list
- Launch OLE/COM Object Viewer and browse the type library
The most effective way is IMHO recording a macro and then experimenting with the code...
(H) Serge
* Origin: Silence Must Be Heard (2:5030/844.235)
|
|
|
|
|
Hi, I've embeded IE in my VB app using the WebBrowser control. I have IE 5.5 on my machine.
When I install my app on a test machien with IE4, the app crashes as soon as the ie control fires a trapped event!
ie. the browser control displays the webpage fine, but when the user clicks a link, and I catch the beforenavigate2 event, it crashes, it works fine however on my machien.
anyone seen this before?
any ideas?
Thanks!
- Alex
|
|
|
|
|
I am working on an in-house "phone book" application. I want to add the functionality such that if the user double clicks on an email address within the program, it will bring up an Outlook mail message with that address as the recipient (Outlook being the default mail package here; I'm not going to worry about anything else at this point).
I am totally new to COM and know generally what I need to do (call CoCreateInstance on the email message class, whatever that may be). However, I am having a very hard time figuring out exactly which CLSID/IID to use to pull up the application. Any help for this newbie would be greatly appreciated!
|
|
|
|
|
Have you tried looking into MAPI?
|
|
|
|
|
Just posted an article on writing an Outlook2K addin with ATL. Maybe you might find it interesting read when in gets published in a few days? Also lookup MSDN for Outlook object model info and related code and articles. You might also find the outlook.addin useful at the msnews.micorosft.com newsgroup. I certainly did.
HTH.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Does anybody have any idea how can I read the MS DTC log file ? I have found on MSDN a reference about a tool named "msdtcvtr.exe" which converts from the DTC log file to a text file, but I can't find that tool anywhere ... Not between DTC files, nor in Platform SDK or whatever. Thanks.
|
|
|
|
|
Hi All,
I have made simple COM componenet using ATL. having methods do_a(),
do_b(). Now I have added a dialog resource using Insert->ATL Object in COM
and added a button on that dialog , I want to call methods of COM do_a() on
the click event of that button. Can any one tell me how i do this ? Its
about getting the running com pointer in the dialog.
Thanking you.
Rizi.
|
|
|
|
|
I guess you have to use Createinstance() or smart pointer to initialize your copmonent in your dialog class and then use your methods
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Hello All,
I want to register and unregister the components in MTS/COM+ environment programmatically. I know that the components registered with regsvr32 will be residing at HKEY_CLASSES_ROOT. But I don't know how MTS/COM+ keeps hold of the components reference. I can go with COM+ export feature so that it'll give me one msi file. But I want some alternatives.
Can anyone help me? Timely help appreciated!
with Advance Thanks,
Ramesh.
|
|
|
|
|
Heya,
check out the "COMAdmin.COMAdminCatalog" object (there is a similar for MTS)
/WW
ex:
Set oCatalog = CreateObject("COMAdmin.COMAdminCatalog")
oCatalog.RefreshComponents
' Register the component (overwrites existing)
Call oCatalog.InstallComponent("MyApplication","MyDLL.dll","","")
|
|
|
|
|
I have a scripted process for releasing dlls and files into different environments(dev,qa,production) I will send it to you in full and get you up and running if you can help me with my post
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=114120&tid=114120#xx114120xx
|
|
|
|
|
Hi all,
I know this is probably a stupidly simple question but if anyone can give me an answer or point me to a tutorial I'd appreciate it.
I have created a COM object that plays animation files. What I need to be able to so is talk to the object from the server to play the next frame etc.
How do I reference the COM object so I can use one of it's methods?
Am I looking at this all wrong?
Cheers for the help.
James.
|
|
|
|
|
1.import your dll into your project(you can do it in stdafx.h):
#import"F:\ProjectVC++\ComTest0\Debug\ComTest0.dll" no_namespace
2.compile stdafx.cpp,then put two file with .tli,.tlh in your "DLL" directory
3. CoInitialize(NULL);
{
ITestComPtr pTest;
HRESULT hr=pTest.CreateInstance(__uuidof(TestCom));
if(SUCCEEDED(hr))
{
pTest->....
}
}
::CoUninitialize();
I hope it was clear for you
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
I forgot to say one point,the name of my interface is ITestCom,but when I want refrence pointer to it I HAVE TO add "Ptr" to the name of it,clear?good
of cource this is one and,and you can find another ways to refrence COM object
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Again please forgive me for my bad memory,you can check COM/ATL part of codeproject,therre are some tutorials to help you
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
There is other way of communicating with the component.
Let
Component:CMyComponent.
Interface:IMyInterface.
Now the code goes trhis way(inside the main if client is console else other suitable function.)
************************************************************
CoInitialize(NULL);
HRESULT hr=CoCreateInstance(CLSID_CMyComponent,NULL,CLSCTX_LOCAL_SERVER/*Depends*/,IID_IMyInterface,(void**)&pMyInterface); //pMyInterface is a
pointer to interface.
pMyInterface->....
CoUninitialize();
************************************************************
Let me know if u understood.
Regards,
Y.Yamini Devi.
|
|
|
|
|
How do I read this?
does (118) mean the line? cause i've looked and it just wasnt what it would seem to be.
Data: < GET > 01 00 00 00 03 00 00 00 03 00 00 00 47 45 54 00
strcore.cpp(118) : {3409} normal block at 0x0760B628, 28 bytes long.
Data: < /gue> 01 00 00 00 0F 00 00 00 0F 00 00 00 2F 67 75 65
strcore.cpp(118) : {3408} normal block at 0x0760B5C0, 30 bytes long.
Any help get a big Thank You!
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
Is this a dump of memory leaks? If so, read on...
118 is the line in strcore.cpp where the memory-leaking block was allocated. The best way to track down these bugs (without BoundsChecker or similar) is using _crtBreakAlloc in the VC++ debugger.
Search MSDN for "HOWTO: Use _crtBreakAlloc to Debug a Memory Allocation" for more info, but basically you start the debugger, set _crtBreakAlloc to equal the second number (3409 or 3408) in the lines above, and then run. When the memory that is leaking is allocated, the debugger will break and show you where.
Good luck.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
sweet thanks i'll try it - it looks like that'll work
~Timothy T. Rymer
www.digipen.edu
tim.xpertz.com
|
|
|
|
|
Hello everybody,
i have heard a lot about callbacks but i can't find any simple example (without MFC in it) on the internet to get started. i'm using MSVC++ 5.0 and the ATL wizard.
please help if know a place to find a tutorial or something.
THX
|
|
|
|
|
I'm looking for the same thing but I dont'find it.There are some resource in codeproject but they are MFC resources
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
try use com+ events instead
any help with
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=114120&tid=114120#xx114120xx
|
|
|
|