calling eVC COM DLL from eVB app

calling eVC COM DLL from eVB app

Post by Arch » Sun, 26 Jan 2003 19:33:46



Hello,

I have one COM dll which is created in eVC. And I have added the ref in eVB
app of the same dl., also I am creating object of that dll in my eVB app.
The code is as following

          Set obj = CreateObject("AppDCompressor.IDCompressor").

where AppDCompressor is the dll name and IDCompressor is the interface.

But while running the eVB app  I got error "Activex component can not create
objet."

can any one help ?

Regards
-Archi

 
 
 

calling eVC COM DLL from eVB app

Post by Chris Tacke, eMV » Mon, 27 Jan 2003 00:08:28


And the DLL is definitely registered on the device?

Check the eVC IDL and make sure it doesn't say
"AppDCompressor.IDCompressorLib" which the ATL wizard adds for whatever
reason.

-Chris


Quote:> Hello,

> I have one COM dll which is created in eVC. And I have added the ref in
eVB
> app of the same dl., also I am creating object of that dll in my eVB app.
> The code is as following

>           Set obj = CreateObject("AppDCompressor.IDCompressor").

> where AppDCompressor is the dll name and IDCompressor is the interface.

> But while running the eVB app  I got error "Activex component can not
create
> objet."

> can any one help ?

> Regards
> -Archi


 
 
 

calling eVC COM DLL from eVB app

Post by Anjal » Tue, 28 Jan 2003 20:19:49


Hi,
 thanx for replying the mail so soon..
   The same prob I am facing too..
 I have built the eVC component and while building only I get the message
"successfully registered the ...dll". So Is it necessary to register the
component again from regsvr..?
  If no , then how should I proceed..?

Regards
 anj

 
 
 

calling eVC COM DLL from eVB app

Post by Anjal » Tue, 28 Jan 2003 20:20:51


Hi,

I am sending u the .idl file . Can you plz tell me if anything is wrong in
this?

the file as follows:-

// AppDCompressor.idl : IDL source for AppDCompressor.dll

//

// This file will be processed by the MIDL tool to

// produce the type library (AppDCompressor.tlb) and marshalling code.

import "oaidl.idl";

import "ocidl.idl";

[

object,

uuid(E2192277-8FE6-46B1-9372-65693AD4ECC0),

dual,

helpstring("IDCompressor Interface"),

pointer_default(unique)

]

interface IDCompressor : IDispatch

{

[id(1), helpstring("method Encoder")] HRESULT Encoder(VARIANT
*pvstrWavFileName,VARIANT *pvstrFileData);

Quote:};

[

uuid(0C629BC0-8A6C-4E30-B02A-00514747EE18),

version(1.0),

helpstring("AppDCompressor 1.0 Type Library")

]

library APPDCOMPRESSORLib

{

importlib("stdole32.tlb");

importlib("stdole2.tlb");

[

uuid(B170947E-2035-4F6B-A5FD-38BFA43863DF),

helpstring("DCompressor Class")

]

coclass DCompressor

{

[default] interface IDCompressor;

Quote:};
};

thanx and Regards

anj

 
 
 

calling eVC COM DLL from eVB app

Post by Thomas Tra » Tue, 28 Jan 2003 23:24:07


I think, it should be :

Set obj = CreateObject("AppDCompressor.DCompressor").


Quote:> Hello,

> I have one COM dll which is created in eVC. And I have added the ref in
eVB
> app of the same dl., also I am creating object of that dll in my eVB app.
> The code is as following

>           Set obj = CreateObject("AppDCompressor.IDCompressor").

> where AppDCompressor is the dll name and IDCompressor is the interface.

> But while running the eVB app  I got error "Activex component can not
create
> objet."

> can any one help ?

> Regards
> -Archi

 
 
 

calling eVC COM DLL from eVB app

Post by Chris Tacke, eMV » Tue, 28 Jan 2003 23:55:26


Yep, it's right there in the IDL.  If you look, the Wizard defined the
library like this:

library APPDCOMPRESSORLib

So unless you modify the IDL, you'll need to call it like this:

Set obj = CreateObject("APPDCOMPRESSORLib.DCompressor").

Also note I removed the "I" from the class name because you're calling the
coclass, not the interface.

--
Chris Tacke, eMVP
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Quote:> Hi,

> I am sending u the .idl file . Can you plz tell me if anything is wrong in
> this?

> the file as follows:-

> // AppDCompressor.idl : IDL source for AppDCompressor.dll

> //

> // This file will be processed by the MIDL tool to

> // produce the type library (AppDCompressor.tlb) and marshalling code.

> import "oaidl.idl";

> import "ocidl.idl";

> [

> object,

> uuid(E2192277-8FE6-46B1-9372-65693AD4ECC0),

> dual,

> helpstring("IDCompressor Interface"),

> pointer_default(unique)

> ]

> interface IDCompressor : IDispatch

> {

> [id(1), helpstring("method Encoder")] HRESULT Encoder(VARIANT
> *pvstrWavFileName,VARIANT *pvstrFileData);

> };

> [

> uuid(0C629BC0-8A6C-4E30-B02A-00514747EE18),

> version(1.0),

> helpstring("AppDCompressor 1.0 Type Library")

> ]

> library APPDCOMPRESSORLib

> {

> importlib("stdole32.tlb");

> importlib("stdole2.tlb");

> [

> uuid(B170947E-2035-4F6B-A5FD-38BFA43863DF),

> helpstring("DCompressor Class")

> ]

> coclass DCompressor

> {

> [default] interface IDCompressor;

> };

> };

> thanx and Regards

> anj

 
 
 

calling eVC COM DLL from eVB app

Post by Anjal » Wed, 29 Jan 2003 20:59:36


Hi,
 this is my eVB code froom where I am calling the eVC compoent :-

Option Explicit
Private Sub Form_Load()
    TestingDLL
End Sub

Private Sub TestingDLL()

   On Error Resume Next

   Dim obj As DECOMPRESSORLib.Compressor 'As APPDCOMPRESSORLib.DCompressor
   Dim vstrCompress As Variant
   Dim vstrCompressed As Variant
   Err = 0

     'MsgBox "In application : In testing dll "
    Set obj = CreateObject("DECOMPRESSORLib.Compressor")
    obj.DeCompress vstrCompressed, vstrCompress

    If Err.Number <> -2147319765 Then
        Err.Description
        Err.Number
    Else
        MsgBox "Successful"
    End If

End Sub

Still it gives error "Object required"
Can you plz guide me ?
anj

 
 
 

calling eVC COM DLL from eVB app

Post by Chris Tacke, eMV » Thu, 30 Jan 2003 01:17:24


You've still not got it right.  You have:

Set obj = CreateObject("DECOMPRESSORLib.Compressor")

It should be:

Set obj = CreateObject("DECOMPRESSORLib.DCompressor")

--
Chris Tacke, eMVP
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Quote:> Hi,
>  this is my eVB code froom where I am calling the eVC compoent :-

> Option Explicit
> Private Sub Form_Load()
>     TestingDLL
> End Sub

> Private Sub TestingDLL()

>    On Error Resume Next

>    Dim obj As DECOMPRESSORLib.Compressor 'As APPDCOMPRESSORLib.DCompressor
>    Dim vstrCompress As Variant
>    Dim vstrCompressed As Variant
>    Err = 0

>      'MsgBox "In application : In testing dll "
>     Set obj = CreateObject("DECOMPRESSORLib.Compressor")
>     obj.DeCompress vstrCompressed, vstrCompress

>     If Err.Number <> -2147319765 Then
>         Err.Description
>         Err.Number
>     Else
>         MsgBox "Successful"
>     End If

> End Sub

> Still it gives error "Object required"
> Can you plz guide me ?
> anj

 
 
 

calling eVC COM DLL from eVB app

Post by Chris Tacke, eMV » Thu, 30 Jan 2003 12:12:58


Check the registry to make sure it's registered and that these are in fact
the right library and class names.


Quote:> Hi,

