how to use enumerated type in VB COM server from VC++ COM client?? 
Author Message
 how to use enumerated type in VB COM server from VC++ COM client??

Hello-

I have a VB COM server which I cannot change.  It defines an enumerated
type:

Public Enum eType
   Type96
   Type384
End Enum

and has a COM enabled function call:

Public Function Type(ByVal lType As eType) As String

I can't figure out how to call this function with the enumerated type.
Here's the typedef from the .idl file:

typedef [uuid(3E611DE4-C9E7-11D3-98A8-006008AC098B), version(1.0)]
    enum {
        Type96 = 0,
        Type384 = 1
    } eType;

Thanks for any pointers or tips.  Al



Fri, 05 Jul 2002 03:00:00 GMT  
 how to use enumerated type in VB COM server from VC++ COM client??
What IS the problem?

--
===============================
Alexander Nickolov
Microsoft MVP [VC], MCSD

===============================

Quote:

>Hello-

>I have a VB COM server which I cannot change.  It defines an enumerated
>type:

>Public Enum eType
>   Type96
>   Type384
>End Enum

>and has a COM enabled function call:

>Public Function Type(ByVal lType As eType) As String

>I can't figure out how to call this function with the enumerated type.
>Here's the typedef from the .idl file:

>typedef [uuid(3E611DE4-C9E7-11D3-98A8-006008AC098B), version(1.0)]
>    enum {
>        Type96 = 0,
>        Type384 = 1
>    } eType;

>Thanks for any pointers or tips.  Al



Fri, 05 Jul 2002 03:00:00 GMT  
 how to use enumerated type in VB COM server from VC++ COM client??
Hi Alexander-

I don't know how to use the enumerated type from C++.

I'm not very knowledgable on ATL, but I have this statement:

_clsMyServerPtr pCI( __uuidof(clsMyServer));

which then allows me to call functions like this:

pCI->MyFunction();

So, I have a function that takes a parameter of an enumerated type, and I
don't know how to pass that type in.

pCI->MyFunction(A_COM_enum_as_defined_in_VB);

How do I deal with the A_COM_enum_as_defined_in_VB piece?

Thanks for any help- even if it's just a tip.

Al


Quote:
> What IS the problem?

> --
> ===============================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> ===============================


> >Hello-

> >I have a VB COM server which I cannot change.  It defines an enumerated
> >type:

> >Public Enum eType
> >   Type96
> >   Type384
> >End Enum

> >and has a COM enabled function call:

> >Public Function Type(ByVal lType As eType) As String

> >I can't figure out how to call this function with the enumerated type.
> >Here's the typedef from the .idl file:

> >typedef [uuid(3E611DE4-C9E7-11D3-98A8-006008AC098B), version(1.0)]
> >    enum {
> >        Type96 = 0,
> >        Type384 = 1
> >    } eType;

> >Thanks for any pointers or tips.  Al



Fri, 05 Jul 2002 03:00:00 GMT  
 how to use enumerated type in VB COM server from VC++ COM client??
Isn't it defined in the generated .TLH file? I'd assume so, because it
is in the type library... (The .TLH file is in your intermediate files
directory, for example .\Debug.)

--
===============================
Alexander Nickolov
Microsoft MVP [VC], MCSD

===============================

Quote:

>Hi Alexander-

>I don't know how to use the enumerated type from C++.

>I'm not very knowledgable on ATL, but I have this statement:

>_clsMyServerPtr pCI( __uuidof(clsMyServer));

>which then allows me to call functions like this:

>pCI->MyFunction();

>So, I have a function that takes a parameter of an enumerated type, and I
>don't know how to pass that type in.

>pCI->MyFunction(A_COM_enum_as_defined_in_VB);

>How do I deal with the A_COM_enum_as_defined_in_VB piece?

>Thanks for any help- even if it's just a tip.

>Al



>> What IS the problem?

>> --
>> ===============================
>> Alexander Nickolov
>> Microsoft MVP [VC], MCSD

>> ===============================


>> >Hello-

>> >I have a VB COM server which I cannot change.  It defines an enumerated
>> >type:

>> >Public Enum eType
>> >   Type96
>> >   Type384
>> >End Enum

>> >and has a COM enabled function call:

>> >Public Function Type(ByVal lType As eType) As String

>> >I can't figure out how to call this function with the enumerated type.
>> >Here's the typedef from the .idl file:

>> >typedef [uuid(3E611DE4-C9E7-11D3-98A8-006008AC098B), version(1.0)]
>> >    enum {
>> >        Type96 = 0,
>> >        Type384 = 1
>> >    } eType;

>> >Thanks for any pointers or tips.  Al



Fri, 05 Jul 2002 03:00:00 GMT  
 how to use enumerated type in VB COM server from VC++ COM client??
Argh, what an idiot I am!  You are correct of course.  I didn't realize the
enumerated type was already defined.  I just had to do a
pCI->MyFunction(MyEnum).

I'm learning...

Al


Quote:
> Isn't it defined in the generated .TLH file? I'd assume so, because it
> is in the type library... (The .TLH file is in your intermediate files
> directory, for example .\Debug.)

> --
> ===============================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> ===============================


> >Hi Alexander-

> >I don't know how to use the enumerated type from C++.

> >I'm not very knowledgable on ATL, but I have this statement:

> >_clsMyServerPtr pCI( __uuidof(clsMyServer));

> >which then allows me to call functions like this:

> >pCI->MyFunction();

> >So, I have a function that takes a parameter of an enumerated type, and I
> >don't know how to pass that type in.

> >pCI->MyFunction(A_COM_enum_as_defined_in_VB);

> >How do I deal with the A_COM_enum_as_defined_in_VB piece?

> >Thanks for any help- even if it's just a tip.

> >Al



> >> What IS the problem?

> >> --
> >> ===============================
> >> Alexander Nickolov
> >> Microsoft MVP [VC], MCSD

> >> ===============================


> >> >Hello-

> >> >I have a VB COM server which I cannot change.  It defines an
enumerated
> >> >type:

> >> >Public Enum eType
> >> >   Type96
> >> >   Type384
> >> >End Enum

> >> >and has a COM enabled function call:

> >> >Public Function Type(ByVal lType As eType) As String

> >> >I can't figure out how to call this function with the enumerated type.
> >> >Here's the typedef from the .idl file:

> >> >typedef [uuid(3E611DE4-C9E7-11D3-98A8-006008AC098B), version(1.0)]
> >> >    enum {
> >> >        Type96 = 0,
> >> >        Type384 = 1
> >> >    } eType;

> >> >Thanks for any pointers or tips.  Al



Fri, 05 Jul 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. URGENT!!!Accessing VC++ 6 COM server from a VB6 client

2. COM Interfaces, VB6 COM Servers, Automation Clients

3. Enumerated Types and COM DLL's with VB

4. How do I debug a VB COM Server from VC++

5. VC-COM from VB/VC/Script

6. Using VB Com objects from VC++

7. EASY Way to Pass SAFEARRAY from VC to VB using COM

8. passing byte stream to/from COM server and DLL vs EXE COM server

9. MFC client access a VB COM Server with SAFEARRAY argument

10. a major problem: vb client of a c++ dll com server

11. VB client of C++ DLL COM server

12. Passing structures from C++ app to a VB client app through Network connection using COM

 

 
Powered by phpBB® Forum Software