VB COM MIGRATION TO ATL VC COM 
Author Message
 VB COM MIGRATION TO ATL VC COM

To Whom It May Concern:

My name is Scott, and I have a question

Let's say you create reference a COM object created in VB from an ASP
page.  This is how you would reference it:

dim oCOM
set oCOM = server.createobject("Car.Customer")
oCOM.GetCustHistory(request.querystring("CustAcctNo"))
for x = 1 to oCOM.Count
    response.write oCOM.CustNum(x).HistoryRepairs
next

' where
'Public Property Get CustNum(vntIndexKey As Variant) As HistoryRepairs
'    Set CustNum = mCol(vntIndexKey)
'End Property in the VB COM object
'History Repairs is a seperate public Class Module inside the Car.vbp
and Customer is the 'base class of this VBP COM project.  Count is a
property set on an ADO.RecordCount 'based on the DB that it is getting
it's information from.  GetCustHistory is a class method that 'gets Cust
History for EVERY Customer...and hence HistoryRepairs for EVERY
'CUSTOMER is retrieved from the FOR Loop.

QUESTION:  HOW WOULD COULD I CREATE THIS VB COM OBJECT THE SAME CODE
USING THE ATL COM OBJECT APP WIZARD IN Visual C++??
The furthest I got was creating a Get Property using the ATL VC++
Wizard...but I don't know how to call a class so that when i call this
object from a VB App or an ASP, I know that i can also do a
"oCOM.Item(x).HistoryRepairs" in ATL VC++ too.

Sincerely Yours,

Help In Despair



Tue, 28 Oct 2003 09:34:19 GMT  
 VB COM MIGRATION TO ATL VC COM
You're asking for a fair amount of code and 'hard to explain' points.

The best thing to do would be to look at either the CIRCCOLL ATL sample
which implements a collection ( although without much of an explanation ) or
buy a book on how to code ATL collections. A good example is given in
'Beginning ATL programming' by Wrox Press.


Quote:
> To Whom It May Concern:

> My name is Scott, and I have a question

> Let's say you create reference a COM object created in VB from an ASP
> page.  This is how you would reference it:

> dim oCOM
> set oCOM = server.createobject("Car.Customer")
> oCOM.GetCustHistory(request.querystring("CustAcctNo"))
> for x = 1 to oCOM.Count
>     response.write oCOM.CustNum(x).HistoryRepairs
> next

> ' where
> 'Public Property Get CustNum(vntIndexKey As Variant) As HistoryRepairs
> '    Set CustNum = mCol(vntIndexKey)
> 'End Property in the VB COM object
> 'History Repairs is a seperate public Class Module inside the Car.vbp
> and Customer is the 'base class of this VBP COM project.  Count is a
> property set on an ADO.RecordCount 'based on the DB that it is getting
> it's information from.  GetCustHistory is a class method that 'gets Cust
> History for EVERY Customer...and hence HistoryRepairs for EVERY
> 'CUSTOMER is retrieved from the FOR Loop.

> QUESTION:  HOW WOULD COULD I CREATE THIS VB COM OBJECT THE SAME CODE
> USING THE ATL COM OBJECT APP WIZARD IN VISUAL C++??
> The furthest I got was creating a Get Property using the ATL VC++
> Wizard...but I don't know how to call a class so that when i call this
> object from a VB App or an ASP, I know that i can also do a
> "oCOM.Item(x).HistoryRepairs" in ATL VC++ too.

> Sincerely Yours,

> Help In Despair



Tue, 28 Oct 2003 22:26:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ATL COM - Passing ATL COM classes through another ATL COM class in the same app

2. Connection points between a VB COM-based and ATL COM-based (NT Service) MTA

3. Problem with scripting context when using VB com object inside VC com object

4. problems passing ADO Recordset from VB-COM client to VC-COM-Server dll

5. Cant use VC ATL COM DLL method at VB project

6. VC ATL DLL crashin with VB COM client

7. what is the diffrence between Activex DLL in VB and ATL COM in VC

8. Accessing a collection from a VB com server in a VC/ATL Client

9. ATL COM object can't get arrays from VB in VB/VC6

10. ATL COM object can't get arrays from VB in VB/VC6

11. Problem calling VB COM dll from VC++ multithreaded COM EXE client

12. VC++ COM or VB COM - Which is better?

 

 
Powered by phpBB® Forum Software