> I have done the same thing..Only the thing is Yesterday I changed the name
> of my Class .hence the name was different..
>     Set obj = CreateObject("DECOMPRESSORLib.DCompressor")

>   But Still there is problem.. Now what should I do ?

> Anj

 
 
 

calling eVC COM DLL from eVB app

Post by Anjal » Thu, 30 Jan 2003 12:22:01


Hi,

I have done the same thing..Only the thing is Yesterday I changed the name
of my Class .hence the name was different..
    Set obj = CreateObject("DECOMPRESSORLib.DCompressor")

  But Still there is problem.. Now what should I do ?

Anj

 
 
 

calling eVC COM DLL from eVB app

Post by Thomas Tra » Sun, 02 Feb 2003 04:41:22


hum,

Remove the lib from the line:

Set obj = CreateObject("DECOMPRESSOR.Compressor")
NOT
Set obj = CreateObject("DECOMPRESSORLib.Compressor")

If DECOMPRESSOR is your eVC project name, and Compressor is CoClass name,
not the Interface.

Please read response before reposting


Quote:> Hi,
>  this is my eVB code froom where I am calling the eVC compoent :-

> Option Explicit
> Private Sub Form_Load()
>     TestingDLL
> End Sub

> Private Sub TestingDLL()

>    On Error Resume Next

>    Dim obj As DECOMPRESSORLib.Compressor 'As APPDCOMPRESSORLib.DCompressor
>    Dim vstrCompress As Variant
>    Dim vstrCompressed As Variant
>    Err = 0

>      'MsgBox "In application : In testing dll "
>     Set obj = CreateObject("DECOMPRESSORLib.Compressor")
>     obj.DeCompress vstrCompressed, vstrCompress

>     If Err.Number <> -2147319765 Then
>         Err.Description
>         Err.Number
>     Else
>         MsgBox "Successful"
>     End If

> End Sub

> Still it gives error "Object required"
> Can you plz guide me ?
> anj

 
 
 

calling eVC COM DLL from eVB app

Post by Chris Tacke, eMV » Sun, 02 Feb 2003 05:47:44


But based on the IDL previously posted it should be APPDCOMPRESSORLib

the IDL was:

