Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function like aVCXClasses() for .prg files.
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00786317
Message ID:
00786474
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
Hi Mark,

>Just beware if it functions like AVCXCLASSES() -- the PRG/FXP may have to exist on disk for it to work. AVCXCLASSES does not work on a ClassLib compiled into an App/EXE. This may or may not be true for APROCINFO.

This is the reason I made this H_AVCXCLASSES.PRG:
LPARAMETERS taVCXArray , tcLibraryName

#IF .F.
TEXT
*** Copyright HJF & FC 2002-- {^2002-04-07 03:09:25}
* Added the code to fix the change of _TALLY
*** {^2002-04-07 03:09:25}
********************************
*   HELP BUILDER COMMENT BLOCK *
********************************
*:Help Documentation
*:Purpose:
Wrapper for AVCXCLASSES() to fix the 'look outside the .APP/.EXE' bug.
*:Keywords:
AVCXCLASSES()
*:Parameters:
<RAWHTML>
<TABLE BORDER="1">
	<TR>
		<TH>Name</TH>
		<TH>Type</TH>
		<TH>Modified</TH>
		<TH>Optional</TH>
		<TH>Description</TH>
	</TR>
	<TR>
		<TD>taVCXArray</TD>
		<TD>Array</TD>
		<TD>Yes</TD>
		<TD>No</TD>
		<TD>Name of the array that will be filled with the class information</TD>
	</TR>
	<TR>
		<TD>tcLibraryName</TD>
		<TD>Character</TD>
		<TD>No</TD>
		<TD>No</TD>
		<TD>Name of the classlib that will be retrieved</TD>
	</TR>
</TABLE>
</RAWHTML>
*:Returns:
<RAWHTML>
<TABLE BORDER="1">
	<TR>
		<TH>Type</TH>
		<TH>Description</TH>
	</TR>
	<TR>
		<TD>Numerical</TD>
		<TD>Amount of classes in the array</TD>
	</TR>
</TABLE>
</RAWHTML>
*:Remarks:
Please note that the first parameter must be passed by reference (@) unlike the internal VFP command.
*:Example:
lnClasses=H_AVCXCLASSES(@aClasses,"PROAPP.VCX")
*:EndHelp
ENDTEXT
#ENDIF

&&Replaces RETURN AVCXCLASSES( taVCXArray , tcLibraryName)

LOCAL lcAlias, lnTally,lnClassCount

lnTally=_TALLY

dlcAlias=SYS(2015)
DO WHILE USED(dlcAlias)
	dlcAlias=SYS(2015)
ENDDO

USE (DEFAULTEXT(tcLibraryName,"VCX")) IN 0 ALIAS (dlcAlias) AGAIN

IF USED(dlcAlias)

	_TALLY=0

	SELECT AA.OBJNAME,AA.BASECLASS,AA.CLASS,AA.CLASSLOC,AA.RESERVED4,AA.RESERVED5,AA.RESERVED6,AA.RESERVED7,AA.RESERVED8,AA.USER,ALLTRIM(UPPER(BB.RESERVED2))=="OLEPUBLIC" ;
		FROM (dlcAlias) AS AA INNER JOIN (dlcAlias) AS BB ON AA.OBJNAME==BB.OBJNAME AND !EMPTY(AA.TIMESTAMP) AND EMPTY(BB.TIMESTAMP) INTO ARRAY taVCXArray

	lnClassCount=_TALLY

	USE IN (dlcAlias)

ELSE

	lnClassCount=0

ENDIF

_TALLY=lnTally

RETURN lnClassCount
It is a little hacker's way to get the information, but it works for .APP/.EXE's as well.
(I need it to know which libraries (read: classes) are included in the .app/.exe

Regards,
Frank Camp
Previous
Reply
Map
View

Click here to load this message in the networking platform