Click here to Skip to main content
15,901,373 members
Home / Discussions / COM
   

COM

 
Generalhelp needed...!!! Pin
drmzunlimited5-Aug-02 7:43
drmzunlimited5-Aug-02 7:43 
QuestionConnect to external InProc Server ? Pin
Mark Janveaux4-Aug-02 20:45
Mark Janveaux4-Aug-02 20:45 
AnswerRe: Connect to external InProc Server ? Pin
Jawid7-Aug-02 5:32
Jawid7-Aug-02 5:32 
AnswerRe: Another way - ROT Pin
Vi27-Aug-02 6:04
Vi27-Aug-02 6:04 
GeneralReceive events in vb from an interface returned by a method Pin
farrukh khalil4-Aug-02 19:19
sussfarrukh khalil4-Aug-02 19:19 
GeneralRe: Receive events in vb from an interface returned by a method Pin
Vi24-Aug-02 20:16
Vi24-Aug-02 20:16 
GeneralComAddin and addin Pin
Gheyret4-Aug-02 18:53
Gheyret4-Aug-02 18:53 
QuestionATL Problems?? Pin
Leesen3-Aug-02 22:56
Leesen3-Aug-02 22:56 
Hi, all

Some problems about ATL Com:

1.I have create two ATL Object: CStudent and CTeacher .
The simple source code listed as follow: (some code auto generated by ATL have been skiped)

class CStudent
{
private:
long m_age;
public:
CStudent():m_age(10)
{
}
//...other code auto generated by ATL
};

class CTeacher
{
private:
IStudent* m_aStudent;
public:
CTeacher()
{
//create an instance of the com
CoCreateInstance(CLSID_Student,NULL,CLSCTX_ALL,IID_IStudent, (void**)&m_aStudent);
}
//...other code auto generated by ATL
}

2.Then I add a "IStudent * OneStudent" property for ITeacher ,to access the m_aStudent.
The implemention of the property are listed as below:

STDMETHODIMP CTeacher::get_OneStudent(IStudent *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())

// TODO: Add your implementation code here
*pVal = * m_aStudent;
return S_OK;
}


STDMETHODIMP CTeacher::put_OneStudent(IStudent *newVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())

// TODO: Add your implementation code here
*m_aStudent = *newVal ;
return S_OK;
}

3.Now I type some VB code to test the com ,but some compiler errors occurrs.
VB Code:
Dim s As Student
Dim t As New Teacher
s = t.OneStudent
the last sentence "s = t.OneStudent" have compiler errors.
Errors:function or interface marked as restricted ,or the function use an Automation type not supported in Visual Basic

I guess the errors caused by the type dismatch between IStudnet and CStudent.But I did not know how to resolve it .
So who can tell me how to return the m_aStudent that can be supproted in vb??

thx.

Regards.
AnswerRe: ATL Problems?? Pin
Vi24-Aug-02 20:12
Vi24-Aug-02 20:12 
QuestionHow to get CLSID for the underlying object. Pin
cagey2-Aug-02 10:04
cagey2-Aug-02 10:04 
AnswerRe: How to get CLSID for the underlying object. Pin
soptest2-Aug-02 13:17
soptest2-Aug-02 13:17 
GeneralRe: How to get CLSID for the underlying object. Pin
Gertjan Schuurmans4-Aug-02 2:55
Gertjan Schuurmans4-Aug-02 2:55 
GeneralCOM+ Remote Transient Event Subscription Pin
d2hilst2-Aug-02 3:56
d2hilst2-Aug-02 3:56 
QuestionImplemented QueryStatus... but I get idl errors? Pin
Tommy Svensson2-Aug-02 0:23
Tommy Svensson2-Aug-02 0:23 
AnswerRe: Implemented QueryStatus... but I get idl errors? Pin
Vi22-Aug-02 1:22
Vi22-Aug-02 1:22 
GeneralCreating a Typelib Pin
Brigg Thorp1-Aug-02 7:13
Brigg Thorp1-Aug-02 7:13 
GeneralRe: Creating a Typelib Pin
Vi21-Aug-02 19:31
Vi21-Aug-02 19:31 
GeneralWeb Services Implementation Guide Pin
Stanford Powers31-Jul-02 18:36
sussStanford Powers31-Jul-02 18:36 
General! SPAM ! Pin
soptest1-Aug-02 7:01
soptest1-Aug-02 7:01 
QuestionNow why doesn't this COMPILE!?!?!? Pin
Tommy Svensson31-Jul-02 6:42
Tommy Svensson31-Jul-02 6:42 
AnswerRe: Now why doesn't this COMPILE!?!?!? Pin
soptest31-Jul-02 9:07
soptest31-Jul-02 9:07 
GeneralNeed a starting point Pin
yeeeooowww31-Jul-02 6:18
yeeeooowww31-Jul-02 6:18 
GeneralIDispatch:Invoke - Runtime Access Violation error when accessing DISPARARAM &dp Pin
tm31-Jul-02 5:34
tm31-Jul-02 5:34 
GeneralRe: IDispatch:Invoke - Runtime Access Violation error when accessing DISPARARAM &dp Pin
Lily1831-Jul-02 6:14
Lily1831-Jul-02 6:14 
GeneralRe: IDispatch:Invoke - Runtime Access Violation error when accessing DISPARARAM &dp Pin
tm31-Jul-02 7:35
tm31-Jul-02 7:35 

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.