AnsweredAssumed Answered

How correctly to use AddFileOpenItem3

Question asked by Kostadin Vrantzaliev on Feb 10, 2021
Latest reply on Feb 11, 2021 by Kostadin Vrantzaliev

I am trying to add my custom file type, so Solidworks can open. I am using

 

CComBSTR callback(L"Mycallback");
iSwApp->AddFileOpenItem3(addinID, callback, L"my file type(*.xxx)", L"xxx", L"", L"", &retval);

and I correctly unregister on disconnecting from SW.

 

When I open a file with File \ Open, I see my file type, but when I press Open, I get the error message from SW that this file type is not recognised or locked etc. and tt never gets to my callback. So I must miss something. 

 

I have registered and implemented my callback in this format

STDMETHOD(Mycallback)(BSTR filePath);

 

But maybe SW expects my callback to be registered with other parameters which I cannot find any documentation for.

I am using SW2019. Does anyone have this functionality successfully implemented?

Maybe my callback must be declared differently? Any suggestions?

 

Your help is much appreciated

Outcomes