Theos PowerBasic Museum 2017

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => COM Programming => Topic started by: Dan Campbell on July 07, 2013, 09:58:34 PM

Title: Memory access violation, in PBCC, when initializing from an ActiveX
Post by: Dan Campbell on July 07, 2013, 09:58:34 PM
Hi,

I tried this on an older laptop, from Vb6, in order to confirm there's nothing wrong with the ActiveX.

In Powerbasic, I'm trying to reconstruct the 'Simple Example' of using the Gold Parser DLL.

In the attached example, no code generation is written yet, but it's getting an error when trying to load the grammar.  If Compile and Execute, then we get the standard SimpleInterpreter.exe has stopped working.  If Debug, then it reports a Memory Access violation, when attempting to execute

iGoldParser.LoadCompiledGrammar( "c:\Projects_Programming\PowerBasic\GoldParserSimpleInterpreter\Simple02.cgt" )


http://www.goldparser.org/engine/1/vb6/doc/index.htm

The documentation for LoadCompiledGrammar at
http://www.goldparser.org/engine/1/vb6/doc/object-goldparser.htm

says

LoadCompiledGrammar (FileName)   Boolean   If the Compiled Grammar Table file is successfully loaded the method returns True; otherwise False. This method must be called before any Parse calls are made.



Title: Re: Memory access violation, in PBCC, when initializing from an ActiveX
Post by: José Roca on July 07, 2013, 10:14:20 PM
You can not initialize an object using the IID. You have to use the PROGID.
Title: Re: Memory access violation, in PBCC, when initializing from an ActiveX
Post by: Dan Campbell on July 07, 2013, 10:34:53 PM
Quote from: José Roca on July 07, 2013, 10:14:20 PM
You can not initialize an object using the IID. You have to use the PROGID.

Perfect, thanks Jose.