Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21246

VB6-Problem with User-Defined Type

$
0
0
I have a User-Defined type that is declared as Public in a module:
Code:

Public Type T_DATA
        bdata(1 to 276) as Byte
End Type

When I define a variable (PublicKey) as Public in a Class module, I get the error:
"Constants, fixed-length strings, arrays, user-defined types and
Declare statements not allowed as Public members of object
modules".

So I moved the definition to the Module as Public. Then I get the error:
"Variable not defined"

When I move the definition back to the Class Module as Private, I get the same error:
"Variable not defined".

Strangely enough, the variable is used in several other routines in the same Class Module without a problem; the difference being that the error occurs in a system call. I can tell that it has something to do with the Function declaration, because VB corrects the capitalization on one, but not the other. eg.

publickey, len(publickey) --> publickey, Len(PublicKey)

The first variable is declared "ByRef As Any" and the second "ByVal As Long". Any suggestions would be appreciated. Before anyone suggests changing the Declare Function, I have been through Hell just to get it to work this way, so that is not an option. I was only cleaning up the code when I ran into this problem.

J.A. Coutts

Viewing all articles
Browse latest Browse all 21246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>