![]() |
there are three terrible questions on SW translator as below
【隐藏帖】
|
回复: there are three terrible questions on SW translator as below
Hello Yanhua,
To answer your questions: 1 - You should be able to use ::GetActiveObject to obtain the currently running SW session. Once you have the IUnknown pointer, you can use the AttachDispatch to attach it to your ISldWorks object. 2 - I believe that I have responded to this item separately today. 3 - If you look at the three calls: OpenDoc6, ActivateDoc2 and GetActiveDoc all three of them are returning a document object. Thus, you only need one of them. It is true that the macro recorder records all three, but you do not need to make these calls when working with your code. Regards, Earl Hasz |
回复: there are three terrible questions on SW translator as below
Hi,
Thanks.But this is not useful for the first question. My programming language is Visual C++7.0, and I use OLE Automation of SolidWorks 2006, not COM. My question is that how to connect to an already running instance of SW in my following scene. Scene: VC7.0 & OLE Automation &SolidWorks 2006 & swdisp.h yanhua |
回复: there are three terrible questions on SW translator as below
Hello Yanhua,
Based on my last response, you should be able to do the following: IDispatch *pDisp; CoGetObject(L”SldWorks.Application”, NULL, __uuidof(IDispatch), (void**)&pDisp); ISldWorks swApp(pDisp); Regards, -Earl |
所有的时间均为北京时间。 现在的时间是 08:10 AM. |