|
We have two HP printers that support paper types, as opposed to paper trays. We use this in our Access client to specify that a document is for a specific paper type, e.g. Preprinted. If the printer has that it in a tray it uses it, otherwise it prompts for someone to provide the type.
Looking at .NET printing only the concept of paper trays seems to be exposed, but when you have six different paper types and three trays this becomes a problem! Is there a way to do this in .NET or a 3rd party printing library that supports paper trays?
Howard
|
|
|
|
|
Presumably this is done via the API EnumForms and uses the dmFormName element of the printer device mode (DEVMODE) structure to select this?
You could wrap these API calls in VB.Net to achieve what you want...
'--8<------------------------
Printer Monitoring in .NET? see - Merrion Computing Ltd for details
|
|
|
|
|
At MSDN there's plenty to read about .NET Framework naming conventions. But I cannot find how to name your forms in WinApps? Do I use a prefix 'frm' or 'Frm' or should I not use prefixes? If we place controls on a form, we do use prefixes like 'lbl' and 'txt' for labels and textboxes.
grtz,
Octavie
----------------------------------------------
Why create waste if we throw it away, anyway?
----------------------------------------------
|
|
|
|
|
A form is a class, right? So you use the class naming guidelines.
In this case, here is the relevant paragraph IMO:
Where appropriate, use a compound word to name a derived class. The second part of the derived class's name should be the name of the base class. For example, ApplicationException is an appropriate name for a class derived from a class named Exception, because ApplicationException is a kind of Exception. Use reasonable judgment in applying this rule. For example, Button is an appropriate name for a class derived from Control. Although a button is a kind of control, making Control a part of the class name would lengthen the name unnecessarily.
e.g. You have a Form showing customer records, I would name it CustomersForm . (Plural because it is showing a list of customers. If it was the details form then either CustomerForm or CustomerDetailsForm ).
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
|
|
|
|
|
Hi
I have a question, if you have some solution, please answer.
I develop a system using .NetFramework.
This have a function connect multi datasource.
So I develop the following way, a connection per object.
This obeject have connenction information and ...
If I would like to connect database, I would use it,
But .Net Framework don't support parallel transaction.
I think about the other solution.
thank you in advance for your help
best regards,
yu-yu
|
|
|
|
|
I understand that if I set "Cursor.Current= Cursors.WaitCursor ;" then somewhere I call "Application.DoEvents()", my hourglass cursor will disappear.
Why the he$$ does .NET insist on doing this? I want the hourglass there so the user knows the app is busy *AND* I want the form to be repainted (to show the progress bar) so I both set the cursor and call "DoEvents()".
|
|
|
|
|
Hi all,
Not sure if this topic has been covered before but I thought I'd ask you all for help anyway.
What I'm trying to do is the following:
1. Load data from the database.
2. Transfer the data accross the network.
3. Populate an object's state from this data.
The approach I would like to try is:
1. Load the data from the database and fill a dataset with it.
2. Transfer the dataset accross the network
3. Convert the dataset into the a format that the .net serializiation architecture can recognize
4. Use (Specified formatter).Deserialize() to create my object with the state.
now.... My question is.... How can I do step 3?
I would have thought that this is a reasonable approach and if any of you know how to do this, or have any thoughts on the approach, please let me know.
Many thanks,
P
|
|
|
|
|
Hi!
I am trying to modify the outgoing SOAP request from a client, by tacking on a custom HTTP header. Can anyone help me as to how I can do that? It seems that a SOAP extension may not help, since I could not find how to get at the HTTP header of the outgoing request.
Thanks!
|
|
|
|
|
I am using dotNET framework 1.03 ,I want update to framework 1.1,How can i do ?
Thank you
|
|
|
|
|
Download the .NET Framework v1.1 and run the setup process.
Note that v1.1 tightens security a lot, especially in ASP.NET and you will run into issues with existing ASP.NET sites.
Installing v1.1 will leave behind v1.0 (never heard of v1.03) and they will run side by side. You can use mappins in your web.config or app.config file to tell your app which version of the framework to use.
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
|
|
|
|
|
Actually... if you want to use the 1.1 framework in the VS.NET IDE you will have to upgrade to .NET 2003. .NET 2002 will only use the 1.0x framework. .NET 2003 is keyed to use 1.1x but IT can be modified (supposedly) to use the previous version though I'm not certain why you would want to do that.
|
|
|
|
|
Hi, I wonder if somebody can help me. I'm opening my program with a winform then I want this form to close with another form that opens but as soon as I close this form the program stiops running, of course! But how do I get the process to keep running!
|
|
|
|
|
Your program will have a Main method for the application, this will be a static member of the form the application starts with.
From MSDN:
Typically, the main function of an application calls this method and passes to it the main window of the application.
This method adds an event handler to the mainForm parameter for the Closed event. The event handler calls ExitThread to clean up the application.
Note The Dispose method of the Form class will be called prior to the return of this method.
So... When your main form closes, so does the application.
The trick is then keeping the application running.
My suggestion is to set up an event handler to catch the Closing[^] event on the Form and set the Cancel property of the CancelEventArgs[^] passed to your handler to true. i.e. e.Cancel = true
Of course, this means that your form is still open (you cancelled the close operation) so you could make the whole thing invisible by setting visible=false on the form.
You would still have to close it properly to exit the application. (Back to your closing event handler - An if (Visible == true) {} else {} would be needed.
Alternatively - if the above is too messy: If the second form always opens after the first is closed then you could pass the appliction control to the second window. That is your Main() method would contain:
Application.Run(new FirstForm());
Application.Run(new SecondForm());
I've never tried this approach - So I don't know if it would really work - but it's worth a try. Besides, it is a lot neater than my first solution.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
I suspect my .NET hosting outift is going to decline my request to run a .NET windows service. The service is needed to check some POP3 accounts periodically and respond based on their contents.
Question therefore is this: Is there any way to simulate a 'daemon' using Web Services ? I had this crazy notion of a service posting to itself once it had received an initial (external) wakeup call. Seems a bit grim. Is there a better/alternative approach ? Have I missed something obvious in the .NET framework ?
Thanks
Jerry
|
|
|
|
|
Well, web services weren't designed for this, but you can always create a web method that start a background thread with a timer and do whatever you want in this thread.
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
|
Using VScrollBar in VB.NET program,I found the VScrollBar's Event "Scroll" will be raised twice when I click VScrollBar once. Why?
|
|
|
|
|
CryptUIDlgSelectCertificate is a undocumented API. So I have not read any reference about this API. But I find some similar API in new MS SDK. In cryptuiapi.h of new MS SDK, it define as following:
PCCERT_CONTEXT
WINAPI
CryptUIDlgSelectCertificateFromStore(
IN HCERTSTORE hCertStore,
IN OPTIONAL HWND hwnd, // Defaults to the desktop window
IN OPTIONAL LPCWSTR pwszTitle,
IN OPTIONAL LPCWSTR pwszDisplayString,
IN DWORD dwDontUseColumn,
IN DWORD dwFlags,
IN void *pvReserved
);
So I guess CryptUIDlgSelectCertificateFromStore and CryptUIDlgSelectCertificate have same parameters. And I write some codes to invoke CryptUIDlgSelectCertificate API. But it doesn't work(the program can be compiled, and it runs well, there is no error. But the selectcertificate dialog can not popup ). The following is source code:
if(hStoreHandle = CertOpenStore(
CERT_STORE_PROV_SYSTEM,0,NULL,CERT_SYSTEM_STORE_CURRENT_USER,
L"MY"))
printf("The MY store is open. Continue.\n");
else {
handle_error("The store did not open.");
goto handle_error;
}
HINSTANCE hLib;
typedef PCCERT_CONTEXT (WINAPI *fnDLLProc)(
HCERTSTORE,
HWND, // Defaults to the desktop window
LPCWSTR,
LPCWSTR,
DWORD,
DWORD,
void *
);
fnDLLProc lpfnDLLProc;
//
hLib = LoadLibrary ("cryptui.dll");
if (hLib)
{
lpfnDLLProc = (fnDLLProc) GetProcAddress (hLib, "CryptUIDlgSelectCertificateW");
pCertContext=(*lpfnDLLProc) (hStoreHandle, GetDesktopWindow(),NULL,NULL, 1, 0, 0);
FreeLibrary (hLib);
}
I think I had better know the parameters of this API. Could anybody tell me the parameters of this API, or the errors of my source code.Thanks a lot!
|
|
|
|
|
Hi Friends,
when i call a MSMAPI object from a standalone exe in VB .NET, i am able to send a mail. But when i spawn this exe as a process from a windows service, i get an error message while signing on using the MAPI session SignOn() method. I tried using windows service logon as both local system and using my NT logon too. The error message thrown is
System.Runtime.InteropServices.COMException (0x800A7D1A): Not supported
at MSMAPI.MAPISessionClass.SignOn()
at ProcTryMail.tryMail.Pr_SendMail() in D:\Projects\Ems\Backup_Nov17OutSeq\ProcTryMail\tryMail.vb:line 20
My feeling was that some security access is required.
The code i have used is:
Public Class tryMail
Private objMapiSession As MSMAPI.MAPISession
Private objMapiMsgs As MSMAPI.MAPIMessages
Private i As Boolean
Public Sub Pr_SendMail()
Try
objMapiSession = New MSMAPI.MAPISession()
objMapiMsgs = New MSMAPI.MAPIMessages()
objMapiSession.SignOn()
objMapiMsgs.SessionID = objMapiSession.SessionID
objMapiMsgs.Compose()
objMapiMsgs.RecipDisplayName = "--give some mail id here--"
objMapiMsgs.MsgSubject = "From .NET MAPI"
objMapiMsgs.Send()
objMapiSession.SignOff()
Catch
End Try
End Sub
End class
Will be grateful if anyone of u is able to find out the problem.
Thanks
Alex
|
|
|
|
|
Hi,
I am trying to use the picturebox to display some images. The source images are 16x16 icons and they look fine in designer mode when the picturebox is scaled up to 64x64.
However at runtime, the images get blocky and they appear not to have scaled properly to the new dimensions. I had seen an article on here at one time which outlined this problem but i can't seem to find it.
If anyone has any insite on this issue I would appreciate it.
Regards
Paul
|
|
|
|
|
I recently had the need to stream data to a running application using anonymous pipes. I was very surprised to find it so hard in .NET!
I ended up using the "CreatePipe()" and "CloseHandle()" functions using "DllImport(kernel32.dll)".
Is there really no native support for pipes in the FCL?
|
|
|
|
|
I'm an admitted "pipes" newbie; I've done some reading on named pipes, and that's about it. I think that MS is moving away from named pipes (which might not be the same thing you're talking about).
I'd normally use sockets or something else, but I realize you might not have that luxury. Are you saying that this application you had to interface with is not your own, which dictates the choice of pipes? If so, and there's no direct support, I feel for ya.
Regards,
Jeff Varszegi
|
|
|
|
|
It's actually "anonymous pipes" I'm talking about (e.g., not "named pipes"). When you create an anonymous pipe, you get TWO handles - one you use on your side of the connection, the other you pass to the remote application. The pipe is "anonymous" in that there is no "name" for it - there is no need, as both sender and receiver can access it using the handles that are returned.
The application I'm interfacing with is Microsoft Flight Simulator 2002 (MSFS2k2). There is a facility built in to MSFS2k2 to send it a "Flight Video" by passing it a handle to an open file containing the video. By using an anonymous pipe, I can have one process create and send a video to MSFS2K in real-time. This is what I want to do.
I have it working now, but I sure am surprised if in fact MS.NET doesn't provide support for this - especially as it continues to be a necessary tool for interacting with MS products...
|
|
|
|
|
I have this problem and I don't have any clue:
On a Win2K Advanced Server SP4 with Terminal Server I have installed the .NET Framework 1.1. I created a HelloWorld Console Application and installed it on this server. In the same folder I placed a textfile.
When I log on with a user account the Hello World app won't start. I don't see or hear anything! Not even error messages. I can access the folder and open the textfile. In the taskmanager I don't even see a process being created or something.
When I log on with an admin account it all works just fine!
I really don't know where to look for.
Why create waste if we throw it away, anyway?
|
|
|
|
|
This sounds like a .Net security issue to me.
I had a similar problem running an application from a network drive.
When I did so, it did not work, when I ran it from the local drive, it worked fine.
I don't have any knowledge on the .Net security model yet, but maybe someone can point to a good resource on this, or eplain what could be happening?
Pauwl
|
|
|
|
|
This was a tough search, but this KB article is the solution:
http://support.microsoft.com/default.aspx?scid=kb;en-us;821546
(Especially the part about Creat Global Objects)
grtz en thanx for spending time on this one...
Octavie
---------------------------------------------
Why create waste if we throw it away, anyway?
---------------------------------------------
|
|
|
|