VI to use already running using ActiveX

Is there a way to make it fail if it does not find a VI already running?  Any ideas on why it opens a new VI instead of reuse that in memory.  Is there a setting somewhere which might explain why this happens on the test computer and not my development machine.

I'm trying to control a VI in c ++ using the LabVIEW VI 9 ActiveX Server, I build the application using MS VC ++ express 2010.  This VI (lets call him he is VI - a call node to get and set data on another VI - b.)  For the test I have a copy of the VI - b, which is empty, it loads in memory but does not work, it connects to the material I don't have in my development Setup.

#import "PATH\LaVIEW.tlb".

public static LabVIEW::_ApplicationPtr pLVApp = (LabVIEW::_ApplicationPtr) NULL;

public static LabVIEW::VirtualInstrumentPtr pVI (LabVIEW::VirtualInstrumentPtr) = NULL;

Sub init_VI()

{

Multithreaded application

CoInitializeEx (NULL, COINIT_MULTITHREADED);

pLVApp.CreateInstance ("LabVIEW.Application");

Error in checking not illustrated

return;

}

Sub connect_to_fp()

{

HRESULT hr = S_OK;

password char [60] = ' ';

VARIANT_BOOL reserveForCall = false;

long options = 0x20;

Multithreaded application

CoInitializeEx (NULL, COINIT_MULTITHREADED);

pVI.CreateInstance ("LabVIEW.VirtualInstrument");

pVI = pLVApp-> GetVIReference (vi_path, LPCTSTR (password), reserveForCall, options);

Error in checking not illustrated

HR = pVI-> OpenFrontPanel (VARIANT_TRUE, LabVIEW::eVisible)

return;

}

I couldn't try to comment the call to CreateInstance on the test computer.  However to remove it had no effect on my development machine.

Details of my configuration:

On my development machine, I can run VI - a before you begin application c ++ and it will connect and use the VI - a, which is already running in memory or can I leave application c ++ bring up VI - a.  When I was running a test recently, when I would get the reference to the VI - a it would open a new FP for VI - a (I guess it started a new instance of VI - has) instead use the one which is currently loaded and current execution, the VI - a also is not running as it normally does.  The VI - a gets its values of VI - b once to the init, but it will never update them again.  Also, there is a switch on the VI - a, which controls a status indicator that is not updated when the switch when it is activated.  There is another indicator on a separate tab that indicates how long a loop has been run that changes, that is why I believe that it is at least partially running.

My biggest problem is I have not been able to recreate it on my development machine.  Any time I open VI - a and run my application c ++ reuses this one rather than trying to open a new.  My connection code is about the Strait of c + c++ / ActiveX example of OR.

Thank you.

I have not found an answer to the slightest mistake out instead of creating a new instance, but I found a way to address the issue of the project.  If you create an instance, then open the project, and then open the VI of the proceeding of projects, it will work.  New init_VI:

Sub init_VI()

{

Multithreaded application

CoInitializeEx (NULL, COINIT_MULTITHREADED);

pLVMainApp.CreateInstance ("LabVIEW.Application");

pLVPrj = pLVMainApp-> OpenProject (PATH_TO_PROJECT);

pLVApp = pLVPrj-> GetApplication();

Error in checking not illustrated

return;

}

Tags: NI Software

Similar Questions

  • I can't follow the instructions because popup says Firefox already running; CLOSE button used to work, but does not work today.

    Sometimes when I open Firefox I get a box (must not have used the word POPUP - she distracted the search function)-in any case, a box saying Firefox is already running, and I click the button CLOSE FIREFOX and everything is fine but now CLOSE FIREFOX refuses to close firefox.

    Hello

    I'm glad to hear that your problem has been resolved. If you haven't already done so, please select the answer that solved the problem. This will help other users with similar problems more easily find the solution.

    Please contact the Mozilla Support.

  • I'm unable to start Firefox. To get the message that it is already running. Cannot find my profile using '% APPDATA%\Mozilla\Firefox\Profiles| '. What should I do

    I'm unable to start Firefox. To get the message that it is already running. Cannot find my profile using '% APPDATA%\Mozilla\Firefox\Profiles| '. Restarting my computer did not help. Because I had this problem I also noticed that all my favorites that I had copied in Windows Internet Explorer also disappeared. I use Firefox as my main search engine and usually do not use Internet Explorer. I am running Windows 7 on my machine.

    Try this add on the profile folder

  • Writing Excel using activeX - missing data after column IV

    Data size is about 400 (col) x 100 (row), save in excel using ActiveX, it cuts the data only with 256 columns, other IW data... are missed.

    How to solve this problem in LabVIEW? I save the file in .xlsx format.

    Pls ignore this question because I already solved the problem, thanks to you all!

  • "-2146827284" error code when you try to open a workbook using ActiveX

    Hi all

    I have a problem using ActiveX to open excel files. I get the error code '-2146827284' (unknown error) when trying to open a workbook. This problem occurs on a single machine, that I work with, on the other, it works very well. All machines have the same configuration, Excel97 and Excel2007 installed on them.

    Any ideas?

    Thank you


  • How to print a Word using ActiveX document

    How to print a Word using ActiveX document?

    Can I get a document to open and close. Impossible to find a way to have it printed. I think I looked through and I tried all the possible properties and methods, but I may have missed that I need.

    I would have preferred not to open the document if possible.

    Please point me in the right of ownership. For example?

    Thank you

    Chris


  • How to change the layout for a specific page in the document word using ActiveX?

    Hi all

    I'm generating report word using ActiveX. I want to change a particular landscape page. How can I do this using LabVIEW ActiveX.

    Kind regards

    Santhosh M

    Try this.

  • Management of Popups in Excel using ActiveX

    I'm having a problem similar to the problem that is referenced in this post:

    https://forums.NI.com/T5/LabVIEW/handling-popups-of-Excel-while-editing-it-via-Active-X-control/TD-p...

    The difference being...

    My company has a "database" Excel that stores all our product information. At the start of my application, I read this database using ActiveX. Recently this Excel sheet has been updated to include new features by someone else in my company.

    Now, when you open this particular spreadsheet, I get this message:

    It does not come to the front of the screen, and unless the user realizes that it is for the LabVIEW program seems to hang up, causing the user to close the LabVIEW program, because they do not realize that LabVIEW is waiting on Excel, which is waiting on the user to make a selection on this popup.

    In the post that I quoted above, they get around this by using a knot of property with the property 'Alerts', set to false. This works to hide mistakes but doesn't seem to work for this instance.

    Is it possible, via ActiveX, to "click" the button "Update only ' without the user having to do this.

    OR

    The worst case scenario, is there a way to bring this popup forward to alert the user that Microsoft Excel requires an entry?

    Thank you

    If someone stumbles on this page looking for a solution, here's how I ended up solving the problem:

    http://support.Microsoft.com/kb/826921

  • Missing profile - cannot create new one - uninstalled FF - revenue W8.1 said earlier - already running when you try to re - install FF - many reboots VIPRE IS

    original error was "already in the process of running FF" - not the view in the task manager - not could close - restarted several times - same results - uninstalled FF and tried the download & installation of new - same message "already running." W8.1 revenue by about 3 weeks (3 updates) - same result when installing FF = already "running." After the message "already running" is always the profile is missing or inaccessible.

    Do the same thing with TB BTW. Using the latest version of VIPRE internet security on automatic update. Nothing like on a W7 and XP machine on the same LAN. Is there a virus on corrupting FF? Scan VIPRE says nothing about the machine of 8.1...

    See:

    This is usually caused by a problem with the file profiles.ini and the profile marked as the default value = 1 in this file is no longer present on the hard drive.

    • Windows: %AppData%\Mozilla\Firefox\
      C:\Users\ < user > < profile > \AppData\Roaming\Mozilla\Firefox\Profiles\.
    • Linux: ~/.mozilla/firefox/
    • Mac: ~/Library/Application Support/Firefox /.

    You can use one of them to make the Creation/use of a new default profile for Firefox:

    • Remove the profiles.ini file to force Firefox to create a new default profile
    • Use the Profile Manager to create a new profile
    • Use "Choose a folder" when you create a new profile to select the location of a lost profile and recover this profile
  • I get a message "Firefox is already running but is not responding.". I did everything here Inc. uninstalled and re-installed. Help!

    I am using a HP desktop computer with Vista Home premium. I get a "Firefox is already running, but does not." message. I did everything on the other forums and it did not help. I even uninstalled and reinstalled Firefox. I still get the same message.

    You are able to start Firefox in Safe Mode or start the Profile Manager?

    (1) safe Mode

    It is a standard diagnostic tool to disable some advanced features of Firefox and extensions. More info: questions to troubleshoot Firefox in Safe Mode.

    You can start Firefox in Safe Mode by holding down the SHIFT key when you start Firefox. (If you get directly in a new window, you must exit all Firefox Windows first).

    A small dialog box should appear. Click on 'Start mode safe' (not reset).

    It will start?

    (2) the Profile Manager

    This assumes that firefox.exe is not running.

    Start in Manager profiles using Start > Search box (or run):

    firefox.exe -P
    

    When you get the Profile Manager window, do not delete anything!

    No matter what time you want to switch profiles, you exit Firefox and return to this dialog box.

    If you select your default profile and click Start, Firefox start?

  • How can I prevent the error "Firefox is already running" message while trying to open the links and FF has already been opened by a symbolic link?

    I use symbolic links and shortcuts of programs as a way to easily open different Firefox profiles IE. one for casual/personal use and the other for work. It works well, but I get the error message "Firefox is already running, but is not responding" if I try to open external links with FF as my default browser. FF is actually open and works very well, but I guess that it does not recognize this fact due to how I started the beginning of the process.

    I could not add executables symbolically related to the component of default program. Is there a way to get around this error or another way to solve this problem?

    The solution to the question below, it's what I use to open the different profiles of FF.

    http://superuser.com/questions/255312/pin-same-app-multiple-times-in-Windows-7

    Hello, it is probably the case when executing by default profile with the - non-interrupteur remote.
    http://KB.mozillazine.org/Profile_in_use

  • Firefox is already running but is not responding? Simple answers don't seem to work

    I started Firefox earlier today and received a message about a problem with Firefox and he had to be reset. Because the other option seemed worse than the reset, and Firefox Reseting seemed relatively painless, I clicked OK. A short message popped up on the registration of passwords, bookmarks, etc. with success. Then a small window pops up, saying it was cleaning of Firefox. While the process seemed to freeze. I liquidated it, killed at any process of firefox running and attempted to restart Firefox, when I received the message "Firefox is already running, but does not." There is a folder on my desktop labeled 'old Firefox data' which I assume is from Firefox reset (it is also now a copy of the profile on my desk, just in case).

    https://support.Mozilla.org/en-us/KB/Firefox-already-running-not-responding

    I found this and tried to work through it, but it doesn't seem to help.

    (1) Ther' are no Firefox.exe in my task manager, nor is there a process plugin-container.

    (2) I deleted the file "parent.lock" in both the profile (which is just a bunch of jumbled letters and numbers with 'default' in it) and the record of the old Firefox. However, these files were just "parent.lock" not "parent.lock.parentlock".

    (3) did not change the name on it, so unless the reset did before she locked herself, I don't know what to change it to.

    (4) it is not a file share, so...

    (5) this could be a possibility. The folder of Firefox that my profile is 'Read only' is, but I can't not to change cela. Everytime I go in, turn off the 'Read only' option and tell him to propagate the change through subfolders, it seems to work, but when I check the properties 10 seconds later, 'Read Only' is checked again.

    Sounds that the profiles.ini was corrupted when you remove the old default profile and adding the new profile.

    You can have security software that preventing to change the Firefox file.

    You use the Profile Manager to restore an existing profile or create a new profile.

    A "Reset" creates a new default profile with a timestamp attached and is trying to import some settings of the old profile, leaving the old profile intact, including the (invalid) cache folder (topic: cache) can take up to 1 GB.

    Versions of Firefox 15 + will move the old profile folder "old Firefox Data-#" folder on the desktop that gets a figure if you use reset several times, so you can no longer use the Profile Manager to return to the old profile.

    See also:

  • Firefox is already running?

    After following the instructions to stop firefox in the Task Manager (he was not also running), I tried to find my profile. I followed the instructions by going to the Start button and entering % APPDATA%\Mozilla\Firefox\Profiles\, but could not find a profile file. I have closed several times but still the same error message, so it is currently impossible to use firefox.
    Help please
    Arbrew

    You can use this button to go to the Firefox profile folder:

    • Help > troubleshooting information > profile directory: opens showing the file

    Use ' Firefox/file > output "(Mac: ' Firefox > quit smoking";) Linux: "file > exit ') to close Firefox if you're doing that by clicking on the X close in the title bar.

    See also:

  • If I close a session on Firefox and then try to reopen it, I get a screen that says "you must close your current session because Firefox is already running".

    The power went out, and when he returned, my computer seemed. I was able to access the internet through Firefox as usual. However, if I closed my session and tried to open it again, he would say that he had already opened a session and I have to close it before you try again. I have to go into the Task Manager and find Firefox in the list of processes and end the process in order to return to the internet. I tried to restart my computer twice. What could be the problem?

    Try to wait a little longer before you reopen Firefox to give Firefox more time to close completely.

    You can also try using Firefox/file > exit to close Firefox.

    See "hang out":

    See also:

  • Widespread problem "Firefox is already running" suggests it does not close properly - is Mozilla solve this?

    Several people including me have reported a problem when closing Firefox and then try to re - open. The message "FF is already running and should be closed... ' appears, but the taskbar does not display an active FF. At this point, it is necessary to use the Task Manager to close the old term.
    1 this not always the case on my computer has started recently.
    2. most of the time that it is indeed possible to open multiple versions of FF without difficulty. This problem only seems to happen if I close the first session and then immediately try to open a new.
    So my question is what causes this, not what workaround to usable solution when it occurs.

    1 both of these problems (ending to Firefox and restart) are a response

    http://dmcritchie.MVPs.org/Firefox/Firefox-problems.htm#close_firefox

    2. multiple versions of Firefox you have to use -no-remote on your combination of browser/profile not by default. Which cannot be by chance, so either you messed up in start parameters, or you didn't never have multiple versions of firefox running at the same time.

    Please mark "resolved" a response that will better help others with a similar problem - hope it was her.

Maybe you are looking for