Help with VB to COBOL cpnvert - 105 memory allocation error

[Migrated content. Thread originally posted on 10 August 2011]


A client has a question relating to a VB to COBOL conversion, could I ask for assistance or advise on why the 105 memeory allocation error occurs:


Original text:
Hi I am trying to convert a vb program to cobol and have hit a snag that I do not know how to do it, can you help please. I have attached a test app, I am having trouble converting the following:
Call SetFpcCallback(Addressof FprCallback)

Private Sub SetFprCallback(ByVal lpFunc As Long)
Fpr1.FprCallback = lpfunc
End Sub

I think it is trying to pass the memory address of FprCallback to the sub program Fpr1.

In my Cobol program (Bacfpr.cbl) the relevant section is SET-CALLBACK, when I push the Push Button I get an error 105 Memory allocation error.


invoke Fpr "FprCallback"
using DataBlock-pointer

move FprCallback to FprCallback

* perform AUTO-SNAP



invoke Fpr "CopyCapImage"
using lpBuff
returning anInt


LMain-Process SECTION.
initialize w-validprints
PERFORM LProgram-Initialize
if w-ok = zero
PERFORM LProgram-Body until l-first = 3


I tried to attach the Cobol files but get a server error from the website.