|
let me have the com you are using and I'll make it for you.
|
|
|
|
|
I read through the remoting tutorial and the examples they gave were not clear enough. Can anyone tell me if I am setting this up correctly?
I have a class library named RemotingObjectAccess.dll
In the class library are 5 classes that inherit MarshalByRefObject:
myNamespace.PageManager
myNamespace.RuleManager
myNamespace.EventManager
myNamespace.HeaderManager
myNamespace.QuestionManager
If I understand the tutorial correctly:
I run my web in a virtual directory. DONE
I put my DLL and it's dependancies in the bin directory of the web. DONE
I create a remoting.config file and put it in the root of the virtual server. DONE
This is what I have the question on.
I couldn't get the XML to be visible in the post so....assume the XML is correct.
I set the application to my class library name:
application name=RemotingObjectAccess
Under services I defined each class within the library and set the URI to the 'class library name'.SOAP :
wellknown mode="Singleton" type="myNamespace.PageManager" objectUri="RemotingObjectAccess.soap
wellknown mode="Singleton" type="myNamespace.QuestionManager" objectURI="RemotingObjectAccess.soap etc.
and I defined the channel to use the HTTP channel, port 80.
That is my understanding of how I should map my DLL name and individual class names into the various entries in the remoting.config file. Did I understand this correctly???
The documentation also says that the library would not be loaded until the first transaction hits the server. How can I guarantee I get a transaction into the server before I attempt to remotely connect to these classes? Since these are development servers, my remote connection could well be the first transaction!!!
Thanks for any help and input.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Hi.
I'm trying to send text to a Epson TM-T88II Reciept printer. the printer is installed as a system printer on win XP.
I've got some drivers from their homepage wich i got to work. the performance however is not acceptable (~30 sec for 20 centimeters).
I tried printing a windows testpage with the MS Generic/Text Only driver. this took ~1 (one!) second for 30 centimeters. So i naturally want to use this driver.
BUT (there is always a 'but'...) When i try to print in my program i get this error:
"The data area passed to a system call is too small".
this is kind of strange since the program has not reacht my printpage event yet....
The program generates the error in system.drawing.printing.OnStartPrint (or something like that) which has nothing to do with anything.. :-/
i've i try a different driver I do not get this error.
I've looked a bit around the web and seen others with similar probs but no solution.
Can anyone help me?!!
here's my code:
---------------------------------
public void PrintBon()
{
try
{
//for text
m_printBon = new PrintDocument();
m_printBon.PrintPage += new PrintPageEventHandler
(this.printBon_PrintBon); <--- Error occurs here. before the program goes to my PrintBon event.
m_printBon.Print();
}
catch(Exception ex)
{
throw ex;
}
}
private void printBon_PrintBon(Object sender, PrintPageEventArgs ev)
{
ev.Graphics.DrawImage(logo, 80, 0, 130, 50);
ev.Graphics.DrawString(m_printString, m_printFont, Brushes.Black, 0, 60);
ev.HasMorePages = false;
}
----------------------
|
|
|
|
|
apparently .NET only sends Graphics to a printer. therefore the Generic/text only driver cant accept the input.
I found a tutorial on how to send raw data to a printer.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;322091
|
|
|
|
|
I want to call a method clear on an object. I know it has the clear method but I dont what class it is
do i use method info class?
|
|
|
|
|
You could use Reflection and the MethodInfo type, however, are you sure that the object doesn't implement an interface that has the Clear method? In that case, you could cast the object to the interface and then call the method based on the interface. Otherwise, how do you know the object implements Clear()?
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Well I created the class and they all have base classes. I could create a default interface but I didn't really feel like doing it.
|
|
|
|
|
Then you could cast the object to the base class before calling the method. That should work, and it'll also give you intellisense in VS.NET.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
int done;
....
if(done)
break;
It been a long time since i've done C++ but what is the correct statement in C#?
???
if(1 == done)
break;
if(0 != done)
break;
???
|
|
|
|
|
C# and C++ have the same syntax. You can use it in C# too.
if(done)
break;
is correct for both.
Mazy
No sig. available now.
|
|
|
|
|
Visual Studio .NET considers the code to be an error:
Cannot implicitly convert type 'int' to 'bool'
|
|
|
|
|
You didn't say it returns int value. Cast it too bool.
if((bool)done)
...
Mazy
No sig. available now.
|
|
|
|
|
well the casting still throws up the same error
Cannot convert type 'int' to 'bool'
any hoo.
what number does done have to be for it to satisfy the condition?
|
|
|
|
|
So use If(done==1) .It returns error too?
Mazy
No sig. available now.
|
|
|
|
|
more like while(true)
break;
its not a full int world anymore
|
|
|
|
|
zoltan_ie wrote:
It been a long time since i've done C++ but what is the correct statement in C#?
???
if(1 == done)
break;
if(0 != done)
break;
???
Use above lines, no problem
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
oh my god, i'm gonna go ape sh*t!
if(done)
do1
else
do2
what number does done have to be to do1?
In C what number does done in the if statement have to be to give a true condition
|
|
|
|
|
I think if done is 0 then (bool )done is false otherwise it's true.
but, why don't you use bool data type?
private bool <code>done</code>;
done = true;
if(<code>done</code>)
do1;
else
do2;
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Lesson learnt from Perl:
It is easier to define "false" than "true": 0 (zero) and null are "false", everything else is true.
Olorin,
YAPPTH
|
|
|
|
|
int done;
...
if (Convert.ToBoolean(done))
break;
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
Why keep it an int at all?
bool done = false;
...
if( done )
break; C doesn't have a concept of a boolean so you had to use some other data type to represent one, most code uses an int to hold a boolean value. C++ has bool datatype, but since the Win32 API is C based you typically don't use it favoring an int or the #defined BOOL .
Like C++, C# has a bool data type, unlike C++ though there isn't any legacy code to be aware of so you should use it whenever necessary.
[edit]And unlike C/C++, the bool datatype has a true/false value instead of a non-zero/zero value. So you need to assign true to done instead of a 1.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
The suggestion above to use a bool is the best.
The suggestion to cast the int to a bool is silly.
By definition, a int is "true" if it does NOT equal zero. Thus you should always test against the false situation. The correct syntax of your two choices is:
if (0 != done)<br />
break;
This syntax should also be used in C# (if you don't use bool.)
|
|
|
|
|
how to detect that I just press Ctrl+Key
I was try with code :
<br />
privated void myInput_KeyDown(object sender,KeyEventArgs e)<br />
{<br />
if (e.KeyCode==(Keys.G & Keys.Control)<br />
{<br />
}<br />
}<br />
but It not run
please help me, thanks
|
|
|
|
|
Can anyone show me how to fill this figure with a blue color?
System.Drawing.Graphics formGraphics = null;
System.Drawing.Pen myPen;
formGraphics = pictureBox7.CreateGraphics();
myPen = new System.Drawing.Pen(System.Drawing.Color.Black,1);
formGraphics.DrawLine(myPen, 4, 4, 50, 4);
formGraphics.DrawLine(myPen, 4, 4, 4, 100);
formGraphics.DrawLine(myPen, 50, 4, 50, 100);
formGraphics.DrawLine(myPen, 4, 100, 27, 120);
formGraphics.DrawLine(myPen, 50, 100, 27, 120);
Maybe with the FillPolygon method.
|
|
|
|
|
Point[] points = {
new Point(4, 4),
new Point(50, 4),
new Point(50, 100),
new Point(27, 120),
new Point(4, 100),
new Point(4, 4)};
SolidBrush brush = new SolidBrush(Color.Blue);
e.Graphics.FillPolygon(brush, points, FillMode.Alternate);
e.Graphics.DrawLines(myPen, points);
|
|
|
|