ZaidGS
Mar 24th, 2004, 02:54 PM
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:
Dim x as classA 'class defined in vc++
Dim y as New classB 'this class also defined in vc++
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 :D :blush:
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:
Dim x as classA 'class defined in vc++
Dim y as New classB 'this class also defined in vc++
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 :D :blush: