Application Object
Is it possible to put an Object like a vector or anoter collection
in an application?
Something similar to session object
(or application.getiniParameter("") but I don't want to recover just a String).
Session.putValue("testmyobject", myvector)
thanks...
Heres a better example.. application scope can be confusing at first.
ServletContext application = getServletConfig().getServletContext();
String somethingToStore = "test";
application.setAttribute("app_level_variable", somethingToStore);
String somethingToRetreive = (String) application.getAttribute("app_level_variable");
this is mostly for servlet use.. jsps are really easy with the use of tags.
Similar Messages
-
Invalid method "Save As" from Excel application object
I have Windows 2000 and Excel 2002 installed on my machine.
I down loaded "renamed Excel 2000 workbook.vi" from NI website. Relinked ref num to Excel application object but get the error of invalid method (Save As). Tried to relink invoke node to Save As by selecting method from drop down menu. However this method is not on the list. Tried other excel objects but can not find "Save As" method. Has this been removed/moved?I was able to correct the error by relinking the Workbooks->Open to Open. This changes the subsequent Invoke Node from IAppEvents to _Workbook. There you will find the Save As method.
Michael
www.abcdefirm.com
Michael Munroe, ABCDEF
Certified LabVIEW Developer, MCP
Find and fix bad VI Properties with Property Inspector -
I need to get the Excel.application object from a window handle using AccessibleObjectFromWindow. I can't seem to make the code work. First, I successfully search for the XLMAIN windows. Then, when I get a handle, I execute the AccessibleObjectFromWindow
function. It seems to return a value of -2147467262 in all cases. Therefore, I believe that it is returning an error value. I can't figure out how to determine the meaning of this value.
If it is an error value, I believe that one or more arguments are in error. My best guess at present is that the GUID argument is incorrect. I have tried two GUID values: {00020400-0000-0000-C000-000000000046} and {90140000-0016-0409-0000-0000000FF1CE}.
I have seen both used in conjunction with OBJID_NATIVEOM. Neither one seems to work. I really would prefer not to use the second one as it has an Excel major and minor version number. I would hate to have to change this code, if a new minor version appeared.
The attached code has been commented to show which parts have been shown to work and which not. I'm at my wits end and really need help.
Thanks
'This module is located in Access 2010, but this is an Excel question.
Option Compare Database
Option Explicit
' Module-Level Declarations
'The GetDesktopWindow function and FindWindowEx function work just fine.
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) _
As Long
'I'm not getting the expected output from this function (see below)
Private Declare Function AccessibleObjectFromWindow& Lib "oleacc.dll" _
(ByVal hwnd&, _
ByVal dwId&, _
riid As GUID, _
xlwb As Object)
Type GUID
lData1 As Long
iData2 As Integer
iData3 As Integer
aBData4(0 To 7) As Byte
End Type
Function ExcelInstances() As Long
' Procedure-Level Declarations
' Value of OBJID_NATIVEOM verified by checking list of Windows API constants _
on this site: http://www.lw-tech.com/q1/base.htm
Const OBJID_NATIVEOM = &HFFFFFFF0
Dim hWndDesk As Long 'Desktop window
Dim hWndXL As Long 'Child window
Dim objExcelApp As Object 'Final result wanted: Excel application object
'Following variable (xlapp) to be set by AccessibleObjectFromWindow function
Dim xlapp As Object
Dim IDispatch As GUID 'GUID used in call to AccessibleObjectFrom Window function
'Set up GUID to be used for all instances of Excel that are found
Dim tmp1 As Variant 'Return value from AccessibleObjectFromWindow
' Executable Statements
SetIDispatch IDispatch
IDispatch = IDispatch
'Get a handle to the desktop
hWndDesk = GetDesktopWindow 'This seems to work
Do
'Get the next Excel window
'The following statement seems to work. We are finding and counting _
correctly all the instances of Excel. hWndXL is non-zero for each _
instance of Excel
hWndXL = FindWindowEx(GetDesktopWindow, hWndXL, "XLMAIN", vbNullString)
'If we got one, increment the count
If hWndXL > 0 Then
'This works. We correctly count all _
instances of Excel
ExcelInstances = ExcelInstances + 1
'Here is the problem. The following statement executes and returns a value of _
-2147467262. xlapp, which is passed by reference to AccessibleObjectFromWindow, _
is set to nothing. It should be set to the object for Excel.application. _
I believe that this value is not an object. I tried to reference tmp1. in the _
immediate window. There was no Intellisense.
'I think that the function in returning an error value, but I can't figure _
out what it is. I believe that AccessibleObjectFromWindow returns error _
values, but I don't know where to find their values so I can interpret the _
function's results.
'As best I can tell, the hWndXL parameter is correct. It is the handle for _
an instance of Excel. OBJID_NATIVEOM is set correctly (see constant declaration _
above). xlapp is passed by reference as a non-initialized object variable, which _
will be set by AccessiblObjectFromWindow. IDispatch may be the problem. It is set _
as shown below in the procedure SetIDispatch(ByRef ID As GUID). This procedure _
appears to work. I can see that IDispatch is set as I intended and correctly _
passed to AccessibleObjectFromWindow.
tmp1 = AccessibleObjectFromWindow(hWndXL, OBJID_NATIVEOM, IDispatch, xlapp)
'Need to write code to test tmp1 for error. If none, then set objExcelApp = _
object. Also, I exect xlapp to be set to Excel.application
End If
'Loop until we've found them all
Loop Until hWndXL = 0
End Function
Private Sub SetIDispatch(ByRef ID As GUID)
'Defines the IDispatch variable. The interface _
ID is {90140000-0016-0409-0000-0000000FF1CE}.
'NOT USING {00020400-0000-0000-C000-000000000046}, _
which could be the problem
'9 is release version - first version shipped (initial release)
'0 is release type - retail/oem
'14 is major version
'0000 is minor version
'0016 is product ID - MS Excel 2010
'0409 is language identifier - English
'0 is x86 or x64 - this is x86
'000 reserved
'0 is debug/ship
'000000FF1CE is office family ID
With ID
.lData1 = &H90140000
.iData2 = &H16
.iData3 = &H409
.aBData4(0) = &H0
.aBData4(1) = &H0
.aBData4(2) = &H0
.aBData4(3) = &H0
.aBData4(4) = &H0
.aBData4(5) = &HF
.aBData4(6) = &HF1
.aBData4(7) = &HCE
End With
End Sub
DaveInCalabasasI don't think you can return a reference to Excel's main window like that as you are attempting to do.
Ref:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd317978(v=vs.85).aspx
It's relatively straightforward to return any workbook's window in any given instance, and in turn it's parent Excel app. Try the following and adapt as required (and include error handling) -
Option Explicit
Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Private Declare Function IIDFromString Lib "ole32" _
(ByVal lpsz As Long, ByRef lpiid As GUID) As Long
Private Declare Function AccessibleObjectFromWindow Lib "oleacc" _
(ByVal hWnd As Long, ByVal dwId As Long, ByRef riid As GUID, _
ByRef ppvObject As Object) As Long
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type
Private Const S_OK As Long = &H0
Private Const IID_IDispatch As String = "{00020400-0000-0000-C000-000000000046}"
Private Const OBJID_NATIVEOM As Long = &HFFFFFFF0
Sub test()
Dim i As Long
Dim hWinXL As Long
Dim xlApp As Object ' Excel.Application
Dim wb As Object ' Excel.Workbook
hWinXL = FindWindowEx(0&, 0&, "XLMAIN", vbNullString)
While hWinXL > 0
i = i + 1
Debug.Print "Instance_" & i; hWinXL
If GetXLapp(hWinXL, xlApp) Then
For Each wb In xlApp.Workbooks
Debug.Print , wb.Name
Next
End If
hWinXL = FindWindowEx(0, hWinXL, "XLMAIN", vbNullString)
Wend
End Sub
'Function GetXLapp(hWinXL As Long, xlApp As Excel.Application) As Boolean
Function GetXLapp(hWinXL As Long, xlApp As Object) As Boolean
Dim hWinDesk As Long, hWin7 As Long
Dim obj As Object
Dim iid As GUID
Call IIDFromString(StrPtr(IID_IDispatch), iid)
hWinDesk = FindWindowEx(hWinXL, 0&, "XLDESK", vbNullString)
hWin7 = FindWindowEx(hWinDesk, 0&, "EXCEL7", vbNullString)
If AccessibleObjectFromWindow(hWin7, OBJID_NATIVEOM, iid, obj) = S_OK Then
Set xlApp = obj.Application
GetXLapp = True
End If
End Function
Note as written if an instance does not have any loaded workbooks a reference will not be returned (though a workbook can be added using DDE, but convoluted!)
FWIW there are two other very different approaches to grab all running Excel instances though something along the lines of the above is simplest.
Peter Thornton -
Error 1603 in deploying Office 2003 by creating an application object using its MSI package!
Hello,
I got the error of 1603 when I ran Office 2003 MSI package through NAL. I
have no idea how to resolve this problem. Even though I enabled logging in
Office 2003 installation, I still could not figure out what went wrong and
what caused the error.
I have used Snapshot to create an application object for a long time with
little problem. However, I could not successfully deploy any MSI package
created by an application object. I knew ZenWork Managing Application has
the feature, but I don't know how to make it work in our environment.
Do I have to know more about Microsoft Window Installer ?
Appreciate your comments and experience in advance
Thanks
Joe Liu
email: [email protected][email protected],
> I got the error of 1603 when I ran Office 2003 MSI package through NAL
>
Start here:
http://support.novell.com/techcenter...tation&x=0&y=0
Yes, understanding MSI helps. FWIW I have deployed 2003 this way.
- Anders Gustafsson, Engineer, CNE6, ASE
NSC Volunteer Sysop
Pedago, The Aaland Islands (N60 E20)
Novell does not monitor these forums officially.
Enhancement requests for all Novell products may be made at
http://support.novell.com/enhancement
Using VA 5.51 build 315 on Windows 2000 build 2195 -
How to create Illustrator COM application Object in Invisible manner?
Hi,
I added CS6 COM reference in my VB.NET application and after that I have the following basic object creation in order to convert a eps file to svg. But for some reason when I create this COM object it is launching the Adobe Illustrator application. Why it is doing like this? It’s a simple COM object why it is interacting with Illustrator Editor? Could you guide me how to take care this issue please?
Thanks
SGI am going to post a reply here from our other posts... http://forums.adobe.com/message/4692998#4692998
your last post from other message:
Let’s forget about VB part, even in Java script how do we create the Illustrator instance without bring Illustrator IDE up when you create the application object. It’s a COM component right, why would it bring up the UI? Do you have any simple example in Javascript please?
To the best of my knowledge in order to access the Illustrator object model that the application must be running through JavaScript since scripts are run via the UI.
I did find this in the documentation in refference to VB.
CreateObject launches Illustrator as an invisible application if it is not already running. If Illustrator is
launched as an invisible application you must manually activate the application to make it visible:
Set appRef = CreateObject("Illustrator.Application")
So instead of "As New" try "CreateObject"...
Just a guess really -
Access jsp's application object from an .java file?
Hi,
I hava a .jsp page and an import statement to a .java file. How can I access the application object in this .java file?
I want to make an initialization function that I want to be called in every .jsp of the WEB application and to store this function in a .java file.The only way to get a hold of the application object would be to pass it to java code as a parameter to a method.
ie public class Util{
public void initialiseJSPPage(ServletContext application){
// do stuff in ServletContext
}and then in the JSP call it via
<% Util.initialiseJSPPage(application); %>
You could manually include this code on every JSP.
A better alternative is that in web.xml you can configure an automatic include (See JSP.3.3.5)
What is it you are trying to accomplish by doing this?
Would a Filter be a more appropriate tool in this case? That would let you run java code before selected requests are handled.
Cheers,
evnafets -
Report by Application Object Name
have zen7sp1ir1
i want to generate a report, by application object name, if it is
distributed to the workstation. ( sucssess failed etc )
is it possible to do so? how ?
helgeHelge,
It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.
Has your problem been resolved? If not, you might try one of the following options:
- Visit http://support.novell.com and search the knowledgebase and/or check all
the other self support options and support programs available.
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://support.novell.com/forums)
Be sure to read the forum FAQ about what to expect in the way of responses:
http://support.novell.com/forums/faq_general.html
If this is a reply to a duplicate posting, please ignore and accept our apologies
and rest assured we will issue a stern reprimand to our posting bot.
Good luck!
Your Novell Product Support Forums Team
http://support.novell.com/forums/ -
IDOC - process code with error "Application Object Type not planned'
Hi all,
I am doing an inbound idoc.... in TCODE we42, i trying to put function module which i created, attached to the process code.
However, when i put my function module ZIDOC_INBOUND to the process code... it comes out error, 'Application Object Type not planned.'
Why is this so?
Please advice...
Thanks and regards...
William WilstrothHI all,
I had solved this problem. I should have gone to we57 to tie the function module.
thanks.
William Wilstroth -
Application object content search across multiple (many) objects
Hi guys,
I have about 500 application objects and one of these is pushing through
a bad registry setting.
I know what the setting is, but how do I search across all of them quickly.
Thank you,The easiest thing to do is to search c:NALCACHE for the string desired.
I don't have ZEN at my current location so I can't be 100% sure, but I
believe much of the info in these cache files is stored in pseudo
english so a search may work.
The info is stored in DS in a manner that is less easily retrievable.
(I.E., Pull up DSReports and browse the object, you will not see all of
the entries.)
As I am thinking, at my last job I ran a nightly routine that exported
all apps to AOTs using the ZFD3 toolkit and than ran another tool from
the kit to convert the AOTs to AXTs. Then I could do an easy file find
on all of my apps. The list of apps was generated using a tool from
JRBSoftware. I don't have the script anymore, but is you are skilled at
scripting, that may give you an idea for something that my become a
multi-purpose tool for you.
chebarushka wrote:
> Hi guys,
>
> I have about 500 application objects and one of these is pushing through
> a bad registry setting.
>
> I know what the setting is, but how do I search across all of them quickly.
>
> Thank you,
Craig Wilson
Novell Product Support Forum Sysop
Master CNE, MCSE 2003, CCN -
Random application object lost in Portal
Hi people,
I'm having a problem with the application object.
Some times, in a random way, i'm losing the state of the application object between request's.
This appens when I'm using the BSP application in the SAP Portal.
Thanks,
Paulo RuivoHi,
the problem is that in the url I pass a parameter that in the bsp page copy to an attribute of the application.
Then in the controler i try to read this value and it is empty, all the information in application object is lost.
This appens during one single request.
I have several Iviews pointing to the same BSP application, the diference between the content that is shown is controled by the parameter passed in the URL.
Is it possible that while navigating between iviews, the info in the BSP application is mix up. Something like the aplication start (iview open) and then been close (previous iview close)?
Thanks for the help.
Paulo Ruivo -
Outlook.Application Object
Hello Experts,
i am using the 'Outlook.Application' object to create a new outlook email item in my ABAP code. everything is fine except when i'm creating an attachment, i don't know how to attach a file to my email. My code look like this.
REPORT ztest_outlookobject .
INCLUDE ole2incl .
DATA: lr_outlook TYPE ole2_object,
lr_mi TYPE ole2_object,
lr_at TYPE ole2_object.
CREATE OBJECT lr_outlook 'Outlook.Application'.
CALL METHOD OF lr_outlook 'CreateItem' = lr_mi
EXPORTING #1 = 0.
GET PROPERTY OF lr_mi 'Attachments' = lr_at.
CALL METHOD OF lr_at 'Add' = 'C:\eraseable.xls'. "<<< the problem is here >>>
SET PROPERTY OF lr_mi 'To' = 'Bai Cil'.
SET PROPERTY OF lr_mi 'CC' = '[email protected]'.
SET PROPERTY OF lr_mi 'Subject' = 'Your subject'.
SET PROPERTY OF lr_mi 'Body' = 'Some text'.
CALL METHOD OF lr_mi 'Display'.
FREE OBJECT lr_outlook.
but i'm getting this error: "'C:\eraseable.xls'" cannot be changed. -
Thanksthanks guys.
i found the answer. here it is.
CALL METHOD OF lr_at 'Add'
EXPORTING #1 = 'C:\eraseable.xls'. -
the "application" object can be called within a JSP file.
What if I wanna call it within a JavaBean class? How do I instantiate it?The application object is the servletcontext that is passed to the servlet/JSP by the server during initialization. If you want to use it in a JavaBean you'll have to pass it in.
<jsp:useBean id="myBean" scope="session" class="beans.MyBean" />
<% myBean.setApplication(application); %>
and in MyBean
import javax.servlet.*;
public class MyBean {
ServletContext sc;
public MyBean() { }
public void setApplication(ServletContext inSC) { this.sc = inSC; }
} -
Hi,
Can anyone give the exact definition of what AOL is?
And what all setups comes under AOL?
Thanks in Advance.You can find the list of Oracle Application Object Library (FND) database objects by using the following query:
SQL> select owner, object_type, object_name
from dba_objects
where object_name like 'FND%';FND files can be located under $FND_TOP.
For more details about Oracle Application Object Library (FND), refer to [Oracle Applications Concepts|http://download-uk.oracle.com/docs/cd/B25516_14/current/acrobat/11iconcepts.pdf] Manual. -
Application Object in Controllers
Hi to all,
In MVC based BSP application how to access application class in controller and models?
I had seen application attributes in controller class.
Suggest me how to use data binding using example, if there.
Regards,Hi Bhupendra Singh,
Data: co_application type ref to <Application class name>.
CREATE OBJECT co_application TYPE <Application class name>.
Create a page attribute in your view namely...
vi_application type ref to <Application class name>
Now it the controller add the lines below for assigning the controller's application class object to the view's application object in the page attribute.
Data: main_view type ref to if_bsp_page.
main_view = create_view( view_name = 'exercise.htm' ).
main_view->set_attribute( name = 'vi_application'
value = co_application ).
Hope it solves your problem.
Regards,
Maheswaran.B -
Application Object to capture system information
I need to capture some information on a system such as machine name, IP
address, and MAC address. I built an application object based on
Coolsolutions article
http://www.novell.com/coolsolutions/...dress2_zw.html
My question is, how do I capture the MAC address of the PC? When I use
"%Physical_Station%, it returns the IP address only.
DarrellI have a few apps that capture this information for misc purposes.
I've actually just run a batch file or other scripting program that runs
IPCONFIG /ALL > %TEMP%\INFO.TXT and then pulls the MAC Info out of this file.
Darrell wrote:
> I need to capture some information on a system such as machine name, IP
> address, and MAC address. I built an application object based on
> Coolsolutions article
> http://www.novell.com/coolsolutions/...dress2_zw.html
>
> My question is, how do I capture the MAC address of the PC? When I use
> "%Physical_Station%, it returns the IP address only.
>
> Darrell -
Application Object In Servlets
First off, I'm new to writing servlets so forgive my ignorance...
How do I get the application object within the init method of an HttpServlet? I want to call some methods on it (e.g. getRealPath) but I get compile errors because I'm not sure how to get the application object.public void init(ServletConfig config) {
ServletContext sc = config.getServletContext();
String path = sc.getRealPath("/"); // or something like that
}
Maybe you are looking for
-
I can't play a movie on my iPod touch!
I have a problem: When I try to play a movie I bought from iTunes months ago, it shows me this advice "the requested URL was not found on this server". What does that mean??? Cause I have played that movie last week and it was fine. Please
-
Is it possible to test XI Adapter on PCK by JNDI lookup?
Hi, friends I can't test the XI Adapter by using the communication channels and sender/receiver agreements on a standalone PCK (without XI server to be connected). Is it possible to test XI Adapter on PCK by JNDI lookup? I can locate the XI Adapter b
-
my powerbook screen has an irritating problem. Out of nowhere it goes black and then the whole thing goes to sleep. When you press a key the computer wakes up for maybe a second or 2-enough time to show display then goes black again. Right now its wo
-
When is the next software update going to be for t...
comon nokia please make an new update for the n73
-
Hi. I'm not sure why my address book isn't syncing with my .Mac address book. I've seemingly done everything- hit sync in the System Prefs- so that it will sync the address book. It says it is successful. Then I go to my address book on .Mac website