#import

P

perspolis

Hi all
I want to use an Activex dll that has written with vb.
I use @import to imprt that..I don't have any errors at compile time..
but at run time I get an error..
How can I use a dll in my application..
I'm using and Win application without using MFC.
thanks in advance
 
W

William DePalo [MVP VC++]

perspolis said:
I want to use an Activex dll that has written with vb.
I use @import to imprt that..I don't have any errors at compile time..
but at run time I get an error..
How can I use a dll in my application..
I'm using and Win application without using MFC.
thanks in advance

The first step is to show a _short_ snippet of what you have tried and the
exact text of the error message you get when it fails.

Regards,
Will
 
P

Perspolis

#import "c:\\myExampledll.dll"


MyNameSpace.MyClassptr mc=new MyNameSpace.Myclassptr();

at this line when I new an instance of that class at run time I get 'com
error' message ..
 
W

William DePalo [MVP VC++]

Perspolis said:
MyNameSpace.MyClassptr mc=new MyNameSpace.Myclassptr();

Hmm. I don't claim to know much about COM, but I would have thought that
you'd create an object with CoCreateInstance() or by calling the
CreateInstanceMethod() of a smart pointer class.
at this line when I new an instance of that class at run time I get 'com
error' message ..

That's it? No text? Did you remember to initialize the COM library by
calling CoInitialize[Ex]()?

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top