Raise an event with no arguments from a COM server to be consumed by a COM client
In VB.net I can declare and raise an event like this
Public Event SomeEvent()
Public Sub SomeMethod
RaiseEvent SomeEvent()
End Sub
I need to work out how to do this in c# however all of the examples of raising events include event handlers. This won't work for me as I am raising this event over a COM interface, and so I can't send eventargs or non basic types through the interface
to the client application.
In my previous question it was suggested that I use Action and do the following
public class MyClass
public event Action MyEvent;
public void RaiseMyEvent() {
if(MyEvent != null) {
MyEvent();
MyClass myObject = new MyClass();
myObject.MyEvent += () =>
//handle...
myObject.RaiseMyEvent();
However when I tried this over the COM interface I got the following error
An exception of type 'System.InvalidCastException' occurred in AdtakerInterfaceSampleCsharp.exe but was not handled in user code
Additional information: Unable to cast object of type 'System.__ComObject' to type 'System.Action'."
The reason that I need to do this is that I am registering application A on the running object table so that I can use
Marshal.GetActiveObject in Application B to attach to the currently running process. This is currently working fine for one way communication, however I need to be able to raise events from Application A that will be received by Application B.
@CoolDadTX -That's because I've written com servers in the past using VB.net, however they were not registered with the Running object table.
What I'm trying to do in this case is have an application that will be started by the user, and then they will start another application written in .Net to connect to that first application. The reason for this is that we have an application
written in an old version of smalltalk that doesn't seem to support getObject but can create an IUknown, and we already have base classes to attach to COM objects written in .Net. As this new application needs to be started first it can't be tightly
coupled to the legacy application, so we are trying to register the new application and then connect a Dotnet Client that is being started through a COM Interface from the legacy application. I know it's convoluted but we need to keep the legacy
application alive for a bit longer while we rewrite it as an add-in for the new application.
The article that you linked to has been very helpful on the server side, but do you have any ideas as to how I can connect the sink on the client side in C#?
Similar Messages
-
Raise an event with no arguments
In VB.net I can declare and raise an event like this
Public Event SomeEvent()
Public Sub SomeMethod
RaiseEvent SomeEvent()
End Sub
I need to work out how to do this in c# however all of the examples of raising events include event handlers. This won't work for me as I am raising this event over a COM interface, and so I can't send eventargs or non basic types through the interface
to the client application.OK, Action doesn't work as I end up with the following error
An exception of type 'System.InvalidCastException' occurred in AdtakerInterfaceSampleCsharp.exe but was not handled in user code
Additional information: Unable to cast object of type 'System.__ComObject' to type 'System.Action'.
You asked how to raise an event with no arguments in C# and I gave you the solution for this. You could certainly use an Action to raise an event with no arguments as my sample code clearly demonstrates.
How to call your specific COM interface is a totally different topic.
Please start a new thread if you have a new question. You may also want to provide some more details if you want anyone to be able to help you with this. Remember that the forums are for helping solving specific issues though, they are not for anyone to
write an entire application, class or module for you :) -
New event with no sound from iPhone
When I set a new event with an alert from iPhone, on iCal of my iMac (synched via Mobile Me) I always got as alert a "message with no sound". How can I get an alert with sound (on my iMac) when I set a new event from the iPhone?
First of all check the volume buttons....if they are fine
Try and do the basic operations...
- reboot - reset
- if it is still not working then once try restoring it through itunes....it should solve most of the problems...
- if it still exists then it must be a hardware issue...if u r under the warranty period then apple will replace it for sure....
hope this helps you...
if u need anything else then please reply...happy to help.... -
How do we raise an event into R/3 from a BW info-package ?
Hi friends,
Is there a way to raise an event from a BW stand-along info-package into the R/3 system, without using Event Collector..?
I cannot use the subsequent event option in the package itself since that will raise the event only into BW. I want it into R/3. I can probably raise an event from the package to start a process-chain and then add a step in the PC to run a pgm to raise an event into R/3.
But I am trying to see if there is a better and simpler way without having to create a extra PC.
I am on the BW 3.1 system.
Any suggestions/solutions will be greatly appreciated.
Thanks
lz70d71hi, here is what you do: This addition is with respect to the previous reply
You need an event from BW to R/3
Step1: create a custom FM copy of BP_EVENT_RAISE and making it rfc enable. To make a FM RFC enabled you just need to tick the radio button in the attributes of the FM.
Step2: Create a custome z program in BW and call FM z_bp_event_raise created in ECC.
Step3: call that program in Process chain.
hope this helps. if you need more let me know.
thanks
syed -
Call procedure with MS SQL from linked Oracle server
I have a procedure on a remote server that I can call from SQL*PLUS
set serveroutput on
declare rez varchar2(99); msg varchar2(99); begin radar.test('AL25',rez,msg); dbms_output.put_line('Rez='||rez);
dbms_output.put_line('Msg='||msg);
end;
it gives me the neccessary result.
But I need to call the same procedure with MS SQL from a linked Oracle server, I'm trying to do it through openquery for a while, but no success yet.
Can someone tell me what is the right syntax for that query in OPENQUERY?Have you tried configuring Oracle Heterogenous Services/ Transparent Gateway? This would let you link Oracle to SQL Server via a database link which should solve your problem.
Justin
Distributed Database Consulting, Inc.
www.ddbcinc.com -
Performance issues home sharing with Apple TV2 from Mountain Lion Server
I have a Mac Mini which I have just upgraded to Mountain Lion Server from Snow Leopard Server.
I have noticed that the performance of Streaming a film using Home Sharing to an Apple TV2 has degraded compared to the Snow Leopard setup. In fact the film halts a number of times during play back which is not ideal.
I have tested the network between the 2 devices and cannot find a fault.
Has anyone come across this problem before.
Are there any diagnostic tools I can use to measure the home sharing streaming service to the AppleTV2 device.
Any help much appreciatedWell, I tried a few other things and one worked but again just the first time I tried connecting to the desktop PC with iTunes. I flashed my router with the latest update and the ATV2 could see the iTunes library and I was able to play media. Later in the day I was going to show off to my daughter that I had fixed it and, to my dismay, no go. I tried opening the suggested ports but no luck.
I then tried loading iTunes on a Win7 laptop and it works perfectly with the ATV2. Both the laptop and the ATV2 are connected to the router wirelessly while the Desktop is connected to the router by Ethernet. Not sure if this is part of the issue as it sounds like this didn't work for others. The only other difference between the laptop and desktop is that the desktop has Win7 SP1 loaded while the laptop does not; now I'm scarred to load it though I don't think that's the issue. All in all, a very vexing situation. Hopefully Apple comes up with a solution soon. -
Call method with an argument from another view controller
I have a UIViewController MainViewController that brings up a modal view that is of the class AddPlayerViewController. When the user clicks 'Save' in the modal view I need to pass the Player data (which is a Player class) from the modal view to the MainViewController in addition to triggering a method in the MainViewController. What's the best way to accomplish this? I'm new to cocoa and have only tried using delegates and some ugly hacks to no avail.
Thanks for the help.If I understand correctly, you have:
1. A model object, Player.
2. A top view controller, MainViewController.
3. Another view controller, AddPlayerViewController, which MainViewController displays modally.
I'm guessing that AddPlayerViewController creates a new Player object and lets the user set its values, and you need a way to get that new Player into MainViewController once they're done.
So, here's what I'd do:
1. Create an AddPlayerViewControllerDelegate protocol. It should declare two methods, "- (void)addPlayerViewController:(AddPlayerViewContrller*)controller didAddPlayer:(Player*)newPlayer" and "- (void)addPlayerViewControllerNotAddingPlayer:(AddPlayerViewController*)controll er".
2. Add an attribute of type "id <AddPlayerViewControllerDelegate>" called delegate to AddPlayerViewController. Also add a property with "@property (assign)" and "@synthesize".
3. Modify AddPlayerViewController so that if you click the "Save" button, addPlayerViewController:didAddPlayer: gets called, passing "self" and the new Player object as the two arguments. Also arrange for clicking the "Cancel" button to call addPlayerViewControllerNotAddingPlayer:.
4. Modify MainViewController to declare that it conforms to AddPlayerViewControllerDelegate. Implement those two methods (addPlayerViewControllerNotAddingPlayer: might be an empty method if you don't want to do anything).
5. When you create your AddPlayerViewController, set its delegate to your MainViewController.
If you need more detail, let me know what parts you need me to elaborate on. -
Running python script with system arguments from applescript
Hi,
I am trying to run a python code from within applescript. A string should be passed as an argument to the python script, i.e. from the terminal, I would do the following
cd /Users/thatsme/Library/Scripts/myfolder
python my_python_file.py abcdefg
There are two ways I figure I could do this in applescript. "abcdefg" are contained in the variable strNote
a) directly:
do shell script "cd /Users/thatsme/Library/Scripts/myfolder; python my_python_file.py " & strNote
b) calling Terminal
tell application "Terminal"
activate
do script "cd /Users/claushaslauer/Library/Scripts/OO_latex; python my_python_file.py " & strNote
end tell
I would prefer option a) as I don't really want to have Terminal windows popping up. The strange thing is, that I see in the applescript results window the result of the print statements in the python script, but no output is generated (the python script contains a few os.system() commands.
Option b) does what it is supposed to be doing, however, applescript does not wait until the script is finished running.
Why does option a) nor work, and what do I need to change to make it work?Thank you guys for your help, this is really weird.
Here is my full applescript
set strNoteQ to "1+1=2"
(* for whatever reason, this does not work *)
do shell script "cd /Users/claushaslauer/Library/Scripts/OO_latex; python create_latex_pdf.py " & strNoteQ
Below is my python skript.
When I call it as
python create_latex_pdf.py 1+1=2
it creates a wonderful pdf.
With the applescript above, it prints the print statements, it also generates the latex file temp.tex -- correctly, so I assume the string in this example is ok.
However, it does not execute the latex related commands (the three os.system calls)
Is it not a good idea / not possible to execute os.system in a python script that is called from applescript? <sorry if I had brought all the attention to the string issue>
here is the python script:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import datetime
import time
def main():
str_latex_note = sys.argv[1]
print "%s" % str_latex_note
preamble = """\documentclass{article}
\usepackage{amsmath,amssymb}
\pagestyle{empty}
\\begin{document}
{\huge
%s
\end{document}"""% (str_latex_note)
## write latex file
cur_path = r'/Users/mypath/Library/Scripts/OO_latex'
cur_file = "temp.tex"
fobj = open(os.path.join(cur_path, cur_file), 'w')
fobj.writelines(preamble)
fobj.close()
## process latex file
print cur_path
os.chdir(cur_path)
cmd = 'latex temp.tex'
print cmd
print "running latex"
os.system(cmd)
cmd2 = 'dvips -E -f -X 1200 -Y 1200 temp.dvi > temp.ps'
print "running dvips"
os.system(cmd2)
cmd3 = 'epstopdf temp.ps'
print "running epstopdf"
os.system(cmd3)
print "done!"
if __name__ == '__main__':
main() -
How to send e-mail with an attachment from remote database server.???
Hi All,
I have tried the simple mail sending and with the attachment using UTL_SMTP. But the problem is , it is sending the mail with attachment of the file name i give, it takes and creates that file and sends as attachment not from the actual file location. I am trying to attach the file which i stored in remote database server.
The following code I tried. But not worked for attachment
DECLARE
v_From VARCHAR2(80) := '[email protected]';
v_Recipient VARCHAR2(80) := '[email protected]';
v_Subject VARCHAR2(80) := 'test subject';
v_Mail_Host VARCHAR2(30) := 'pop3.somedomain.com';
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
BEGIN
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
utl_smtp.Mail(v_Mail_Conn, v_From);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
utl_smtp.Data(v_Mail_Conn,
'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
'From: ' || v_From || crlf ||
'Subject: '|| v_Subject || crlf ||
'To: ' || v_Recipient || crlf ||
'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard
'Content-Type: multipart/mixed;'|| crlf ||
' boundary="-----SECBOUND"'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: text/html;'|| crlf ||
'Content-Transfer_Encoding: 7bit'|| crlf ||
crlf ||
'some message text'|| crlf || -- Message body
'more message text'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: text/html;'|| crlf ||
' name="Fund Authorization report"'|| crlf ||
'Content-Transfer_Encoding: 8bit'|| crlf ||
'Content-Disposition: attachment;'|| crlf ||
' filename="/usr/tmp/Test.html"'|| crlf ||
crlf ||
'HTML Attachment'|| crlf || -- Content of attachment
crlf ||
'-------SECBOUND--' -- End MIME mail
utl_smtp.Quit(v_mail_conn);
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;How can I attach a file which is stored in database server and send it in a mail.
Please someone help me in this.
Thanks,
Alaka.Try this code
Regards Salim.
CREATE OR REPLACE TRIGGER EmailOnServerErr AFTER SERVERERROR ON DATABASE
DECLARE
mail_conn UTL_SMTP.connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
msg VARCHAR2(32760);
sid_name VARCHAR2(16);
bdump_dest VARCHAR2(128);
smtp_relay VARCHAR2(32) := 'MyMailRelay';
recipient_address VARCHAR2(64) := '[email protected]';
sender_address VARCHAR2(64) := '[email protected]';
mail_port NUMBER := 25;
log_file_handle UTL_FILE.FILE_TYPE;
log_file_dir VARCHAR2(256) := 'ERR_LOG_DIR';
log_file_name VARCHAR2(256) := 'OracleErrors.log';
maxlinesize NUMBER := 32767;
session_rec sys.v_$session%ROWTYPE;
audit_rec sys.dba_audit_trail%ROWTYPE;
auditing BOOLEAN;
LinesOfSQL BINARY_INTEGER;
offending_sql DBMS_STANDARD.ora_name_list_t;
CURSOR bdump_cur IS
SELECT TRIM(value)
FROM v$parameter
WHERE name = 'background_dump_dest'
CURSOR sid_cur IS
SELECT TRIM(instance_name)
FROM v$instance
CURSOR session_cur IS
SELECT s.*
FROM v$session s
WHERE s.sid = dbms_support.mysid
CURSOR audit_trail_cur(AUDSID IN NUMBER) IS
SELECT *
FROM dba_audit_trail
WHERE sessionid = AUDSID
BEGIN
IF (USER = 'SYSTEM' OR USER = 'SYS') THEN
-- Ignore this error
NULL;
ELSIF IS_SERVERERROR (1034) THEN
-- Ignore this error
NULL;
ELSE
-- get the sid
OPEN sid_cur;
FETCH sid_cur INTO sid_name;
CLOSE sid_cur;
-- get the location of the alert log
OPEN bdump_cur;
FETCH bdump_cur INTO bdump_dest;
CLOSE bdump_cur;
-- get the session information
OPEN session_cur;
FETCH session_cur INTO session_rec;
CLOSE session_cur;
-- get the audit_trail information if it exists
OPEN audit_trail_cur(session_rec.audsid);
FETCH audit_trail_cur INTO audit_rec;
auditing := audit_trail_cur%FOUND;
CLOSE audit_trail_cur;
IF session_rec.program = 'MyProgram.exe' THEN
NULL; -- ignore actions from MyProgram - that's where I do maintenance
ELSE
-- compose the message
msg := 'Subject: Oracle error '||' on '||sid_name||crlf;
msg := msg||'To: '||recipient_address||crlf;
msg := msg||'For more information see the alert log file located at:'||crlf;
msg := msg||bdump_dest||'/alert_'||sid_name||'.log'||crlf;
msg := msg||'or the error log file: $'||log_file_dir||'/'||log_file_name||crlf;
msg := msg||'Error Time='||TO_CHAR(SYSDATE,'DD-Mon-YYYY HH24:MI:SS')||crlf;
msg := msg||DBMS_UTILITY.FORMAT_CALL_STACK||crlf;
LinesOfSQL := sql_txt(offending_sql);
msg := msg||'Offending SQL is:'||crlf;
FOR loop_counter IN offending_sql.FIRST..offending_sql.LAST
LOOP
msg := msg||offending_sql(loop_counter);
END LOOP;
msg := msg||crlf||'----- PL/SQL Error Stack -----'||crlf;
msg := msg||DBMS_UTILITY.FORMAT_ERROR_STACK||crlf;
msg := msg||'V$SESSION.SADDR=' ||session_rec.saddr ||crlf;
msg := msg||'V$SESSION.SID=' ||session_rec.sid ||crlf;
msg := msg||'V$SESSION.SERIAL#=' ||session_rec.serial# ||crlf;
msg := msg||'V$SESSION.AUDSID=' ||session_rec.audsid ||crlf;
msg := msg||'V$SESSION.PADDR=' ||session_rec.paddr ||crlf;
msg := msg||'V$SESSION.USER#=' ||session_rec.user# ||crlf;
msg := msg||'V$SESSION.USERNAME='||session_rec.username||crlf;
msg := msg||'V$SESSION.COMMAND=' ||session_rec.command ||crlf;
msg := msg||'V$SESSION.OWNERID=' ||session_rec.ownerid ||crlf;
msg := msg||'V$SESSION.TADDR=' ||NVL(session_rec.taddr ,'Null')||crlf;
msg := msg||'V$SESSION.LOCKWAIT='||NVL(session_rec.lockwait,'Null')||crlf;
msg := msg||'V$SESSION.STATUS=' ||NVL(session_rec.status ,'Null')||crlf;
msg := msg||'V$SESSION.SERVER=' ||NVL(session_rec.server ,'Null')||crlf;
msg := msg||'V$SESSION.SCHEMA#=' ||session_rec.schema#||crlf;
msg := msg||'V$SESSION.SCHEMANAME=' ||NVL(session_rec.schemaname,'Null')||crlf;
msg := msg||'V$SESSION.OSUSER=' ||NVL(session_rec.osuser ,'Null')||crlf;
msg := msg||'V$SESSION.PROCESS=' ||NVL(session_rec.process ,'Null')||crlf;
msg := msg||'V$SESSION.MACHINE=' ||NVL(session_rec.machine ,'Null')||crlf;
msg := msg||'V$SESSION.TERMINAL=' ||NVL(session_rec.terminal ,'Null')||crlf;
msg := msg||'V$SESSION.PROGRAM=' ||NVL(session_rec.program ,'Null')||crlf;
msg := msg||'V$SESSION.TYPE=' ||NVL(session_rec.type ,'Null')||crlf;
msg := msg||'V$SESSION.SQL_ADDRESS=' ||session_rec.sql_address ||crlf;
msg := msg||'V$SESSION.SQL_HASH_VALUE=' ||NVL(TO_CHAR(session_rec.sql_hash_value) ,'Null')||crlf;
msg := msg||'V$SESSION.PREV_SQL_ADDR=' ||session_rec.prev_sql_addr||crlf;
msg := msg||'V$SESSION.PREV_HASH_VALUE='||NVL(TO_CHAR(session_rec.prev_hash_value),'Null')||crlf;
msg := msg||'V$SESSION.MODULE=' ||NVL(session_rec.module ,'Null')||crlf;
msg := msg||'V$SESSION.MODULE_HASH='||NVL(TO_CHAR(session_rec.module_hash),'Null')||crlf;
msg := msg||'V$SESSION.ACTION=' ||NVL(session_rec.action ,'Null')||crlf;
msg := msg||'V$SESSION.ACTION_HASH='||NVL(TO_CHAR(session_rec.action_hash),'Null')||crlf;
msg := msg||'V$SESSION.CLIENT_INFO='||NVL(session_rec.client_info ,'Null')||crlf;
msg := msg||'V$SESSION.FIXED_TABLE_SEQUENCE='||NVL(TO_CHAR(session_rec.fixed_table_sequence),'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_OBJ#=' ||NVL(TO_CHAR(session_rec.row_wait_obj#) ,'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_FILE#=' ||NVL(TO_CHAR(session_rec.row_wait_file#) ,'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_BLOCK#='||NVL(TO_CHAR(session_rec.row_wait_block#),'Null')||crlf;
msg := msg||'V$SESSION.ROW_WAIT_ROW#=' ||NVL(TO_CHAR(session_rec.row_wait_row#) ,'Null')||crlf;
msg := msg||'V$SESSION.LOGON_TIME=' ||NVL(TO_CHAR(session_rec.logon_time,'DD-Mon-YYYY HH24:MI:SS'),'Null')||crlf;
msg := msg||'V$SESSION.LAST_CALL_ET=' ||NVL(TO_CHAR(session_rec.last_call_et) ,'Null')||crlf;
msg := msg||'V$SESSION.PDML_ENABLED=' ||NVL(session_rec.pdml_enabled ,'Null')||crlf;
msg := msg||'V$SESSION.FAILOVER_TYPE=' ||NVL(session_rec.failover_type ,'Null')||crlf;
msg := msg||'V$SESSION.FAILOVER_METHOD='||NVL(session_rec.failover_method,'Null')||crlf;
msg := msg||'V$SESSION.FAILED_OVER=' ||NVL(session_rec.failed_over ,'Null')||crlf;
msg := msg||'V$SESSION.RESOURCE_CONSUMER_GROUP='||NVL(session_rec.resource_consumer_group,'Null')||crlf;
msg := msg||'V$SESSION.PDML_STATUS=' ||NVL(session_rec.pdml_status ,'Null')||crlf;
msg := msg||'V$SESSION.PDDL_STATUS=' ||NVL(session_rec.pddl_status ,'Null')||crlf;
msg := msg||'V$SESSION.PQ_STATUS=' ||NVL(session_rec.pq_status ,'Null')||crlf;
IF auditing THEN
msg := msg||'DBA_AUDIT_TRAIL.OS_USERNAME=' ||NVL(audit_rec.os_username,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.USERNAME=' ||NVL(audit_rec.username ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.USERHOST=' ||NVL(audit_rec.userhost ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.TERMINAL=' ||NVL(audit_rec.terminal ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.TIMESTAMP=' ||TO_CHAR(audit_rec.timestamp,'DD-Mon-YYYY HH24:MI:SS')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.OWNER=' ||NVL(audit_rec.owner ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.OBJ_NAME=' ||NVL(audit_rec.obj_name ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ACTION=' ||audit_rec.action ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ACTION_NAME=' ||NVL(audit_rec.action_name ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.NEW_OWNER=' ||NVL(audit_rec.new_owner ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.NEW_NAME=' ||NVL(audit_rec.new_name ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.OBJ_PRIVILEGE='||NVL(audit_rec.obj_privilege ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.SYS_PRIVILEGE='||NVL(audit_rec.sys_privilege ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ADMIN_OPTION=' ||NVL(audit_rec.admin_option ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.GRANTEE=' ||NVL(audit_rec.grantee ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.AUDIT_OPTION=' ||NVL(audit_rec.audit_option ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.SES_ACTIONS=' ||NVL(audit_rec.ses_actions ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_TIME=' ||NVL(TO_CHAR(audit_rec.logoff_time) ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LREAD=' ||NVL(TO_CHAR(audit_rec.logoff_lread) ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_PREAD=' ||NVL(TO_CHAR(audit_rec.logoff_pread) ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_LWRITE='||NVL(TO_CHAR(audit_rec.logoff_lwrite),'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.LOGOFF_DLOCK=' ||NVL(audit_rec.logoff_dlock ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.COMMENT_TEXT=' ||NVL(audit_rec.comment_text ,'Null')||crlf;
msg := msg||'DBA_AUDIT_TRAIL.SESSIONID=' ||audit_rec.sessionid ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.ENTRYID=' ||audit_rec.entryid ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.STATEMENTID=' ||audit_rec.statementid ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.RETURNCODE=' ||audit_rec.returncode ||crlf;
msg := msg||'DBA_AUDIT_TRAIL.PRIV_USED=' ||NVL(audit_rec.priv_used,'Null')||crlf;
END IF;
msg := msg||'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-'||crlf||crlf;
-- write the message to the error log file
log_file_handle := UTL_FILE.FOPEN (log_file_dir, log_file_name, 'A',maxlinesize);
UTL_FILE.PUT_LINE(log_file_handle,msg);
UTL_FILE.FCLOSE(log_file_handle);
-- send the message by Email
mail_conn := UTL_SMTP.open_connection(smtp_relay, mail_port);
UTL_SMTP.HELO(mail_conn, smtp_relay);
UTL_SMTP.MAIL(mail_conn, sender_address);
UTL_SMTP.RCPT(mail_conn, recipient_address);
UTL_SMTP.DATA(mail_conn, msg);
UTL_SMTP.QUIT(mail_conn);
END IF; -- client_program = MyProgram.exe
END IF;
END;
/ -
PL/SQL code to capture email with an Attachment from the POP server
Hey guys,
With the help of this forum and Billy I am able to capture the email from POP3 server and display it to the user. But now my query is how can I get an Attachment from the email using PL/SQL's UTL-TCP method ? Right now the attachment is displayed as string of characters.
Thanks.Seeing that none-one has bitten on this, I will have a very quick nibble.
Dealing with attachments can be complex - especially if binary. Attachment will be (should be) encoded using 7 bits. This requires you to un-encode it.
Attachments also require you to parse the mail body looking for the attachment boundary markers (as specified in the e-mail header).
The RFCs detailing the Internet Message Body and attachments will have the actual gory technical stuff.
It will make a lot more sense when looking at an existing MIME message ("raw" e-mail) when reading these RFCs - as you can fairly easily see how the MIME message was created with the attachment boundaries and headers.
Of course - also realise that as soon as you have decoded that attachment into a "proper" binary for your platform, you have a potentially malicious payload that could be "accidentally" executed. So safe guards are also needed.
Some of the RFC's covering these are:
# RFC 2049 - Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples
# RFC 2048 - Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures
# RFC 2047 - MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text
# RFC 2046 - Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types
# RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies
# RFC 2044 - UTF-8, a transformation format of Unicode and ISO 10646
# RFC 2112 - The MIME Multipart/Related Content-type
Full list of RFCs at http://www.faqs.org/rfcs/rfc-titles.html -
Using FILE to interact with the CI from an App server
Hi All.
We have a custom code function where a user takes a text file and uploads it into the SAP system. The file is immediately processed and a new 'outbound' file is created. Currently, we have the dirctory structure set-up on out CI/DB server. Our users access the system from one of 2 application servers.
The issue we have is that due to the definition in FILE, when the users execute the report, it errors out. This is becasue when they execute, SAP looks to the local server - the app servers - for the directory. As stated, this directory lives on the CI. Does anyone know how to adjust the functionality of FILE so that I can point the program to execute on the CI and not the app server? Thanks!Hello Tim,
We have a similar scenario like you but dont face this issue. 2 things are imüportant here:
1. The directory residing on CI should be accessible from the other application server i.e the mount should be correct.
2. The logical file path name in FILE should be correct. This is very important.
Believe me we have a more complex arrangement where 5 SAP s are involved and the directory resides on only one of them
Also FILE cannot dicate on which system the program is executed.It purely depends on the app server where the user is logged in.
Regards.
Ruchit. -
Windows 7 with Login Script from 2008 R2 server Duplicates Drives
I have a single user that when they login to the domain and their login script runs, it ends up giving them duplicate drives. I can copy the script to another account and not have the issue. I have not tried logging in as the user on another machine yet,
to see if the error follows the account. Anyone have any thoughts on what might be causing this? I have removed all of the drives from both the command line using
net use /del *
An example of the login script is
net use z: /delete
net use z: \\servername\sharename
Its random which drives it will duplicate to.Hi Mgibson-TC,
Can we run this script locally to check what’s the result?
You can try Ed (DareDevil57)’s suggest first, if this issue persists, we can do some tests to narrow down this root cause.
Alex Zhao
TechNet Community Support -
Tagging an ical event with contact?
Is it possible to tag an iCal event with a contact from the Address Book? Or attach notes to the event? Or link to files??
Hi,
It is possible to link an event to an Address Book contact using the URL field. I have an Applescript application to create these URLs when you have an Address Book contact selected. See the script Link to Address Book on this page.
Best wishes
John M
As I sell software on my site and ask for donations, the Apple Support Communities Use Agreement requires that I state that I may receive some form of compensation, financial or otherwise, from my recommendation or link. -
HT4890 Can I share a specific event with friends on iCloud via Photostream?
Can I share a specific event with friends on iCloud via Photostream?
No, not until iOS 6 comes out.
-
Problem with controlling Annotations from Excel VBA
Hi,
I have a PDF document that has plenty of sticky notes attached to it. These sticky notes have been added by multiple authors on all pages of the document. I am trying to import the contents of these sticky notes, their author and the page number to an excel spreadsheet. I am using Excel 2007 and Acrobat Professional 9.0.
This is the code that I am currently using to import the sticky notes, but the problem that I am facing is that when I run the macro -
Same sticky note contents, author and page numbers are imported multiple times
Not all sticky notes are imported, only some of them appear in the final excel spreadsheet
When I compare the number of sticky notes to that in the original PDF file, the number is correct. But the content is repeated content and that is the reason why only some of the sticky notes are imported.
This is an activity that I need to do on regular basis and the number of sticky notes that I need to import to excel may range between 100 to 200. It is really difficult to do this task manually, so an excel VBA macro could prove really helpful.
Sub ImportComments_Click()
Dim Fpath As String
Dim WordObj As Object
Dim wbkOutput As Excel.Workbook
Dim iRow As Integer
Dim i, j, k As Integer
Dim lRet As Long
Dim objAcroAVDoc As New Acrobat.acroAVDoc
Dim objAcroPDDoc As Acrobat.AcroPDDoc
Dim numPages As Long
Dim lAnnotscnt As Long
Dim Subtype As String
Dim NumComments As Long
Dim AcroApp As Acrobat.AcroApp
Dim objAcroPDPage As Acrobat.AcroPDPage
Dim annot As Acrobat.AcroPDAnnot
Sheets("Defect Log").Select
Range("L3").Activate
Fpath = ActiveCell.Value
Sheets("Defect Log").Select
Range("A1").Activate
i = 0
Do While (Not (IsEmpty(ActiveCell.Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 1).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 2).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 3).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 4).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 5).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 6).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 7).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 8).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 9).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 10).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 11).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 12).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 13).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 14).Value)))
i = i + 1
ActiveCell.Offset(1, 0).Select
Loop
iRow = i + 1
Set wbkOutput = ActiveWorkbook
lRet = objAcroAVDoc.Open(Fpath, "")
Set objAcroPDDoc = objAcroAVDoc.GetPDDoc
numPages = objAcroPDDoc.GetNumPages()
Set objAcroPDPage = objAcroPDDoc.AcquirePage(0)
For k = 1 To numPages
lAnnotscnt = objAcroPDPage.GetNumAnnots()
For m = 0 To lAnnotscnt - 1
If lAnnotscnt = 0 Then Exit For
Set objAcroPDAnnot = objAcroPDPage.GetAnnot(m)
If (objAcroPDAnnot.GetContents <> "" And objAcroPDAnnot.GetSubtype = "Text") Then
Cells(iRow, 5).Value = k
Cells(iRow, 2).Value = objAcroPDAnnot.GetContents()
Cells(iRow, 11).Value = objAcroPDAnnot.GetTitle()
iRow = iRow + 1
End If
Next m
Set objAcroPDPage = objAcroPDDoc.AcquirePage(k)
Next k
lRet = objAcroAVDoc.Close(1)
Set objAcroAVDoc = Nothing
Set objAcroPDAnnot = Nothing
Set objAcroPDPage = Nothing
Set objAcroPDDoc = Nothing
End SubMake sure you are current with 9.x patches, just on general principles.
The code seems fine – nothing jumping out at me.
You can also look at using the JSObject methods and trying this via the JavaScript stuff – that will give you more access to the Annotation information…
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Thu, 24 Nov 2011 04:25:12 -0800
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: Problem with controlling Annotations from Excel VBA
Problem with controlling Annotations from Excel VBA
created by apreeti<http://forums.adobe.com/people/apreeti> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4044740#4044740
Maybe you are looking for
-
Hi, I have created a service interface for PRtoPO conversion with 3 operations [Query, Read and Create(or Conversion) ]. In the Query operation I get a list of open PRs. In the Read operation I get the details of a single PR (like PR no, item no, mat
-
Whenever I try to make a video on iMovie, the audio is not in sync with the video. This just happened recently. I have no clue what is causing the problem, or how to fix it. What should I do?
-
Double space being taken up on ipod
So when I'm syncing my ipod and it has the bar at the bottom saying xxx music xxx apps xxx movies and so on. There is this "Other" block that's taking up 1.5gb of my space but all I have on my I pod is about 1gb of music. So I am wondering what this
-
OJP 8500 Premier - Can't import photos to Picasa or Photo Gallery
Hi: I've always inserted my SD card into the printer and clicked import in Picasa to get my photos, no problem. No conscious changes have been made here. Now, Picasa says no photos found when there are 478 on the SD card. The printer itself wants
-
WLS 7 MDB JMSConnection Alive false - where is the error reported?
I have a few MDBs subscribed to various destinations. One of them is subscribed to a queue called jms.queue.queue1 in JNDI. queue1 is a regular Queue (not distributed), lives in JMSServer1, which is deployed to WLS server1. An entry for it appears in