Reply

Proper usage of SearchDocuments method

[ Edited ]

I am trying to use the SolidEdgeFramework.Application.SearchDocuments(...) method, and it's not clear what the method is expecting for arguments. The objects that are passed in by reference are the ones I believe are causing my problems. Looking at the disassembled wrapper code, all of the references are marshaled as struct on the COM side, and object on the .NET side.

 

If anyone out there has suggestions on what type of object to pass in by reference, that would be appreciated! I am getting a HRESULT: 0x80020010 (DISP_E_BADCALLEE) which means that something I am passing in is incorrect. So far I have tried passing in type object and a string array, but no luck. If you have a working code example I would appreciate it!

 

Details in the following snippet:

 

string[] lDwgList, lTitleList, lSubjectList, lModDateList;

int iDwgCnt = 0;

SolidEdgeFramework.Application _solidEdge = null;

 

lDwgList = new string[10];

lTitleList = new string[10];

lSubjectList = new string[10];

lModDateList = new string[10];

 

// open up Solid Edge

 

//next do a search for a drawing

//sDir is a string containing the path

//DrawingFile is a string containing the file name

 

_solidEdge.SearchDocuments(true, sDir, true, lDwgList, iDwgCnt, varFileFilterOrText: DrawingFile, ListOfTitles: lTitleList, ListOfSubjects: lSubjectList, ListOfModifiedDates: lModDateList);

 

// Note that I had to refer to the parameters because in my implementation the last three are required on the .NET side

// but are optional on the COM side. I don't know why this is that way, VS2010 builds the wrappers for me automatically

// and it comes out that way.

 

Thanks in advance for any help! Using C# and VS2010, ST3.

 

 

Posted by: Theodore Langevin
Post date: 1/13/2012 8:38:19 AM