knowledge-database (beta)

Current group: codewarrior.embedded

COM API Problem

COM API Problem  
bradgonesurfing at yahoo.com
From:bradgonesurfing at yahoo.com
Subject:COM API Problem
Date:6 Jan 2005 22:39:20 -0800
Dear all,


I am using codewarrior for HC08 ( the latest version) and trying to
script the environment using COM. I am having problems with the
CreateAccessPathByPosition method of AccessPaths class. I have
successfully created a user source tree. When I try to add access
paths to that source tree I manage to crash CodeWarrior every time.


The CreateAccessPathByPosition has an argument position


virtual HRESULT CreateAccessPathByPosition(
BSTR path,
VARIANT_BOOL Recursion,
EAccessPathLocation inLocation,
EAccessPathType inType,
BSTR userTreeName,
long position,
ICodeWarriorAccessPath **pval) = 0;


but I am not sure how to use it correctly. If I set it to 0 and then
add
multiple paths before an ApplyChanges then it crashes CodeWarrior. If
I increment the number it sometimes crashes CodeWarrior. The only way
I
have got it to work reliably is to do the following (pseudo code).


foreach path in paths do
access_paths = target.AccessPaths
access_paths.CreateAccessPathByPosition( ...
path,
false,
kUserDefined,
kUserPath,
'PathRoot',
0 );
access_paths.ApplyChanges
end


However this is very slow. Each time I apply changes then reget the
accesspaths
object CodeWarrior takes a long time to search for something. Can you
suggest a methodology which will work nicely


Regards


Brad Phelan
   

Copyright © 2006 knowledge-database   -   All rights reserved