|
Within the same class, an instance method can call a static, but a static cannot call an instance.
|
|
|
|
|
unless you pass an instance reference to it...
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
The only way to do this is to have your Test2 method have an instance of the class as a parameter or make one available to it in some other way.
|
|
|
|
|
I have an application with a form containing 2 textboxes and an animated GIF, this form works fine in all version of Windows that I have tried it on except Vista, for some reason the textboxes show the desktop through them and the GIF does not move. This is designed in VS 2003 using C# .NET 1.1.
Has anyone seen this behaviour before or have an idea what might cause it?
|
|
|
|
|
PRNADMINLib.PrinterCollection prnColl =
(PRNADMINLib.PrinterCollection)oMaster.get_Printers(ref oServerName);
I have the name of the server as a string which I believe needs to go into get_printers parameter but this parameter is expecting an object i.e. ref oServerName.
How can I pass my server string name to this object parameter?
Thanks
|
|
|
|
|
|
This isi what I am using withthe same issue.
Not sure how to pass the servername.
Thanks
PRNADMINLib.PrintMaster oMaster = new PRNADMINLib.PrintMasterClass();
PRNADMINLib.Printer pPrinter = null;
PRNADMINLib.PrinterCollection prnColl =
(PRNADMINLib.PrinterCollection)oMaster.get_Printers(ref oServerName);
IEnumerator prnEnumerator = prnColl.GetEnumerator();
prnEnumerator.Reset();
while (prnEnumerator.MoveNext())
{
PRNADMINLib.Printer prnCurrent = prnEnumerator.Current as PRNADMINLib.Printer;
if (prnCurrent.PrinterName == strPrinter)
{
pPrinter = prnCurrent;
break;
}
}
|
|
|
|
|
Hello DaveyM69
I am using the code in that article but the issue is where to get the oServerName as object?
I even tried the following code with slight changes to my previous code.
This is what I have now and error is FileNotFoundException on line:
PRNADMINLib.PrinterCollection prnColl =
(PRNADMINLib.PrinterCollection)oMaster.get_Printers(ref obj);
The actual error is:
The filename, directory name, or volume label syntax is incorrect. (Exception from HRESULT: 0x8007007B)
PRNADMINLib.PrintMaster oMaster = new PRNADMINLib.PrintMasterClass();
PRNADMINLib.Printer pPrinter = null;
object obj = txtServerName.Text.Trim();
PRNADMINLib.PrinterCollection prnColl =
(PRNADMINLib.PrinterCollection)oMaster.get_Printers(ref obj);
IEnumerator prnEnumerator = prnColl.GetEnumerator();
prnEnumerator.Reset();
while (prnEnumerator.MoveNext())
{
PRNADMINLib.Printer prnCurrent = prnEnumerator.Current as PRNADMINLib.Printer;
if (prnCurrent.PrinterName == strPrinter)
{
pPrinter = prnCurrent;
break;
}
}
|
|
|
|
|
I have corrected the code as follows but it seems the data is retrieved from the local machine as opposed to the ServerName.
Any suggestions?
PRNADMINLib.PrintMaster oMaster = new PRNADMINLib.PrintMasterClass();
PRNADMINLib.Printer pPrinter = null;
clsServer oServerName = new clsServer();
object obj = oServerName;
PRNADMINLib.PrinterCollection prnColl =
(PRNADMINLib.PrinterCollection)oMaster.get_Printers(ref obj);
IEnumerator prnEnumerator = prnColl.GetEnumerator();
prnEnumerator.Reset();
while (prnEnumerator.MoveNext())
{
PRNADMINLib.Printer prnCurrent = prnEnumerator.Current as PRNADMINLib.Printer;
if (prnCurrent.PrinterName == strPrinter)
{
pPrinter = prnCurrent;
break;
}
}
|
|
|
|
|
I really haven't got a clue - I just found some online resources that I thought might help you.
This page[^] has loads of info on printing of all kinds including (about halfway down) prnadmin.dll. It has a section on Enumerating Printers - but you should probably read and understand all of it before jumping to that section. It's in VB - (maybe VBS? I didn't check) but it should get you started - maybe try it at get it working in that language before translating so you'll know wheter it's a network/permission problem or just your code if it doesn't function.
I can't help you anymore than this. I have no experience of your particular problem and it seems noone else here has either as you've been asking for a long time and not got a solution, so if this doesn't help, you may be on your own. Good luck!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
by using a setup project a set up can be created to an application, but in my application i want the user to enter some information when the application is installing(such as server to install), how can i create such a set up project, any articles that might help full
|
|
|
|
|
Not very much experienced with setup projects but I think custom action is what you need.
|
|
|
|
|
|
Does .Net 3.5 SP1 has a big integer class, with an arbitrary number of digits precision, yet?
It would be better if it is a .Net 2.0 class because all of my code is .Net 2.0 and I hope I do not have to upgrade to .Net 3.x just because of 1 class and the 2nd reason being the big .Net 3.x framework download.
Thank you in advance!
|
|
|
|
|
It does have one, but it is still internal.
The same (not very good) code can be found in the IronPython project.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 alpha 4a out now (29 May 2008) ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
It doesn't, but AFAIK you can use the BigInteger class from the J# library - vjslib.dll.
|
|
|
|
|
I wonder if that code is better than the one I mentioned, as the one I mentioned is rather slooow...
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 alpha 4a out now (29 May 2008) ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
|
|
I don't know if this[^] is any good as I haven't tried it but it's an Int128.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hi, I'm developing a device application in C#.
I'm currently using a connection string that requires the data source and I'm using the database server name.
String RDAOleBDConnectionString = "Provider=SQLOLEDB;Data Source=" + NombreServidor + "," + Puerto + ";Integrated Security=SSPI;Initial Catalog =" + NombreBD + ";";
But I want to use the IP of the server as the Data Source, I tried to use it but it didn't work.
Also, when I'm running my application, when i try to synchronize the device and the server, I have to delete first the SQL tables because shows an error (the table already exists) when I try to get the last update in tables from the server.
Also, I haven't tested the application when I try to send the data to the server. Will i have to delete the table on the server? Or there is another way to send and receive data to the server and device without deleting tables?
The reason I don't want to delete tables is because i have a website solution manipulating this data and it can delete some of the data the device sent for different reasons, and i don't want to send data that it's already useless when the device syncs again.
thanks.
~ Bizarre what men fin attractive ~
|
|
|
|
|
Hi,
is there a good tutorial or article on create crystal reports programmatically?
Thanks
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Anyone know how to get the text on a button appear to light up? Or have an idea on how to create the effect?
Thanks...
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
could change the font color, or custom draw the button and add like a outline around the text (ie. draw the text twice but a larger size behind)
|
|
|
|
|
howlettt wrote: add like a outline around the text (ie. draw the text twice but a larger size behind)
Kinda what I was thinking about too...
I'm drawing the buttons. So I 'think' what I'm going to need to do is draw the text using a brush that highlights? Matrix?? Haven't done it before so maybe I'll have something to do an article on!!
Thanks!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|