miko
Guest
|
Posted:
Thu Jun 30, 2005 2:42 pm Post subject:
I have a problem to use Persistent Connection in C# |
|
|
I don't understand how develop en C# the context.
//the sample
private Object[] contextCOMTI;
private Microsoft.HostIntegration.TI.ClientContext contextClt = null;
private string varConnType;
contextClt =new Microsoft.HostIntegration.TI.ClientContext();
varConnType="OPEN";
contextClt.WriteContext("CONNTYPE",varConnType,ref contextCOMTI);
lgnReturn = objBank.cedrbank(inArg1, out outArg2, contextCOMTI);
when I start the debug in .Net, it write "impossible to convert ref object[]
in ref object".
So i try
lgnReturn = objBank.cedrbank(inArg1, out outArg2, contextCOMTI[0]);
it doesn't run but when i try
lgnReturn = objBank.cedrbank(inArg1, out outArg2, contextCOMTI[1]);
it run but i my opinion it's not very good.
Thank you for your replies. |
|
Aaron Grady [MSFT]
Guest
|
Posted:
Thu Jun 30, 2005 4:55 pm Post subject:
Re: I have a problem to use Persistent Connection in C# |
|
|
Miko-
The Client context object is always a in/out parameter on the method call, so I believe your call to the cedrbank method should look like:
lgnReturn = objBank.cedrbank(inArg1, out outArg2, ref contextCOMTI);
Also, I *think* most of the sample CedarBank objects had three parameters and then the context object, but maybe you've modified it for your testing. There is a C# client that comes with Cedarbank which uses the context object you may want to look at that for an example, here's the call to cedrbank that I was able to see in the C# sample client which again shows that the Client context object needs to be passed as a ref:
o0.cedrbank (ref name ,ref accnum ,ref curRetBalance, ref contextArray);
HTH,
--
Aaron Grady
MCSE + Internet, MCDBA, MCSD, MCAD.NET
SNA Server/Host Integration Server
Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"miko" <no.spam@nospam.fr> wrote in message news:70c7a06be6f340c7986c2934ae7fd577@ureader.com...
| Quote: | I don't understand how develop en C# the context.
//the sample
private Object[] contextCOMTI;
private Microsoft.HostIntegration.TI.ClientContext contextClt = null;
private string varConnType;
contextClt =new Microsoft.HostIntegration.TI.ClientContext();
varConnType="OPEN";
contextClt.WriteContext("CONNTYPE",varConnType,ref contextCOMTI);
lgnReturn = objBank.cedrbank(inArg1, out outArg2, contextCOMTI);
when I start the debug in .Net, it write "impossible to convert ref object[]
in ref object".
So i try
lgnReturn = objBank.cedrbank(inArg1, out outArg2, contextCOMTI[0]);
it doesn't run but when i try
lgnReturn = objBank.cedrbank(inArg1, out outArg2, contextCOMTI[1]);
it run but i my opinion it's not very good.
Thank you for your replies. |
|
|
miko
Guest
|
Posted:
Fri Jul 01, 2005 4:53 pm Post subject:
Re:I have a problem to use Persistent Connection in C# |
|
|
I find the problem
when i use the sample cdrbank and uses CICS_LinkTRM_CedarBank.dll
contextArray = ref object[]context
when i use my dll
contextArray = ref object context
So i try to compare CICS_LinkTRM_CedarBank.tlb with myFile.tlb. it's normal.
So i try to convert tlb-->dll with tlbImp.exe
and the problem is there.
When i use tlbimp.exe, it doesn't convert
[in, out, optional]
VARIANT* varContextArray
in ref object[]context.
the command that i use is :
c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\TlbImp.exe
/out:C:\myFile.dll
how use tlbImp.exe to convert
[in, out, optional]
VARIANT* varContextArray
in ref object[]context.
thank you. |
|