Results 1 to 12 of 12

Thread: ATL COM troublesome

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    170

    ATL COM troublesome

    my objective is to interface some class,
    as a dll made using vc++, for use in vb.

    but i'm having a lot of trouble.

    i use the ATL COM appWizard. (i use defaults
    .ie. MFC not supported)

    here are my two biggest problems so far:
    (1) [UNRESOLVED]
    after i define classA, and add methodes
    and properties to the IclassA,
    i want in vb pass it (either by reference or
    value, whatever works)
    like this:

    VB Code:
    1. Dim x as classA                    'class defined in vc++
    2. Dim y as New classB            'this class also defined in vc++
    3. y.SomeFunction x, "hi", 3     'one parameter is classA

    how could i define SomeFunction so that it
    accepts that class as parameter.

    (2) [RESOLVED]
    my other problem is that,
    one function that i have,
    needs to accept a string.
    i used LPSTR, as type
    for that parameter.
    each time i call that fuction, the program gives
    a message box saying:
    "runtime error - automation error -
    the object invoked has disconected from its client"
    and then quits.
    i tried using char*, and CString, didnot work either (those didnot
    even compile with me).

    what could be wrong ?!?!

    i use this ATL COM wizard without fully
    understanding what code it writes, and to
    some extent i find it impossible (well, caused me a lot of unfixable bugs) to
    manually modify the code.
    thats why each time i want to make a change to my
    interface (like removing some function, or property
    or change types of parameters)
    i have to start all-over.
    (nah, im not that stupid, i have functional C++
    versions seperately, the COM just uses them)

    could anyone help me in any way.

    thanks for bothering to answer
    Last edited by ZaidGS; Mar 26th, 2004 at 06:59 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width