Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / December 2003

Tip: Looking for answers? Try searching our database.

Problem using C# dll via COM Wrapper from Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gregor - 23 Dec 2003 08:30 GMT
Hi,

I have a problem using an COM-Object from Access
(tested with Office 2000 and XP).
The VB Code calls a function in an C# dll via COM Wrapper.
This function opens a Dialog and returns 3 values.
The same Code works fine when called from a EXCEL Sheet-VB.
In Access VB a Error "wrong ParameterTypes" occures. What is wrong there ?
Where is the difference beetween Excel and Access VB?

#### Function in C#

int DoDialog(int posx, int posy, string id, ref string out1, ref string out2)

#### VB - Code

Private Sub CommandButton1_Click()

   Dim theInt As Object
   Dim input3 As String
   Dim input2 As Integer
   Dim input1 As Integer
   Dim res3 As String
   Dim res2 As String
   Dim res As Integer
   
   Set theInt = CreateObject("TheInterface.TheInterface")
   input1 = 0
   input2 = 0
   input3 = "abcd"
   
   res = theInt.DoDialog(input1, input2, input3, res2, res3)
   
   Set theInt = Nothing
   
End Sub

Thank you

Gregor
Douglas J. Steele - 23 Dec 2003 11:26 GMT
Change the declaration of Input1 and Input2 from Integer to Long in your VBA
code.

In the .Net world, Int are 32 bit integer values, the same as Long in VBA
(and VB "Classic").

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

> Hi,
>
[quoted text clipped - 36 lines]
>
> Gregor
Gregor - 29 Dec 2003 12:05 GMT
> Hi,
>
> I have a problem using an COM-Object from Access
> (tested with Office 2000 and XP).

Hi,

during further debugging i have found the error. The opened Dialog
uses the
TransparencyKey Property. When i set this property to null my COM Obj.
works fine from Access.


Gregor
 
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



©2008 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.