Hi,
I am trying to use a fairly old library with VB.Net
It is COM based, so I have just added a reference to it and that bit is OK.
The problem is that the main object that needs to be created, must be done
from a DLL call. In VB6, this was just:
Private Declare Function GetEngineObject Lib "FREngine.dll" (engineObj As
FREngine.Engine) As Long
Sub Init
Dim Engine As FREngine.Engine
Dim Success As Integer '0=success
Success=GetEngineObject(Engine)
End Sub
------------------------
For VB.Net, this fails, returning an invalid pointer error code.
I presume that the declare should become:
Private Declare Function GetEngineObject Lib "FREngine.dll" (ByRef engineObj
As IntPtr) As Int32
The call to this function then succeeds, however, how do I marshall the
IntPtr to the Engine object in order to be able to use it. And is that all
I need to do?
Any help on this would be greatly appreciated,
Chris
Chris Austin - 18 Jun 2006 08:37 GMT
Ignore this message. Not thinking straight!
Just hadn't added a Byref the first time.
> Hi,
>
[quoted text clipped - 32 lines]
>
> Chris