Click here to Skip to main content
15,919,879 members
Home / Discussions / COM
   

COM

 
GeneralCOM client app resulting in Error code C2018 Pin
Obi-Wan-Kenobi24-May-03 1:43
Obi-Wan-Kenobi24-May-03 1:43 
GeneralRe: COM client app resulting in Error code C2018 Pin
AlexO27-May-03 7:28
AlexO27-May-03 7:28 
GeneralRe: COM client app resulting in Error code C2018 Pin
Obi-Wan-Kenobi27-May-03 18:24
Obi-Wan-Kenobi27-May-03 18:24 
GeneralError handling events in wscript Pin
particle2k23-May-03 3:15
particle2k23-May-03 3:15 
GeneralRe: Error handling events in wscript Pin
Erik Juhl27-May-03 8:20
Erik Juhl27-May-03 8:20 
GeneralOLE-Automation debugging problem. Pin
vcseeker22-May-03 2:45
vcseeker22-May-03 2:45 
GeneralSee VC++ forum Pin
AlexO22-May-03 4:21
AlexO22-May-03 4:21 
GeneralSysAllocString hangs on Windows 2003 server Pin
Sachin R. Laddha22-May-03 1:36
Sachin R. Laddha22-May-03 1:36 
Hello,

There is a problem with sysallocstring on .Net server ( both RTM/RC2). If it is called from a global objects constructor, it hangs.

Here are the details -

1. Create a simple in-proc COM dll
2. Implement a function say Foo, which does nothing. It just returns S_OK
3. Write a simple C++ class, in its constructor allocate some memory using SysAllocString.
4. Declare a global instance of the class in the .cpp file.
5. Put OutputDebugString in DllMain, in c++ class's constructor and in function Foo as well.

Now your COM dll is ready with a global object variable.

6. On Windows 2003 .Net RTM / RC2, create a COM+ application for this dll with following configuration
***COM+ application properties-
a. Tab Security - Uncheck option Enable access checks for the application.
b. Tab Identity - use 'This User' identity
c. Tab Activation - Server application
d. Tab Advanced - Enable idle shutdown, set it to 1 minute.
***Component properties
a. Transaction type - required
b. Activation - Object pooling is on, set min level as 20. This is the most import settings. The hang goes away if object pooling if set off.


7. Write a simple windows script to call method foo.
8. Write one more script, say container, which invokes the above said script( Using WScript.Shell object ). After that call add a sleep for 2 minutes. This will ensure that the COM+ application comes up and shuts down properly.
9. Put the call to script ( the one which does createinstance and calls to foo) and the sleep in a loop of 100 iterations.
10. Run the main script, system should hang, it might not hang on first call inself.

Note that this does not occure on all RTM / RC2 machines, but once it occurs it will be there consistently. I am 110% sure about it.

I think its something related to COM+ runtime initialization.

The CoCreateInstance internally first calls Loadlibrary of the COM dll. The loadlibrary will first try to create the global variable and then calls to the dllmain. But the hang occus while creating global objects, if global object creation involves calls to SysAllocString. The call to CoCreateInstance never returns.

If any one want, I can send the dll and scripts as well...

Any clue, why this is happening? Is this a bug in .Net server?

thanks,
Sachin.


GeneralRe: SysAllocString hangs on Windows 2003 server Pin
Hugo Hallman25-May-03 11:29
Hugo Hallman25-May-03 11:29 
GeneralRe: SysAllocString hangs on Windows 2003 server Pin
jan larsen26-May-03 22:18
jan larsen26-May-03 22:18 
QuestionHow to check if an instance still exists? Pin
Jonathan de Halleux22-May-03 1:09
Jonathan de Halleux22-May-03 1:09 
GeneralAbout ISupporErrorInfo in Atl/com Pin
satishsilla21-May-03 23:49
satishsilla21-May-03 23:49 
GeneralRe: About ISupporErrorInfo in Atl/com Pin
Giles22-May-03 2:30
Giles22-May-03 2:30 
GeneralRe: About ISupporErrorInfo in Atl/com Pin
geo_m26-May-03 7:49
geo_m26-May-03 7:49 
GeneralClass to Variant Pin
makaveli1998200221-May-03 9:00
makaveli1998200221-May-03 9:00 
GeneralRe: Class to Variant Pin
AlexO21-May-03 10:16
AlexO21-May-03 10:16 
Generalpassing interfacepointers in dcom Pin
ELCH21-May-03 2:29
ELCH21-May-03 2:29 
GeneralRe: passing interfacepointers in dcom Pin
AlexO21-May-03 10:18
AlexO21-May-03 10:18 
GeneralRe: passing interfacepointers in dcom Pin
ELCH21-May-03 19:18
ELCH21-May-03 19:18 
GeneralRe: passing interfacepointers in dcom Pin
AlexO22-May-03 4:31
AlexO22-May-03 4:31 
GeneralRe: passing interfacepointers in dcom Pin
ELCH22-May-03 20:20
ELCH22-May-03 20:20 
GeneralRe: passing interfacepointers in dcom Pin
AlexO23-May-03 4:54
AlexO23-May-03 4:54 
GeneralRe: passing interfacepointers in dcom Pin
Vi225-May-03 17:42
Vi225-May-03 17:42 
GeneralRe: passing interfacepointers in dcom Pin
John M. Drescher27-May-03 6:00
John M. Drescher27-May-03 6:00 
Generaladdin, that comments code Pin
schaereran@gmx.net20-May-03 22:10
schaereran@gmx.net20-May-03 22:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.