library APPDCOMPRESSORLib
{
...

--
Chris Tacke, eMVP
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


> hum,

> Remove the lib from the line:

> Set obj = CreateObject("DECOMPRESSOR.Compressor")
> NOT
> Set obj = CreateObject("DECOMPRESSORLib.Compressor")

> If DECOMPRESSOR is your eVC project name, and Compressor is CoClass name,
> not the Interface.

> Please read response before reposting



> > Hi,
> >  this is my eVB code froom where I am calling the eVC compoent :-

> > Option Explicit
> > Private Sub Form_Load()
> >     TestingDLL
> > End Sub

> > Private Sub TestingDLL()

> >    On Error Resume Next

> >    Dim obj As DECOMPRESSORLib.Compressor 'As

APPDCOMPRESSORLib.DCompressor

- Show quoted text -

Quote:> >    Dim vstrCompress As Variant
> >    Dim vstrCompressed As Variant
> >    Err = 0

> >      'MsgBox "In application : In testing dll "
> >     Set obj = CreateObject("DECOMPRESSORLib.Compressor")
> >     obj.DeCompress vstrCompressed, vstrCompress

> >     If Err.Number <> -2147319765 Then
> >         Err.Description
> >         Err.Number
> >     Else
> >         MsgBox "Successful"
> >     End If

> > End Sub

> > Still it gives error "Object required"
> > Can you plz guide me ?
> > anj

 
 
 

calling eVC COM DLL from eVB app

Post by Tran Min » Tue, 04 Feb 2003 13:15:10


Create a small ATL project with eVC and try it yourself to see if it works.



> But based on the IDL previously posted it should be APPDCOMPRESSORLib

> the IDL was:

> library APPDCOMPRESSORLib
> {
> ...

> --
> Chris Tacke, eMVP
> Windows CE Product Manager
> Applied Data Systems
> www.applieddata.net



> > hum,

> > Remove the lib from the line:

> > Set obj = CreateObject("DECOMPRESSOR.Compressor")
> > NOT
> > Set obj = CreateObject("DECOMPRESSORLib.Compressor")

> > If DECOMPRESSOR is your eVC project name, and Compressor is CoClass
name,
> > not the Interface.

> > Please read response before reposting



> > > Hi,
> > >  this is my eVB code froom where I am calling the eVC compoent :-

> > > Option Explicit
> > > Private Sub Form_Load()
> > >     TestingDLL
> > > End Sub

> > > Private Sub TestingDLL()

> > >    On Error Resume Next

> > >    Dim obj As DECOMPRESSORLib.Compressor 'As
> APPDCOMPRESSORLib.DCompressor
> > >    Dim vstrCompress As Variant
> > >    Dim vstrCompressed As Variant
> > >    Err = 0

> > >      'MsgBox "In application : In testing dll "
> > >     Set obj = CreateObject("DECOMPRESSORLib.Compressor")
> > >     obj.DeCompress vstrCompressed, vstrCompress

> > >     If Err.Number <> -2147319765 Then
> > >         Err.Description
> > >         Err.Number
> > >     Else
> > >         MsgBox "Successful"
> > >     End If

> > > End Sub

> > > Still it gives error "Object required"
> > > Can you plz guide me ?
> > > anj

 
 
 

calling eVC COM DLL from eVB app

Post by Chris Tacke, eMV » Tue, 04 Feb 2003 14:06:44


I don't need to.  I've done plenty of COM programming and pulled my hair out
over teh Wizard's inclusin on the Lib suffix.  There are a few places he can
get the CLSID he needs to be using - I suggest either the registry or the
IDL.  Beyond that, there's not much else help we can provide.  If the
object's IDL CLSID matches that in the device registry, then there's
absolutely no reason it won't work.

-Chris


> Create a small ATL project with eVC and try it yourself to see if it
works.



> > But based on the IDL previously posted it should be APPDCOMPRESSORLib

> > the IDL was:

> > library APPDCOMPRESSORLib
> > {
> > ...

> > --
> > Chris Tacke, eMVP
> > Windows CE Product Manager
> > Applied Data Systems
> > www.applieddata.net



> > > hum,

> > > Remove the lib from the line:

> > > Set obj = CreateObject("DECOMPRESSOR.Compressor")
> > > NOT
> > > Set obj = CreateObject("DECOMPRESSORLib.Compressor")

> > > If DECOMPRESSOR is your eVC project name, and Compressor is CoClass
> name,
> > > not the Interface.

> > > Please read response before reposting



> > > > Hi,
> > > >  this is my eVB code froom where I am calling the eVC compoent :-

> > > > Option Explicit
> > > > Private Sub Form_Load()
> > > >     TestingDLL
> > > > End Sub

> > > > Private Sub TestingDLL()

> > > >    On Error Resume Next

> > > >    Dim obj As DECOMPRESSORLib.Compressor 'As
> > APPDCOMPRESSORLib.DCompressor
> > > >    Dim vstrCompress As Variant
> > > >    Dim vstrCompressed As Variant
> > > >    Err = 0

> > > >      'MsgBox "In application : In testing dll "
> > > >     Set obj = CreateObject("DECOMPRESSORLib.Compressor")
> > > >     obj.DeCompress vstrCompressed, vstrCompress

> > > >     If Err.Number <> -2147319765 Then
> > > >         Err.Description
> > > >         Err.Number
> > > >     Else
> > > >         MsgBox "Successful"
> > > >     End If

> > > > End Sub

> > > > Still it gives error "Object required"
> > > > Can you plz guide me ?
> > > > anj

 
 
 

calling eVC COM DLL from eVB app

Post by Thomas Tra » Tue, 04 Feb 2003 23:57:06


Based on previous IDL file,
.....
library APPDCOMPRESSORLib

coclass DCompressor

[default] interface IDCompressor;

............
you can declare
Dim myObj as  AppDCompressorLIB.DCompressor
Set myObj = CreateObject("AppDCompressor.DCompressor")
but not
Set myObj = CreateObject("AppDCompressorLib.DCompressor")

I know that you know well COM and IDL stuffs, but with eVC your solution
doesn't work. Can you provide a small working example with CreateObject like
that :
Set myObj = CreateObject("AppDCompressorLib.DCompressor") ?

I have done some ATL Component for PocketPC but I'm never able to use this
syntaxe with the LIB suffix. I have juste redone the test on my machine here
before
posting this message. I also have used Remote Registry Editor to check the
registry of
Emulator after compiling the COM, can not find any entry (ProgID like :
AppDCompressorLib.DCompressor)

Regards



> I don't need to.  I've done plenty of COM programming and pulled my hair
out
> over teh Wizard's inclusin on the Lib suffix.  There are a few places he
can
> get the CLSID he needs to be using - I suggest either the registry or the
> IDL.  Beyond that, there's not much else help we can provide.  If the
> object's IDL CLSID matches that in the device registry, then there's
> absolutely no reason it won't work.

> -Chris



> > Create a small ATL project with eVC and try it yourself to see if it
> works.



> > > But based on the IDL previously posted it should be APPDCOMPRESSORLib

> > > the IDL was:

> > > library APPDCOMPRESSORLib
> > > {
> > > ...

> > > --
> > > Chris Tacke, eMVP
> > > Windows CE Product Manager
> > > Applied Data Systems
> > > www.applieddata.net



> > > > hum,

> > > > Remove the lib from the line:

> > > > Set obj = CreateObject("DECOMPRESSOR.Compressor")
> > > > NOT
> > > > Set obj = CreateObject("DECOMPRESSORLib.Compressor")

> > > > If DECOMPRESSOR is your eVC project name, and Compressor is CoClass
> > name,
> > > > not the Interface.

> > > > Please read response before reposting



> > > > > Hi,
> > > > >  this is my eVB code froom where I am calling the eVC compoent :-

> > > > > Option Explicit
> > > > > Private Sub Form_Load()
> > > > >     TestingDLL
> > > > > End Sub

> > > > > Private Sub TestingDLL()

> > > > >    On Error Resume Next

> > > > >    Dim obj As DECOMPRESSORLib.Compressor 'As
> > > APPDCOMPRESSORLib.DCompressor
> > > > >    Dim vstrCompress As Variant
> > > > >    Dim vstrCompressed As Variant
> > > > >    Err = 0

> > > > >      'MsgBox "In application : In testing dll "
> > > > >     Set obj = CreateObject("DECOMPRESSORLib.Compressor")
> > > > >     obj.DeCompress vstrCompressed, vstrCompress

> > > > >     If Err.Number <> -2147319765 Then
> > > > >         Err.Description
> > > > >         Err.Number
> > > > >     Else
> > > > >         MsgBox "Successful"
> > > > >     End If

> > > > > End Sub

> > > > > Still it gives error "Object required"
> > > > > Can you plz guide me ?
> > > > > anj

 
 
 

1. Calling eVC COM dll from eVB Application

Hi,
       I have one COM dll which is created in eVC. And I have added the ref
in eVB
app of the same dll., also I am creating object of that dll in my eVB app.
The code is as following

          Set obj = CreateObject("AppDCompressor.IDCompressor").

where AppDCompressor is the dll name and IDCompressor is the interface.

But while running the eVB app  I got error "Activex component can not create
objet."

can any one help me in finding the solution?

anj

2. v4 Updater fails on W2K machines

3. NewB Q: Calls to eVC++ DLL from eVB app

4. Questions of filters

5. Calling eVC DLL from eVB App ??

6. A & B floppies will not w

7. COM error: eVB calling eVC object give type mismatch

8. fax console and aol conflict

9. Can't get functions from an eVC driver to be called from eVB app

10. Help-- Problem with Sharing data betweeb a eVC++ COM and a eVB app

11. Calling eVC DLL from eVB....Its driving me mad ;-(

12. Calling eVC++ DLL from within eVB

13. Using BSTR in normal eVC dll and calling from eVB