|
(I'm sorry to post it again but I'm in a hurry. I'd like to know how I do that?)
I want to modify or set global printer setting.
1) Enter to Control_Panel -> Printer
2) right click on printer list and change setting
but I want to set from visual c++
How can I do that ?
Thank in advanced for your kindness
|
|
|
|
|
I've been to CodeGuru, I feel dirty. Google was how I found this link:
http://www.codeguru.com/printing/SetPrinter.shtml[^]
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I want to change properties in global printer setting. I don't want to change default printer.
Please help me
Thanks in advanced
|
|
|
|
|
What does 'global printer setting' mean ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi again
I want to print from a command line program like this
C:\print_job.exe "My Printer" job_file
so the command line program will print that use global printer setting (system printer setting)
the meaning of global printer setting is something like this
1) Enter to Control_Panel -> Printer
2) right click on printer list and change setting
Please help me
Thank you so much for your kindness
|
|
|
|
|
What you're saying makes no sense. ALL printers are visible globally, if you have more than one then one must be the default, and there fore the one you print with. You want to change things like which pages you print and the page alignment ? The CPrintDialog does that, I am sure.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi again and again
More detail:
I have some limitation this
1) I have C:\print_job.exe in binary file so I can't modify print dialog that you mention it above
2) so if I run command c:\print_job.exe "My Printer" job_file. It'll print to "My Printer" and use global "My Printer" setting
3) so I must write another application to motitor print_job.exe process and check paper_size on job_file and then modify global "My Printer" setting
4) I try to use OpenPrinter , DocumentProperties and SetPrinter but It doesn't work. I can't set paper size to printer setting
I try level 2 (Printer_info_2) , level 8 (Printer_info_8) and level 9 (Printer_info_9). It doesn't work all
Am I miss understanding (windows printer concept) ?
How could I do ?
Please help me
Thank you so much for your kindness
AhMan
|
|
|
|
|
AhMan wrote:
I have C:\print_job.exe in binary file so I can't modify print dialog that you mention it above
It's a class, you create it and set the options you want. You don't need to interact with a window.
AhMan wrote:
global "My Printer" setting
ARGH !!!!! There is NO global printer setting !!!! The ONLY thing you can mean here is the default printer.
AhMan wrote:
check paper_size on job_file and then modify global "My Printer" setting
You want to modify the page size for a print job, there is nothing global about it.
AhMan wrote:
Am I miss understanding (windows printer concept) ?
Yes.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Just starting to "fool around" with ActiveX controls...
Is it possible for a method to return a pointer to an object? The only ActiveX return type I see that looks reasonable to use is LPUNKNOWN, but I run across all kinds of problems when trying to use it. I'll keep researching, and reading about methods, but if someone can point me in the right direction, I'd appreciate it.
For the sake of discussion, assume my ctrl class has a member variable of...
CMyClass *testptr;
CMyClass has been dynamically allocated in the ctrl, and I want the container to have access to it. Is this possible, or is it a violation of ActiveX design standards?
Thanks.
|
|
|
|
|
Most of the third party ActiveX components I work with return VARIANT , whuch I then access it's particular data member and then cast it to the proper data type. I think this is mainly for compatibility with, well... *whispers* vb
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
work_to_live wrote:
Is this possible, or is it a violation of ActiveX design standards?
it's bad design. the proper way is to expose a bunch of get/set or property members that operate on CYourClass. 1. in general, you can't be sure that the container is a C++ app (maybe in a limited use sense you can, but in general it's a bad assumption) 2. you can't assume your object will even be in the same memory space as the container (same assumption as above).
-c
Please stand by
|
|
|
|
|
Point well taken... More specifically, what I want to do is make an array of chars available to the container. As I mentioned before, I'm just starting to look into ActiveX, so my questions obviously expose my inexperience. Continuing with your suggestion, how would you expose an array of chars to a container? BTW, I'm using Visual Studio 6.0, and after doing some research, found that there is a valid return type of byte * that was in error left out of the VS products. Oh well, I'll continue my... studies tomorrow.
|
|
|
|
|
work_to_live wrote:
how would you expose an array of chars to a container?
i think a SAFEARRAY is the standard way of doing this. if it's just an array of chars, you might also be able to sneak it in with a BSTR, but that's not polite.
-c
Please stand by
|
|
|
|
|
I tried the impolite method, since it seemed more straight forward, and I wanted to make some headway... But it may have bitten me.
As I mentioned before, I have a method that wants to return some binary data to a container. The method was created with a return type of BSTR. Here's the last few lines of code that I used to copy the char[] into the BSTR...
// fill a BSTR with the char array
(p_allchars is a pointer to a binary character array)
(totalchars = the number of chars to copy)
BSTR bStr = SysAllocStringByteLen(p_allchars,totalchars);
// delete the allchars variable, now that the data is in bStr
delete[] p_allchars;
return bStr;
When I look at the result in MFC's Control Test Container, it's garbage. I think I misused SysAllocStringByteLen, but I'm not sure. Any hints?
I'm getting an uneasy feeling that I need to read up on UNICODE and related operations...
|
|
|
|
|
hello,
i want to make a real 'break' ('pause') in my mfc program. the program should wait one or two seconds and then it should go on.
how can i do it ?
lucky
|
|
|
|
|
::Sleep will work just fine. You MFC program won't even process any window messages. (In other words, it will seem to be locked up to the user.)
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
sounds cool. i tried something like
sleep(1000);
but it do not work. (error: program does not know 'sleep')
sorry, but i have no msdn here. how must i use 'sleep'?
sunny
|
|
|
|
|
I believe the S is capitalised, as it was in the example given. 1000 equals one second.
An alternative is the user a timer, but Sleep will do what you want in this instance. A timer will allow your program to keep doing something while it 'waits' for the passage of time.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
yes, the S is capitalised.
the sleep is working fine, but i need something else:
the program should only wait, but stop working not completely.
the previous works are to be processed and then the program should go on. unfortunately it is not requestable, whether that the processes completely finished before, thereforei needs a pause, which does not freeze everything.
what can i do?
lucky
|
|
|
|
|
Ah - then Tim's answer was correct, but your question was wrong. You need to do what I said in the last post, set up a timer. I forget the syntax but if you look up WM_TIMER in MSDN you should have no trouble finding it. It's something *like* SetTimer(42, 2000, NULL), where 42 is the number that identifies your timer ( and is passed to the WM_TIMER message handler you'll need to set up with the Class Wizard ), 2000 is the number of milliseconds ( so this one waits for two seconds ) and NULL means you're not specifying your own callback for the timer. I also believe the timer will go off over and over again, so you need to KillTimer(42) when you catch it. But my MFC/Win32 days are long behind me, you should verify the details in MSDN.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hi,
i have a mfc program with a thread:
<br />
DWORD WINAPI ThreadProc (LPVOID pvoid) <br />
{ <br />
while (TRUE) <br />
{<br />
....<br />
} <br />
return 0; <br />
}<br />
<br />
void CDialogMe::OnMy()<br />
{<br />
DWORD WINAPI ThreadProc (LPVOID pvoid);<br />
HANDLE hThread; <br />
DWORD ThreadParam = 1;<br />
DWORD ThreadNr;<br />
hThread = CreateThread (NULL, 0, ThreadProc, &ThreadParam, 0, &ThreadNr);<br />
....<br />
}
but it do not work. what´s wrong????
sunny
|
|
|
|
|
|
That is just a prototype which is perfectly valid.
My question would be is the CreateThread routine even being invoked. If so, what error is it returning. If CreateThread is working, then set a break point in the thread proc.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
thank you very much ....but the problem was not the thread......sorry
i found the mistake.....
sunny....
|
|
|
|
|