Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 23, 2012, 09:04:15 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
Mach SDK plugin questions and answers.
Com Interface Questions
Pages:
1
Go Down
« previous
next »
Author
Topic: Com Interface Questions (Read 1207 times)
0 Members and 2 Guests are viewing this topic.
rhtuttle
Active Member
Offline
Posts: 22
Com Interface Questions
«
on:
February 17, 2009, 04:49:43 PM »
I am experiencing some difficulties using the com interfaces:
mach:=TCMach4Doc.create(self);
mach.ConnectKind:=ckRunningInstance;
mach.Connect;
iMach:=mach.GetScriptDispatch as iMyScriptObject;
It instantiates and connects to a running instance fine. I am able to utilize all of the functions and procedures of the scriptObject.
If however I try to disconnect and then reconnect, Mach fails and closes. If I set my mach variable to nil, mach fails and closes. If I close my app, Mach fails and closes.
If I use a connectKind of ckNewInstance I get a dialog box with several unknown profiles. I can create a profile but then I get an invalid license prompt, followed by a user agreement dialog and then several failed dll calls.
How robust are the interfaces?
Has reference counting been implemented for each new interface?
Am I using these incorrectly?
TIA
RT
PS. I have written several com applications and am able to utilize com interfaces with many other applications like M$ excel,word, powerpoint.
Logged
jemmyell
Active Member
Offline
Posts: 106
Re: Com Interface Questions
«
Reply #1 on:
February 18, 2009, 12:09:32 PM »
Hi,
Why do you need to attach and detach from the Object Model during a single session? Anyways, I believe there are some reference counting issues, I DO NOT Release() any interfaces at shutdown time since it appears that the Scripter has already gone away at that point...
See the Mach3ObjectModel.cpp and .h files in the Custom Plugin posted in reply #41 in my tutorial thread.
http://www.machsupport.com/forum/index.php/topic,4884.0.html
- reply #41
-James
Logged
-James Leonard
www.DragonCNC.com
-
www.LeonardCNCSoftware.com
-
www.CorelDRAWCadCam.com
rhtuttle
Active Member
Offline
Posts: 22
Re: Com Interface Questions
«
Reply #2 on:
February 18, 2009, 01:23:11 PM »
Good day Jim,
Thanks for taking time to respond. As to why would I want to connect and disconnect in single session, I use my DIY beveller in several modes. As such I write modules that are designed to perform specific tasks ( woodworking tasks like mortise and tenons, box joints, dado's and rabbits. Bamboo rodmaking tasks like mortising reel seats, sawing strips, flaming culms, and of course bevelling individual strips.). Mostly they generate the gcode automatically but I have conceived of several other uses and have modules to perform those tasks. Having to restart Mach each time I want to utilize one of these is a PITA. I could write one master app that does it all but you know how much harder that is to maintain. I guess I could write one that calls dlls for each task and reuses the scripting object but it just would be nice if the com objects would play nice and allow for connecting and disconnecting like you would expect.
Every time I try to do something out of the ordinary I get stymied. I would like to write some new screens but screen4 won't work on the vista64 bit machine that I use for development. Jason's controls are at this time are still limited. My attempts at creating Dll's accessed by VB scripts is fallling short since I can't seem to get access to the main Mach hWnd to allow for new forms/windows.
After 20 years of programming in object pascal I am loathe to pay for another development environment and relearn C++ just for this when I have access to the interface. Even then I don't think you can change plugins on the fly easily (maybe I am missing something here).
Sorry for the rant but it's just one of those days.
RT
PS I have looked at your examples many times and you are to be lauded or your work. I have SDK 2.62 which I think is the last version. My type library generated from mach matches you scriptObject.
Logged
jemmyell
Active Member
Offline
Posts: 106
Re: Com Interface Questions
«
Reply #3 on:
February 18, 2009, 01:43:13 PM »
Hi,
Ok, then you are connecting an EXE in Delphi out-of-process. I have zero experience with that. If you look at the same source code you will see how to get the Mach3 main window HWND using FindWindow. The trick is the window caption has a trailing space character that is not visible. If you include that FindWindow work just fine.
Why not write a plugin using the techniques I show, then export C linkage functions that you can call from your other applications? That way you have a single instance of the scripter that you can reuse in multiple external EXE applications.
-James
«
Last Edit: February 18, 2009, 01:45:42 PM by jemmyell
»
Logged
-James Leonard
www.DragonCNC.com
-
www.LeonardCNCSoftware.com
-
www.CorelDRAWCadCam.com
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...