Microsoft-MsgBox via ActiveX
Hi,
i want to call the Microsoft-Message-Box (function "MsgBox" in VB) in my LabVIEW-6-application, e.g. via ActiveX.
In the list (offer when import ActiveX-Controls) I can't find the MsgBox or any equivalent. Can anybody help me?
Thank You.
C. Dietz
Test Engineering
digades GmbH
www.digades.com
C. Dietz;
You can use the Windows API Function Utilities (32-bit) for LabVIEW to call the Message Window Dialog Box.
Also, as you might be already aware, LabVIEW also has a Message Box located in the function palette under the Time & Dialog menu.
You can also create your own message box.
Regards;
Enrique
www.vartortech.com
Similar Messages
-
Problem calling java from vb via activex bridge
I am trying to call java from vb via ActiveX Bridge and I am running into problems. I would appreciate any help.
I am using Visual Basic 2010 express, and Java JDK 1.6.0_16. I have used the http://download.oracle.com/javase/1.4.2/docs/guide/beans/axbridge/developerguide/index.html page as a guideline. To try to make it work I took the following steps:
1. Wrote a very simple java class (below):
package xxx;
import java.io.Serializable;
public class axb implements Serializable {
public int get_axb_Handle() {
int Address = 12345678;
return Address;
2. After I compiled, and created the jar file. I built the dll using the following command:
"C:\Program Files\Java\jdk1.6.0_16\bin\packager" -out "C:\Program Files\Java\jdk1.6.0_16\jre\axbridge\bin" E:\axb\dist\axb.jar xxx.axb
3. I then registered using: regsvr32 axb.dll
4. In Visual Basic Express IDE I use Project -> Add Reference to add Iterop.axb (dump below), and axb namespace
5. In my basic code I use the following lines
Dim axb1 As axb.axb
axb1 = New axb.axb <== Crash here with AccessViolationException ( full exception below)
What am I missing? Any help would be greatly appreciated
Thanks
Iterop.axb partial dump
___[MOD] C:\Documents and Settings\Elie A. Cohen.USINC022\My Documents\Visual Studio 2010\Projects\Repo API Example\Repo API Example\obj\x86\Release\Interop.axb.dll
| M A N I F E S T
|___[NSP] axb
| |___[INT] axb.axb
| | | .class interface public abstract auto ansi import /*02000006*/
| | | implements axb.axbDispatch/*02000003*/
| | | implements axb.axbSource_Event/*02000005*/
| | | .custom /*0C000018:0A000001*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.GuidAttribute/*01000002*/::.ctor(string) /* 0A000001 */ = ( 01 00 24 34 45 36 44 30 44 41 38 2D 36 41 45 44 // ..$4E6D0DA8-6AED ...
| | | .custom /*0C000019:0A000007*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.CoClassAttribute/*01000009*/::.ctor(class [mscorlib/*23000001*/]System.Type/*01000007*/) /* 0A000007 */ = ( 01 00 0C 61 78 62 2E 61 78 62 43 6C 61 73 73 00 // ...axb.axbClass. ...
| |
| |___[CLS] axb.axbClass
| | | .class public auto ansi import /*02000004*/
| | | implements axb.axbDispatch/*02000003*/
| | | implements axb.axb/*02000006*/
| | | implements axb.axbSource_Event/*02000005*/
| | | .custom /*0C00000F:0A000008*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.ClassInterfaceAttribute/*0100000A*/::.ctor(int16) /* 0A000008 */ = ( 01 00 00 00 00 00 ) ...
| | | .custom /*0C000010:0A000009*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.ComSourceInterfacesAttribute/*0100000B*/::.ctor(string) /* 0A000009 */ = ( 01 00 0F 61 78 62 2E 61 78 62 53 6F 75 72 63 65 // ...axb.axbSource ...
| | | .custom /*0C000011:0A000001*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.GuidAttribute/*01000002*/::.ctor(string) /* 0A000001 */ = ( 01 00 24 43 44 42 46 36 42 33 33 2D 45 32 33 46 // ..$CDBF6B33-E23F ...
| | | .custom /*0C000012:0A000002*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.TypeLibTypeAttribute/*01000003*/::.ctor(int16) /* 0A000002 */ = ( 01 00 02 00 00 00 ) ...
| | |___[MET] method .ctor : void()
| | |___[MET] method equals : bool(object)
| | |___[MET] method getClass : object()
| | |___[MET] method get_axb_Handle : int32()
| | |___[MET] method hashCode : int32()
| | |___[MET] method notify : void()
| | |___[MET] method notifyAll : void()
| | |___[MET] method toString : string()
| | |___[MET] method wait : object(object,object)
AccessViolationException exception
System.AccessViolationException was unhandled
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=mscorlib
StackTrace:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at WindowsApplication1.Form1.getPatientHandle_Click(Object sender, EventArgs e) in C:\Documents and Settings\Elie A. Cohen.USINC022\my documents\visual studio 2010\Projects\Repo API Example\Repo API Example\Repo API Example.vb:line 13
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:In case you haven't figured it out already... Or if anyone else is curious... Or for myself when I get old and forgetful...
h2. Object Creation
For starters, when you create an ActiveX object from within VB, use:
Set myObject = CreateObject("JavaObject.Bean")When I refer to JavaObject.Bean, I'm meaning the full object name + ".Bean". So, in your case, you should use:
Set myObject = CreateObject("xxx.axb.Bean")h2. Location
The .dll file must be located in the JRE that is used at the time of calling. Meaning, the .dll file must be placed under <jre_home>\axbridge\bin and registered there.
In your case:
DLL:
C:\Program Files\Java\jre6\axbridge\bin
Jar:
C:\Program Files\Java\jre6\axbridge\libh4. A Note:
The only supported JRE is a 32bit version as far as I know with regards to the ActiveX bridge. Just like the packager.exe can only be found in the 32bit JDK.
h2. Methods
h3. Object Types
ActiveX Bridge does not support passing literals or arrays. However, it does support passing java's primitive data types as Objects.
Simply meaning:
h4. Invalid:
public int get_axb_Handle() {
int Address = 12345678;
return Address;
}h4. Valid:
public Integer get_axb_Handle() {
int Address = 12345678;
return Address;
}On a normal circumstance, there's little difference between the two methods. However, in the second example, the JVM does a typecast from a literal data type to a object data type, resulting in a valid object to pass through to Visual Basic. Now, obviously there are multiple ways to do a proper change, new Integer(int) for example. It doesn't matter to me. At the end of the day, you have to pass an object.
As a side note, the same idea applies when receiving data from Visual Basic.
h4. Invalid:
public void set_axb_Handle(int newHandle) {
int Address = newHandle;
}h4. Valid:
public void set_axb_Handle(Integer newHandle) {
int Address =newHandle; -
How to call a LV.exe from LV via ActiveX?
Hi all,
I need some kind of atomic task, e.g. some (short) instructions that cannot be aborted. Calling a DLL, wait some ms, calling it again... And even an Abort via VI server shall not abort this atomic task but finish it.
I thought about building an LV application and run it via ActiveX.
Building the app is managed. But running it via ActiveX is still unsolved.
Have extensively searched for examples for this, but the only source I came up with was
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DD6B56A4E034080020E74861&p_node=DZ52051&p_source=external
This one is about 6 years old and talks about LV 5.1, whereas I use LV 7.1.
Nevertheless I have performed all steps as described there, e.g. enabling ActiveX, granting privileges, enabled DCOM with dcomcnfg and registering my app. Finally I could open an automation refnum to it. But whatever ActiveX class I choose, there's no way to set a control in my app and to run or call it. Lots of mysterious errors (depending on what class I choosed), amoung them 5012 (exception occored).
Any newer instruction or another idea on how to get an atomic VI?
BTW, I am not sure if a DLL would do it, as it runs in the context of LabVIEW. I believe I need this atomic VI in a different context. Right?Message Edited by LuI on 06-17-2005 04:08 PMHi Lul
I create a small example to run an LV application an run it via ActiveX in LV 7.1.
To build the application I change:
VI settings => Run when opened => No
Application settings => Enable Active X server
to register the executable I only run it once.
Hope this helps
Manuel
Attachments:
example.zip 45 KB -
Print file via ActiveX,an​d it is not found always
Hello, I have made a lot of efforts to create and print an HTML Report.
I have concluded to the fact that it has to be printed via ActiveX.
But it is not working always. Some times the JPEG file that has to be printed, is not found and a "red X" is printed on the top-left of the page.
Other times it is printed successfully.
I attach an image of my code in which I use the ActiveX.
Is there something that I can do?
Thank you.Did you look in the LabVIEW Help? http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/reg_hndl_ax_evnts/
You right-click on that parameter and select Create Callback VI. This will automatically create a VI with the required inputs and outputs. This is the VI that will be called when the event occurs. If you need the callback VI to update any front panel controls of the main VI, then you can pass in control references via the User Parameter input.
Attached is a modification of the shipping example that handles the Navigate and DocumentComplete events.
Attachments:
Navigate Callback Example.vi 24 KB
Navigate Callback.vi 15 KB
DocumentComplete Callback.vi 15 KB -
How can I install Microsoft Remote Desktop ActiveX Control
I am trying to connect to my pc at work from home. This is the message I get.
This portion of the Remote Web Workplace requires the Microsoft Remote Desktop ActiveX Control. Your browser's security settings may be preventing you from downloading ActiveX controls. Adjust these settings, and try to connect again.
I have looked through all the add-ons available and can't find it to add on. Nor can I find a relevant security setting to change.
I am running firefox 28.0 on Windows 7 Professional.ActiveX controls are specific to Internet Explorer.
* https://en.wikipedia.org/wiki/ActiveX
You can try opening Internet Explorer inside a Firefox tab with the following add-on.
* https://addons.mozilla.org/firefox/addon/ie-tab-2-ff-36/ -
"Invalid type library" error when opening Excel via ActiveX
Hi,
I am trying to open Excel via ActiveX (Automation open function), for
instance by running the
build in example "Open Excel and make visible". However, on some computers,
I recieve the error code -2147319784 "Old format or invalid type library".
The problem seems to be that LabView is unable to recognize the ActiveX
control, as it does not appear in the list "Select ActiveX Class". It works
perfecly from Matlab though, so the control seem to be in order. I have also
tried reinstalling Office.
On most computers it works perfectly, but three identical Dell P4 900Mhz
have the same problem.
/Stefan BorgThis may be happening due to different Excel versions, a vi made to control Excel 97 won't work for Excel 2000 and vice-versa. Be sure you are using the correct activeX calls for each one.
Good luck -
Generating LabVIEW events via ActiveX
I have a Labview 2010 Vi compiled to an EXE with ActiveX server enabled.
The VI has a single control that is a latched boolean control that is used in an Event Handler.
When I toggle this control, remotely, via an ActiveX client, the control changes state, but does not generate an event. (non-signaled).
I can understand this behavior if the control was not a latched control, but I would have thought that the latched control would automatically generate an event, since it doesn't make a distinction between "value" and "value (signaled)".
Other than monitoring/polling the control status and when it changes using a Value (Signal) local variable, is there a way to generate an Event, in a LabVIEW EXE, via ActiveX? Or is there another, more appropriate way to accomplish this. I'm trying to remotely run an program from another program through an activeX interface. I suppose if every control had a unique message and I had a message handler loop, then I could just use the ActiveX control to insert the appropriate message into the Queue, but this is an existing application and would take a fair effort to set that up.What if you tried dynamically registering the event? You could create a reference to the boolean and use the Register for Events VI. Then, wire this event into the dynamic event terminal of the event structure (right click the border and say "Show Dynamic Event Terminals"). I don't have an ActiveX program to call into LabVIEW with, so I'm not sure if this will be any different than what you're doing now, but it's something easy to try. Perhaps you could post you ActiveX code and LabVIEW code or a modified version of both illustrating what you're mentioning?
-
Can I connect to my microsoft network via VPN and download network files?
Can I connect to my microsoft network via VPN and download network files to my iPad2? If so, what app is required?
There are several apps available from App Store but the one I use is iTeleport.
Oops the Windows specific version is called Jaadu Remote Desktop for Windows
Message was edited by: Joe Bailey to add Windows version -
I've looked at all the other threads I could find in Technet that look close to this issue.
In my BDD.log, the last entry is "FAILURE (Err): 429: CreateObject(Microsoft.BDD.Utility) - ActiveX component can't create object" right after "RUN: regsvr32.exe /s "C:\Users\ADMINI~1\AppData\Local\Temp\Tools\x64\Microsoft.BDD.Utility.dll""
I have the following:
C:\_SMSTaskSequence folder
C:\MININT folder
LiteTouch.wsf link under the Startup Folder
Deployment share is mapped properly
System logs in automatically as local administrator
Even with this, it does not automatically resume the imaging job. I do not understand why it is not continuing.
If I launch the LiteTouch.wsf from an Admin elevated cmd window, the Task Sequence resumes like nothing was wrong.
Any guidance is appreciated!
EDIT1: I changed my customsetting.ini file to join a workgroup instead of the domain and it appears to be continuing without issue now. Is there something I am missing as to why it does not automatically run when it joins to a domain?Just wanted to provide an update.
So, i took the suggestion of a few other blog posts and moved the object into the Computers Container in AD so it did not have any policies impacting it. After doing this, it properly cycles through the application installs and reboots in the Task Sequence
while joined to the domain.
Is there an sort of comprehensive list of GPO settings that break MDT? The ones I have found (legal prompt, etc.) we do not do so it has to be something else. -
working with MDT 2013 & ADK 8.1,
Windows 8.1 x64 deployment fails in section "State Restore" (Deployment Type: NEWCOMPUTER).
RUN: regsvr32.exe /s "C:\Users\ADMINI~1\AppData\Local\Temp\Tools\x64\Micrsoft.BDD.Utility.dll"
"FAILURE (Err):429: CreateObject(Microsoft.BDD.Utility) - ActiveX component can't create object"
go to "%programdata%\microsoft\windows\start menu\programs\startup" and perform the "Litetouch.lnk" with elevated rights (right click run as administrator), the ts will continue and apply the OS without any error message.
join to workgroup instead to domain and the installation will perform without any error...
any help is appreciated.
thx a lot.
The error was AD policy related.
I moved the device to an AD Folder (no policy), deployed the windoows 8 again and moved the box back to the correct ou in TS section PostInstall - Custom Tasks using a ps script.
I did not figure out which policy.
Update: moved from W8.1 EVALUATION to offical release solved my problem!Which policies are causing this? Do you have anything that limits/modifies the local administrator account? Or restricts the loading of ActiveX?
Keith Garner - keithga.wordpress.com -
HI,
I'm trying to find an example of starting the SAP GUI via ActiveX / OCX. I'd like the same functionality as provided by the Enterprise Portal but within a normal HTML page.
If this post belongs to another forum, then maybe someone can make another suggestion. I looked and didn't find anything better.
Thanks.
Dickoption 1. use sap short cut , and the details can be found i this thread
call SAP transaction from BSP- SAP ShortCut
option 2. sapgui scripting using sap java gui
Re: Calling SAP Transaction from BSP
option3 sapgui scripting using sap windows gui
SAPGUI scripting API - http://www.synactive.com/download/sap%20gui%20scripting/sap%20gui%20scripting%20api.pdf
i have seen a example coding eithe rin BSP or in SAPGUI forum, but couldnt find it. but using the API documentation given above, you can create one.
Raja -
Get FrontPanel Control references via ActiveX
Hi,
I've tried to get references to frontpanel controls via LabVIEW ActiveX server, equivalent to this LabVIEW code:
but I cant find the ActiveX methods / propertis to use. Is there a way to do this?
/LeifS
Solved!
Go to Solution.The ActiveX Automation Server interface to the LabVIEW VI server only exposes a very small subset to the actual LabVIEW VI server. Basically it is enough to load and execute particular VIs and pass values to front panel controls by their label name, but that is it.
The reason is twofold. When VI Server was introduced in LabVIEW around LabVIEW 5.0 this was mostly the functionality that VI server exposed altogether. There was no scripting at all, and only limited access to the object hierarchy of the frontpanel controls. Even then the ActiveX interface did not expose all methds and properties of the VI server, partly because exposure of LabVIEW internas would have required an extensive ActiveX typelibrary, partly because it was not considered a main concern to be able to do more than launching VIs through it. It was better than the DDE interface already by a long stretch.
VI server was then extended enormously in later releases, but the ActiveX interface was not really changed much, also because Microsoft had announced .Net and declared the ActiveX hype of a few years earlier to be deprecated anyways.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Image in a microsoft toggle button activex
HI
I cannot put an picture in a control button(MS Active X) because i do not
know the type of the proprties "Picture"
ThanksThomas Esposito wrote
> i do not know the type of the proprties "Picture"
> Thanks
==========================================
Hi Thomas,
Microsoft ActiveX Toggle Button takes following picture file formats in most
environments (and I think Labview shouldn't be an exception)
*.(bmp, dib, gif, jpg, wmf, emf, ico) and cur and may be some more
For inserting picture recommended method is to use properties browser and
choose the property picture. It is expected that you see a prompt that will
open load picture dialog box.
HTH
Cordially,
Rishipa
All reply to this newsgroup please
========================================== -
Problems controlling Microsoft Access with ActiveX
I have done quite a bit of searching on this topic, and have found several answers that are close, but do not address my actual problem.
I would like to use ActiveX to control Microsoft Access, specifically to create new database files without having to copy a blank file I have stored somewhere. I also can't stand it when I can't get something to work, so this is now a personal thing too.
Anyway, when I run a simple VI to open the creatable reference Access._Application, I get the error: "Error 3005 occurred at Automation Open: Object specified is not creatable in Access.vi". I have tried a lot of the common answers to this problem, like browsing for the library in the ActiveX window, and trying to register it with regsvr32, but the file is msacc.olb, which cannot be registered with regsvr32.exe. I have attached the original VI and I have tried this on 3 different PCs, all with slightly different installs of Office, but all with Access 2007. If anyone can help me figure this out, I would greatly appreciate it.
Thanks
Eric
"When I see an adult on a bicycle, I do not despair for the future of the human race."
-H.G. Wells
Solved!
Go to Solution.
Attachments:
Access.vi 6 KBYour vi gave the same error on my machine. Then I deleted the Access._Application reference, right-clicked on the reference input and selected Create Control. Then I changed the Active-X Class by browsing to my computers version of the reference ("Access._Application.12"). The same vi ran without error.
The class still shows as Access._Application, which indicates that there may be an incompatibility which is not visible.
When and activeX node fails to run when copied from any other machine, it is recommended to Replace each node that generates the error and reselect the properties and methods.
Michael Munroe, ABCDEF
Certified LabVIEW Developer, MCP
Find and fix bad VI Properties with Property Inspector -
How to use Microsoft DateTime Picker ActiveX control in Forms 6i?
Does anyone have idea on how to use Microsoft Date-Time Picker ActiveX component in Forms 6i? Please give me coding examples for using this control to retrieve & store date at the backend.
Regardswhen u load activex (spreedsheet) the corresponting menu also u can see when u run through which also you can set the attribute values
im also check the same it is working
sorry i saw it on design time
kansih
Edited by: Kanish on Apr 28, 2009 2:54 AM
Maybe you are looking for
-
PS CS5 Extended on Windows When trying to use the clone stamp and/or healing brush as soon as I move the cursor from the toolbar over to the image I get an exact copy of the existing layer that moves around the window with the movement of the clone s
-
How do I delete songs in iTunes 7 from my iPod?
I'm having a problem with the new version of iTunes - on my iPod I can't see what songs are on there or manage my music manually. I have the box checked to manage my music manually but I can't actually see any of the songs to delete the ones I no lon
-
How to repaint only a portion of the Screen
We are developing Graphics based application where we need to call repaint method again and again. Now repaint method repaints the whole screen but we want it to repaint only a portion of the Screen. Is it possible ? if yes then how ? Thanking You in
-
Subcontracting Scenario -urgent
Hi all our clients requires different scenario how would we map these into the SAP 1-We send the material to Sub contracting Vendor for Machining operation suppose 100 piece. but Vendor make the some pieces faulty (Rejection) like 10 piece. 2- by def
-
Menu bar display icon disappears after resize
My menubar display icon goes away after resize and the checkbox for it in system preferences unchecks itself. Has anyone else experienced this bug? Closing system preferences between resizes doesn't fix. Restarting machine doesn't fix. (Of course wit