Click here to Skip to main content
16,006,605 members
Home / Discussions / COM
   

COM

 
GeneralRe: Reminders in Outlook Pin
SHaroz19-Jun-02 5:35
SHaroz19-Jun-02 5:35 
GeneralHelp! Word Document Pin
13-Jun-02 3:42
suss13-Jun-02 3:42 
GeneralRe: Help! Word Document Pin
SHaroz13-Jun-02 6:03
SHaroz13-Jun-02 6:03 
GeneralRe: Help! Word Document Pin
13-Jun-02 7:52
suss13-Jun-02 7:52 
GeneralRe: Help! Word Document Pin
SHaroz13-Jun-02 8:00
SHaroz13-Jun-02 8:00 
GeneralMust learn COM... Pin
Tym!12-Jun-02 7:02
Tym!12-Jun-02 7:02 
GeneralRe: Must learn COM... Pin
Michael Dunn12-Jun-02 7:10
sitebuilderMichael Dunn12-Jun-02 7:10 
QuestionCOM+ object loses state, why? Pin
MrGlover11-Jun-02 19:36
MrGlover11-Jun-02 19:36 
Problem:

I have a COM+ business logic object which seems to lose state for no aparent reason. But when I debug it in VB it works fine. ?!?!?!

Baskground:

My BL object has a method which returns a reference to itself. (Why? Short-story: I was returning an ADO Recordset, but then (for reasons beyond this article) I didn't want EOF to return True when the Recordset was at EOF.) So my BL object implements some of the ADO interface and passes calls to the underlying recordset which is now stored in a private variable; except the EOF property which does it's own thing.

Gotcha:

After calling the method from ASP/VBScript I get an object back alright, but the object has lost state. Here is sample code of the object being used:

<%
...
Dim oOrders, adorsOrders
Set oOrders = Server.CreateObject("BusinessLogicLayer.OrderHistory")
Set adorsOrders = oOrders.ListByPage(sCustomerID, lPageNo, lPageSize)

Do Until adorsOrders.EOF
...
Loop
...
%>

The line "Do Until..." biffs an error saying that the object was not set. At this point adorsOrders and oOrders are actually the same object because ListByPage returns Me. Furthur examination reveals that all of the object's internal variables have been initialized right after the method completes; even though the object shouldn't get garbaged till the bottom of the page.

Now the oddest thing is that if I set a public string variable on object creation and then call a different method I can still access that variable and it contains "HelloWorld" as expected. But if I access it after calling this method which returns it's own reference then the string variable has now been reinitialised.

Oh, did I mention that the object works fine if I debug it in VB?

Any help leading to a fast solution out of this mess will earn you naming rights on my first born.

Poke tongue | ;-P
AnswerRe: COM+ object loses state, why? Pin
soptest12-Jun-02 8:22
soptest12-Jun-02 8:22 
GeneralRe: COM+ object loses state, why? Pin
MrGlover13-Jun-02 11:46
MrGlover13-Jun-02 11:46 
GeneralRe: COM+ object loses state, why? Pin
soptest13-Jun-02 13:37
soptest13-Jun-02 13:37 
GeneralRe: COM+ object loses state, why? Pin
MrGlover13-Jun-02 14:42
MrGlover13-Jun-02 14:42 
GeneralRe: COM+ object loses state, why? Pin
Wictor Wilén14-Jun-02 4:43
Wictor Wilén14-Jun-02 4:43 
GeneralRe: COM+ object loses state, why? Pin
MrGlover16-Jun-02 14:09
MrGlover16-Jun-02 14:09 
GeneralRe: COM+ object loses state, why? Pin
Wictor Wilén16-Jun-02 20:51
Wictor Wilén16-Jun-02 20:51 
QuestionCan I insert a dialog(derived from CDialog) in COM DLL? Pin
Sun666611-Jun-02 7:45
Sun666611-Jun-02 7:45 
AnswerRe: Can I insert a dialog(derived from CDialog) in COM DLL? Pin
Mazdak11-Jun-02 8:31
Mazdak11-Jun-02 8:31 
AnswerRe: Can I insert a dialog(derived from CDialog) in COM DLL? Pin
Mazdak11-Jun-02 9:16
Mazdak11-Jun-02 9:16 
GeneralRe: Can I insert a dialog(derived from CDialog) in COM DLL? Pin
Sun666611-Jun-02 10:20
Sun666611-Jun-02 10:20 
QuestionHow to pass Date/Time values in COM Pin
ssirisha11-Jun-02 5:33
ssirisha11-Jun-02 5:33 
AnswerRe: How to pass Date/Time values in COM Pin
Rama Krishna Vavilala11-Jun-02 9:20
Rama Krishna Vavilala11-Jun-02 9:20 
AnswerRe: How to pass Date/Time values in COM Pin
Mazdak11-Jun-02 9:19
Mazdak11-Jun-02 9:19 
GeneralNetworking question Pin
rsasalm_10-Jun-02 20:46
rsasalm_10-Jun-02 20:46 
GeneralRe: Networking question Pin
MikeC#11-Jun-02 2:32
MikeC#11-Jun-02 2:32 
GeneralRe: Networking question Pin
11-Jun-02 2:51
suss11-Jun-02 2:51 

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.