|
Hi,
I have found (and implemented) your XYMailClient.DLL in MSAccess 2000. It creates the email message. The recipient's format is "Let Outlook decide". When I use MSMAPI32.OCX the format is "Send using Outlook Rich Text Format". This causes a problem with attachments and TNEF. Can anyone perhaps give me a hint on how to fix this?
Sorry if this is off-topic!
TIA,
Adri
|
|
|
|
|
Hi
I have just unzipped your ODBCService web service ... and attempted to run some of your sample code ... i am getting an error message stating the following:
C:\Inetpub\wwwroot\PublicNet\cmtest\WebForm1.aspx.cs(59): The type or namespace name 'ODBCService' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\PublicNet\cmtest\WebForm1.aspx.cs(61): The type or namespace name 'oService' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\PublicNet\cmtest\WebForm1.aspx.cs(60): The type or namespace name 'oService' could not be found (are you missing a using directive or an assembly reference?)
for some reason it does not seem to be picking up the class .. any ideas why this may be happening?
my code is below:
************************************************
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Web.Services;
namespace cmtest
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
String sConnect="dsn=cmtest;uid=jttest_usr;pwd=";
String sSQL = "select * from v_dccases";
ODBCService oService = new ODBCService();
oService.Url = "http://localhost/ODBCService/ODBCService.asmx";
String sDataXML = oService.GetXMLStringEx(sConnect, sSQL);
if(sDataXML!="")
{
// process the data
XmlDocument oDoc = new XmlDocument();
oDoc.LoadXml(sDataXML);
// ...
}
else throw new Exception("Query failed: " + sConnect + ", " + sSQL);
}
}
}
*************************************************
thanks
Jon
|
|
|
|
|
First of all, you need to compile and install ODBCService on your machine.
Secondly, you need to add a "web reference" to ODBCService into your project.
Thirdly, depending on how you name the "web referece", you need to add the following to the your source code:
using MyWefRef;
Or you can write code like the following:
MyWefRef.ODBCService oService = new MyWefRef.ODBCService();
Here MyWebRef is the name you use for the web reference to ODBCService in your project.
Good luck.
My articles and software tools
|
|
|
|
|
Hi
Having some problem in sending mail by using System.Net.Mail Namespace
can you suggest some idea how to send mail from an asp.net page and by using System.Net.Mail i dont want to use System.Web.Mail
Plz Help me out
Regards
Rahul
|
|
|
|
|
You did a great job developing xysystem! I have a few questions about what happens when a receiver gets overwhelmed with messages.
1. How big is the message queue?
2. If the receiver is overwhelmed does SendTextMsg return false? I assume it does but this is not mentions in the API. Is there any retry mechanism within SendTextMsg - meaning it will try to send the message again in a few seconds.
3. Will 10 messages sent by process A using SendTextMsg always arrive in the same order to proces B? I believe it would since it returns a boolean value.
Thanks!
|
|
|
|
|
Thanks. Here are the answers.
1. There is no limit on the message queue besides memory capacity. When a message is received, the appropriate handler in the receiver will be invoked, which can do the following:
1) Ignore, leave the message in queue.
2) Delete the message because the message is not expected.
3) Do something to process the message and delete it afterwards.
4) Process the message without deleting it.
5) Save the message somewhere (in a database, for example) for later processing.
2. Typically, SendTextMsg will not return false. This is because the sender and receiver can be connected indirectly via one or more intermediate parties. The intermediate parties will forward the message to the receiver. Even if the receiver is dead, SendTextMsg could still return true. If you want to make sure the receiver does receive the message being sent, use SendSyncTextMsg which will not return until a reply from the receiver is sent back.
3. Yes.
Hope this helps.
--- Xiangyang Liu
My articles and software tools
|
|
|
|
|
Thanks for the quick response!
Under what circumstances will SendTextMsg return false?
I have a few other minor questions:
1. Is XYFileNet & XYFileNetDaemon part of XYSystem 2.0?
2. Can XYRoot be configured (at startup) to run without displaying the window?
Again thanks for developing this framework.
|
|
|
|
|
1. Yes.
2. Yes. What you can do is start XYRoot using XYNTService, put UserInterface=No in the configuration file (for details, look at http://www.codeproject.com/system/xyntservice.asp). The latest version of XYNTService can be found from the above article. The version included in XYSystem 2.0 zip file is not the latest.
Good luck.
--- Xiangyang Liu
My articles and software tools
|
|
|
|
|
First of all, I read your article and it was very interesting.
I implemented a similar program this week before I saw your article. My solution was to create and install a service on remote host which may contact with the sender via UDP connection. BTW, C# class 'Process' provides a set of very convenient functions which allow you to get window handle of a process ,getting process by it's name, start , kill and so on.
DavidR
|
|
|
|
|
Thanks.
DavidR_r wrote:
BTW, C# class 'Process' provides a set of very convenient functions which allow you to get window handle of a process ,getting process by it's name, start , kill and so on.
Yes. The Process class is very convenient, sometimes too convenient. I was testing my ASP.NET application deployed on a server that belongs to a web hosting company. I discovered accidentally that I can easily execute various programs on the server and also see all the files on the server's C drive. Of course I am not interested in making trouble for them (and myself).
My articles and software tools
|
|
|
|
|
Hi,
I have been working with the XYNTService, which has been a great help to me.
What I'm currently looking at is a facility for installing this under an account other than "Local System"? I have configured the logon credentials manually, but I need a way to push this out across a large user base using an account with network access.
Any thoughts?
Thanks,
John
|
|
|
|
|
You need admin right on each computer that you want to install the service.
I have a utility program[^] that can install a service to be run under a given user account. However, it does not create the user account nor does it grant the necessary rights to it.
It is possible to write a program that creates a new account on a computer, if you are familiar with ADSI (com interfaces).
My articles and software tools
|
|
|
|
|
Thanks -- that's perfect.
The service will be pushed out via SMS and I am setting up a generic user account which will have access to the network share, so that's no problem. I just needed to be able to logon under the correct account.
Thanks again for all your help!
Regards,
John
John A. Berry
Analyst, Application & Database Services
Shared Information Management Services (SIMS)
University Health Network
700 Bay Street, Suite 201
Toronto, ON
M5G 1Z6
|
|
|
|
|
Hi Xiangyang Liu,
I've been using XYDispatch and am very happy with your creation! I have a question regarding the "InvokeMethod" call.
I have a COM object that provides the following MethodName:
3: DispID = 34003
MethodName = MessageParameter
PropertyGet
VTable offset: 0
Calling convention: 4
Return type = 8
ParamCount = 1
Param(0) type = 3
I call this methodname like this:
VARIANT* pOutput;
long myIdx = 0; //Set to any value and I've also attempted to use "int" rather than "long" parm
pOutput = dispDriver.InvokeMethod("MessageParameter", myIdx);
pOutput is always NULL (0x00000000) after this call. I think it has something to do with the
"PropertyGet". I usually see "DispatchMethod" associated with the MethodName. I have checked my "dispDriver" and it's a good and valid address. I can cal other Methods with InvokeMethod but only "MEssageParameter" returns NULL always.
What am I doing wrong? I'm sure it's my ignorance.
Thanks,
Brian
|
|
|
|
|
It looks like the "method" you want to invoke is actually a parameter. InvokeMethod does not work with parameters. You should use GetParameter instead.
However, GetParameter does not take any input for the parameter. That is a flaw of the XYDispDriver class (it was designed for "simple" com programming).
You can call the static method InvokeVariantMethod to get around this problem. Assume you have created your com object using an instance of XYDispDriver, dispDriver, here is the code:
VARIANT varOutput;
VARIANT varInput;
varInput.vt = VT_I4;
varInput.lVal =1;
HRESULT hRet =
XYDispDriver::InvokeVariantMethod
(
dispDriver.GetDispatch(),
"MessageParameter",
DISPATCH_PROPERTYGET,
&varOutput,
NULL,
1,
varInput
);
if(hRet==S_OK)
{
}
Good luck.
P.S. I hope it works.
My articles and software tools
|
|
|
|
|
Hello Again,
I have a rather strange situation with XYDispDriver. I'm calling from Java into a JNI DLL that instantiates a class that wraps a few more classes that use XYDispDriver class. The DLL has just a few methods. We'll just call them method1 and method2. Here's the classes:
class Application
{
XYDispDriver dispDriver;
Connection* pConnection;
public:
Application(){dispDriver.CreateObject("MyControl")};
Connection* getConnection()
string getPropertyId() // dispDriver.GetProperty("Id");
class Connection
{
XYDispDriver dispDriver;
Session* pSession;
public:
Connection(const XYDispDriver &src);
Session* getSession()
string getPropertyId() // dispDriver.GetProperty("Id");
}
class Session
{
XYDispDriver dispDriver;
public:
Session(const XYDispDriver &src);
string getPropertyId() // dispDriver.GetProperty("Id");
}
The JNI DLL looks like this:
//Global declarations
Application* pAppl;
Connection* pConnection;
Session* pSession;
JNIEXPORT ... method1()
{
pAppl = new Application();
pConnection = pAppl.getConnection();
pSession = pConnection.getSession();
cout << pAppl->getPropertyId() << endl;
cout << pConnection ->getPropertyId() << endl;
cout << pSession ->getPropertyId() << endl;
}
JNIEXPORT ... method2()
{
cout << "Application " << pAppl->getPropertyId() << endl;
cout << "Connection " << pConnection ->getPropertyId() << endl;
cout << Session " << pSession ->getPropertyId() << endl;
}
So .. Java calls method1 and everything works fine and I can call all the methods and properties asociated. Then I exist back to Java and call method2. Both pAppl->getPropertyId() and pSession ->getPropertyId() execute fine. However, when I call pSession ->getPropertyId() XYDipDriver is failing on the Invoke of the dispDriver.GetProperty("Id") call. I have no idea why this is happending? Any idea? I checked all addresses and even looked at the information in XYDispInfo instance which still had the"Id" method listed with a valid index. Why would Invoke fail?
Output looks like this:
Application ID=/app
Connection ID=/app/con[0]
Invoke failed, no exception: 800401fd
To make matters even more tricky, I take the JNIEXPORT DLL and remove the JNI types and create an identical DLL which I call from a C++ console application. The Invoke works every time!!
Can you shed any light on why the Invoke might be failing when I call from Java through JNI?
Thanks,
Brian
|
|
|
|
|
Hi Xiangyang Liu,
It appears that the dispDriver IDispatch pointer is stale even though XYDispInfo contains valid information. It looks like I need to refesh the IDispatch pointer from the Parent class between JNI Metod calls from Java. So, as usual, it looks like I have a problem with my code. No need for you to answer or think about this question.
Thanks for all your help,
Brian
|
|
|
|
|
Thanks Xiangyang Liu! (if that's how you pronounce it )
I've recently had to add the ability to download and process emails to my ASP application (quite a hefty one, at that), and was at a loss as to how to get an ASP page to run without having a constantly refreshing web window open under a constantly logged-in user... (secure, yeah)
With your XYNTService application I can now run my ASP thing as a service! It's amazing!
Thank you, thank you
"Rainy days and automatic weapons always get me down." - Anon.
|
|
|
|
|
|
are you form china ?
ÊÇÖйúÈËÂð?¿ÉÒÔ½»¸öÅóÓÑÂð?ÎÒµÄEMAILÊÇ
degede@163.com
I like free...
|
|
|
|
|
dalaroseyeah wrote:
are you form china ?
I currently live in USA. I came from China more than 15 years ago. I had problem reading the Chinese text in your post, you can email me if you want to.
Nice to meet you.
My articles and software tools
|
|
|
|
|
Hello Xiangyang Liu,
I am attempting to use your XYDispDriver and I am a COM novice. When I create my COM object one method is shown in output as follows with DEBUG turned on:
1: DispID = 32905
MethodName = OpenConnection
DispatchMethod
VTable offset: 0
Calling convention: 4
Return type = 26 (Not sure what this represents?)
ParamCount = 3
Param(0) type = 8
Param(1) type = 12
Param(2) type = 12
My Code to Invoke this Method is like this:
VARIANT* pOutput = disp.InvokeMethod("OpenConnection", "My Info",true, true);
When I call this method it returns OK with a VT_DISPATCH vartype.
I opened an MFC project and added the OCX Control and it generated the following method code:
CSapConnectionTarget Csapfewse::OpenConnection(LPCTSTR Description, const VARIANT& Sync, const VARIANT& Raise)
{
LPDISPATCH pDispatch;
static BYTE parms[] =
VTS_BSTR VTS_VARIANT VTS_VARIANT;
InvokeHelper(0x8089, DISPATCH_METHOD, VT_DISPATCH, (void*)&pDispatch, parms,
Description, &Sync, &Raise);
return CSapConnectionTarget(pDispatch);
}
CSapConnectionTarget has its own methods and properties which I would like to call. Can you help me understand how I would do this through the "pOutput" return type of VT_DISPATCH? I think I'm interested in the "IDispatch FAR* pdispVal" of pOutput?
Brian
|
|
|
|
|
In this case, the method "OpenConnection" returned a SapConnection object (VT_DISPATCH, an IDispatch pointer). You can use the returned "object" with another instance of the XYDispDriver class, like the following:
<br />
VARIANT* pOutput = disp.InvokeMethod("OpenConnection","My Info", true, true);<br />
XYDispDriver disp2;<br />
if(disp2.Attach(pOutput->pdispVal)!=false)<br />
{<br />
}<br />
The Attach method of XYDispDriver allows you to use an existing IDispatch pointer, it is the same as the CreateObject method except that it does not create a new com object (it only attaches the existing com object to the XYDispDriver instance).
Good luck.
My articles and software tools
|
|
|
|
|
Thank you very much! I'll give it a try right now.
Brian
|
|
|
|
|
Hi Xiangyang Liu,
Hopefully one last question. I was successful with the code you mentioned. One of the "properties" of that Object are defined as follows:
/////////////////////////////////////////////////////////////////////////////
// CSapConnectionTarget properties
CString CSapConnectionTarget::GetDescription()
{
CString result;
GetProperty(0x80ea, VT_BSTR, (void*)&result);
return result;
}
In the DEBUG Output on attach I see:
11: DispID = 33002
VarName = Description
VarKind = VAR_DISPATCH
VarType = 8
VarType 8 looks like a VT_BSTR!
I run this code ....
VARIANT* pProperty = connection.GetProperty("GetDescription");
but I get 0x00000000 (NULL) for pProperty. How would I get at that variable "VarName = Description"?
Thanks you so, so much.
Brian
|
|
|
|