By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,969 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,969 IT Pros & Developers. It's quick & easy.

How do you declare this C DLL function in VB? - uses a long pointer

P: n/a
Hello

I have a function in a C DLL like this:

DWORD __stdcall FCSConnect(const TCHAR * ServerName, UINT
ServerPort,
FCS_HANDLE * FCSHandle);

My interpretation in VB is (VB6):

Private Declare Function FCSConnect Lib "C:\FCS\FCSAPI\Release
\FCSAPI.dll" (ByVal szServername As String, ByVal lPort As Long, ByVal
hFCSHandle As Long) As Long
But it doesn't work.

All the other functions work ok but for this one the last parameter is
a pointer - FCS_HANDLE. Do I need to use addressOf or anything
different?

Oct 4 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 4 Oct, 15:00, Angus <anguscom...@gmail.comwrote:
Hello

I have a function in a C DLL like this:

DWORD __stdcall FCSConnect(const TCHAR * ServerName, UINT
ServerPort,
FCS_HANDLE * FCSHandle);

My interpretation in VB is (VB6):

Private Declare Function FCSConnect Lib "C:\FCS\FCSAPI\Release
\FCSAPI.dll" (ByVal szServername As String, ByVal lPort As Long, ByVal
hFCSHandle As Long) As Long

But it doesn't work.

All the other functions work ok but for this one the last parameter is
a pointer - FCS_HANDLE. Do I need to use addressOf or anything
different?
I worked it out - for a pointer you use ByRef rather than ByVal -
worked for me anyway.

Oct 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.