Reply

start SE using c++ code

[ Edited ]

 

Hi, all

i saw the c# code, i attached, from solid edge .net programer;s guide that is about starting Solid Edge.

of course, i works well... but i'd like to do that using c++.

actually i'm not familiar with com & atl... so i cannot get any solution finally though i try to find a way from addin sample code.

please help me...

maybe the simple c++ code is best for me.

thank you in advance.

 

Posted by: James Cho
Post date: 4/5/2009 11:46:40 PM

2 REPLIES

RE: start SE using c++ code

[ Edited ]

 

HI,

you can use the AddinWizard from this site as starting point for add-in development, also in C++.

You found it under Downloads

http://www.jasonnewell.net/Downloads/tabid/63/view/topics/forumid/15/Default.aspx

Will be nice if other developers will add C++ examples in the WIKI.

Regards

Massimo

 

Posted by: Massimo Magris
Post date: 4/13/2009 1:59:13 AM

RE: start SE using c++ code

[ Edited ]

 

Hi,

You can start solid edge application using the following code.

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])

{

 

 HRESULT hres=S_OK;

 

 SolidEdgeFramework::ApplicationPtr pSEApp = NULL;

 

 hres = CoInitialize(NULL);

 

 if (FAILED(pSEApp.GetActiveObject("SolidEdge.Application")))

 {

  // Dont have Solid Edge running. Create a new instance.

  HRESULT hr = pSEApp.CreateInstance("SolidEdge.Application");

  if(FAILED(hr))

  {

   ::MessageBox(0,"Failed to creat=e an instance of Solid Edge",0,0);

   return -1;

  }

 

  pSEApp->PutVisible(VARIANT_TRUE);

 

 }

   CoUninitialize();

}

 

Posted by: Triad User
Post date: 5/4/2009 1:33:37 AM