Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / December 2004



Tip: Looking for answers? Try searching our database.

how to wrie a dll that returns a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alvis - 17 Nov 2004 17:15 GMT
i am trying to compile the code below  but i keep getting this error how do i
fix it?

Private object modules can not be used in public object modules as
parameters or rturn types for public procedures as public data members or as
field of public defined types.

Public Function launchPerDiem(ByVal Lonum As Double, ByVal frmPerD As Form)
As Form
   LoanNo = Lonum
   Set frmPerD = New frmPerDiemAudit
   launchPerDiem = frmPerD
End Function
Ken Halter - 17 Nov 2004 17:52 GMT
>i am trying to compile the code below  but i keep getting this error how do
>i
> fix it?

You'll need to return that form As Object. VB is the only one that "knows"
what As Form means. Public members of a dll must be COM compliant... which
means that you can't expose VB specific object types (form, textbox,
whatever) to the public.

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

Bharat Sharma - 30 Dec 2004 09:44 GMT
Use this:

Public Function launchPerDiem(ByVal Lonum As Double, ByRef frmPerD As Object) as Boolean
On Error Goto OnError
   LoanNo = Lonum
   Set frmPerD = New frmPerDiemAudit
   launchPerDiem = true
   Exit Function
OnError:
   launchPerDiem = false
End Function



>i am trying to compile the code below  but i keep getting this error how do i
>fix it?
[quoted text clipped - 11 lines]
>
>  

Signature

Best,
_____________
Bharat Sharma

* TEN Technologies.
* Official Web: _www.ten-technologies.com_
<http://www.ten-technologies.comemail/>
Personal Web: _www.bharatsharma.net_ <http://www.bharatsharma.net/>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.