Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Toolbar

Status
Not open for further replies.

pdybeck

Mechanical
May 14, 2003
599
If I want to create a toolbar that is custom to my company, do I have to create an add-in to do this? I know that I can add macros to the macro toolbar, but I want to be able to quickly set up more users with the same macros on a company standard toolbar. I am assuming that I would need to create an exe and deploy it. Is this correct? If so, what all is involved. Is there an easier way? I am not so informed on this side of SolidWorks, so please be easy on me. Thanks in advance.
 
Replies continue below

Recommended for you

Custom toolbars work with addins. Addins must be written in C or VB.

I have a project for converting an .exe to a .dll addin in VB. It is posted at < file name "MakeAddinFromExeVB.zip ". It is not-quite-ready-for-prime-time, but I've posted already it due to popular demand.

The project is to take a simple VB.exe that changes face colors and turn it into an addin. Download the zip, open VB project "ScrubFaces.vbp", and read the comments in the module "SWConnectFaceScrub".

[bat]Due to illness, the part of The Tick will be played by... The Tick.[bat]
 
Tick,

Are you saying that add-ins must be a .dll? By the way, could you point me to a source or explain the differences between an .exe and a .dll? I am assuming a .dll runs inside an .exe - like something running inside of SolidWorks, but again I am not up on these things. So if I wanted to created an add-in I would have to use VB.net or VB6 to create the .dll - or use your app for converting an .exe to a dll? How does an .exe get created, or what creates it? Maybe VB creates an .exe? I'll be sure to do some searching, but any info on the matter would help. Thanks.

Pete
 
For anyone that's interested: Found this on a search.

A dynamic link library (DLL) is a collection of small programs, which can be called upon when needed by the executable program (exe) that is running. The DLL lets the executable communicate with a specific device such as a printer or may contain source code to do particular functions.

An example would be if the program (exe) needs to get the free space of your hard drive it can call the DLL file that contains the function with parameters and a call function. The DLL will then tell the executable the free space. This allows the executable to be small in size and not need to rewrite the function that has already written. This allows any program needing to obtain the free space the information without having to write all the source code and it saves space on your hard drive as well. DLLs in this fashion are also known as shared files.

The advantage of DLL files is that, because they do not get loaded into random access memory (RAM) together with the main program, space is saved in RAM. When and if a DLL file is called, then it is loaded. For example, you are editing a Microsoft Word document, the printer DLL file does not need to be loaded into RAM. If you decide to print the document, then the printer DLL file is loaded and run.

All in all a DLL is an executable file that cannot run on its own, it can only run from inside an executable file. To do this an executable needs to declare the DLL function, then when needed the call is made with the required parameters. Here is what a Declaration and call might look like in a executable file. This example is simplified so that you might understand it better:
Declare GetFreeSpacex, Kernel32.dll (DriveLetter, Buffers if any, Value returned)
Now lets run a program and make the call, the DLL is not loaded into RAM until the next line.
GetFreeSpacex "C",0, MyFreeSpace
Now let's tell the user how much free space is on drive C
Use a MessageBox = "The free space on drive C: is ", MyFreeSpace, "bytes"

If a call or a declaration is made incorrectly a GPF may occur. A call to a DLL of a different version might require more or less parameters or the call may not exist. If a DLL is the wrong version for your OS (Operating System) or for a program that you have installed it will cause a General Page Fault (General Protection Fault) or lockup your machine. Generally a file that is older than your OS and is available in the Windows cabinet files is the wrong version. Also note that a file from Windows 98 may not be compatible with Windows 95. Many Windows 98 files work well on 95 but not all will. To fix these errors you should run QikFix's File Verifier and System Sentry.

 
Respectfully, it sounds like this may be a bit over your head. I assumed you were somewhat adept at VB programming.

The language you see when editing SW macros is VB. To program full VB and make .exe's and .dll's, you need a full version of VB. I'm still using VB6, which I bought for less than US$200 on eBay.

To learn VB, I started with some books off-the-shelf from a local bookstore. These came with software included. It is best to learn VB independently before attempting to get to deep into SW API. Most important, it is necessay to understand how objects work, with their methods, properties, and events.

".exe's" are stand-alone programs. ".dll's are programs that are called by other programs. In the case of SW, the .dll is a specially structured program that interfaces with SW automatically.

I don't believe there is a way to make custom toolbars with just macros.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor