944,008 Members | Top Members by Rank

Ad:
Oct 11th, 2007
0

How To create an instance of a Class in Visual Basic

Expand Post »
HI

I want to create an Instance of Class(Object) In Visual Basic.Using "Create Object " Syntax. please refer attached CPP & header File for the class COMOutput. How can i create an object for this COMOutput Class in Visual Basic. And I need to access the Functions Defined in The COMOutput.Cpp. PLease Help me.Thanks

Augustin
Attached Files
File Type: cpp COMOutput.cpp (756 Bytes, 62 views)
File Type: h COMOutput.h (1.2 KB, 25 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Augustin is offline Offline
6 posts
since Sep 2007
Oct 11th, 2007
0

Re: How To create an instance of a Class in Visual Basic

You need to compile this cpp class as a .DLL and then refer this dll in your VB propject.

You are good to go.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Oct 11th, 2007
0

Re: How To create an instance of a Class in Visual Basic

Create a dll file using VC++ Win32 Dynamic-Link Library Project type.
Compile the dll and register it in system32.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Oct 12th, 2007
0

Re: How To create an instance of a Class in Visual Basic

Hi Binoj

I have tried to create a DLL with the C++ & the Header file. But i got Errors While Creating . As i have No idea on What Header Files to be included for the Errors. Can u help me on that
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Augustin is offline Offline
6 posts
since Sep 2007
Oct 12th, 2007
0

Re: How To create an instance of a Class in Visual Basic

.CPP and .H files can't be directly referenced fronm VB. compile to .DLL file and then instanceate in VB.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Oct 12th, 2007
0

Re: How To create an instance of a Class in Visual Basic

HI debasis,

I have tried to create a DLL with the C++ & the Header file. But i got Errors While Creating . As i have No idea on What Header Files to be included for the Errors. Can u help me on that ..please try to create a DLL with the files i have attached & can u give me a feedback on Errors....Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Augustin is offline Offline
6 posts
since Sep 2007
Oct 12th, 2007
0

Re: How To create an instance of a Class in Visual Basic

create a DLL.register
to to command prompt and type
c:>regsvr32 <complete path of DLL>

open your vb project. go to project-refrences- add the DLL from the list

now create a object
dim obj as new <nameof DLL.ClassName>

now u can use the function

hope this will work
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hereisanswer is offline Offline
1 posts
since Oct 2007
Oct 12th, 2007
0

Re: How To create an instance of a Class in Visual Basic

Click to Expand / Collapse  Quote originally posted by debasisdas ...
.CPP and .H files can't be directly referenced fronm VB. compile to .DLL file and then instanceate in VB.
Please see the post before you post redundant replies.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Oct 12th, 2007
0

Re: How To create an instance of a Class in Visual Basic

create a DLL.register
to to command prompt and type
c:>regsvr32 <complete path of DLL>

open your vb project. go to project-refrences- add the DLL from the list

now create a object
dim obj as new <nameof DLL.ClassName>

now u can use the function

hope this will work
I think thats what i posted in my first post. Please take time to read before posting.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Oct 17th, 2007
0

Re: How To create an instance of a Class in Visual Basic

Click to Expand / Collapse  Quote originally posted by debasisdas ...
.CPP and .H files can't be directly referenced fronm VB. compile to .DLL file and then instanceate in VB.

I have tried to create a DLL with the C++ & Header file. It is using ATL/COM Model ..So if i tried to create a DLL i am getting Errors. How to create it Properly. PLease can you refer the files Attached COMOutput.h COMOutput.Cpp
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Augustin is offline Offline
6 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: I lost 3 yrs work
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: data mining order paterns





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC