VC++ help please...

Hi ,

This is what I have done. I was just trying a project, which involves creating a simple add-in using the SolidWorks Addin App Wizard.

I have SolidWorks 2001 Plus and VC++ Versi HINSTANCE hInst = AfxGetResourceHandle(); if (m_lpszTemplateName != NULL) { TheApplication->SetResources(); hInst = AfxFindResourceHandle(m_lpszTemplateName,RT_DIALOG); HRSRC hResource = ::FindResource(hInst,m_lpszTemplateName,RT_DIALOG); m_hDialogTemplate = LoadResource(hInst,hResource); TheApplication->ResetResources(); }

Then I added the necessary headerfiles in the relevant places.

Added amapp.h,ExampleApp.h and resource.h to the Dialog.cpp header file. and added dialog.h file to mainapp.cpp file.

I invoked the DialogBox from the MenuItemCB function. The code looks like this:

void MenuItemCB(void) { CSettingsDlg dlg; dlg.DoModal(); return; }

Now, when I try to build the application, it build fine. I launch the dll inside SolidWorks, and when I open the dialog box by clicking on the menu button, it opens up, but hangs the SolidWorks Application and it eventually crashes saying that it encountered an unhandled error.

Is there anything that I am missing over here??

Please help me out.

Thanks, Sushil.

--- snipped-for-privacy@att.net wrote:

Bob Hans> > Please look at the SW API help under managing > resources. > > Best Regards, > > -- > Bob Hanson > CEO > Custom Programming Unlimited LLC > SolidWorks Solution Partner in two > categories: > (SW API training/consulting and SW > PDM provider) >
formatting link
website > (Home of SW API Public Code > snippets) > SolidWorks 2003 World User > Conference Exhibitor Booth #407 > >
Reply to
Sushil
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.