|
|
Services should not have a user interface. If you need a user interface to control the service, it should be implemented as a separate process and communicate with the service via named pipes or some other communications channel.
There was a security hole (although I believe it's fixed now) where you could send a WM_TIMER message to a service's window in order to elevate your privileges.
|
|
|
|
|
now i could create the systray icon. but i can't get those event when i click on it.
|
|
|
|
|
Hi all,
I want to Compress the data of BMP in RLE format Using GDI+.
I have tried the Save methode of Bitmap class with giving the EncoderParameters. But didn't work
While enumerating Encoder parameters for bmp codec (SDK sample), I am not getting the values. Does GDI+ not supporting that or I have to upgrade my codec?
My machine is XP and have installed latest Platform SDK.
Thanks in advance
Ajesh
|
|
|
|
|
Hi all
Where i can download an application(free is desirable) what can to help determine memory leaks in my application, i use VC6.0 and
Windows 98 but VC enviroment dont catch some one.Because of when i launch my application in other computer under WinNT
i see in debuger what memory running out.
Thanks
Sorry for bad eanglish
|
|
|
|
|
|
The guys on www.flipcode.com swear by Paul Nettle's memory manager. If you've got any doubts read some of the testimonials and thankyou's in the thread attached to the project.
It's not something I've needed to use myself, but if game programmers (especially console game programmers) who are severly limited on system resources think it's good then I'm guessing it is.
It also has the benefit of being free.
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=12September2000-PresentingAMemoryManager&forum=askmid&id=-1[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi,
When I had a memory leak I tried GlowCode. I found the problem in a matter of minutes, its easy to use and worked really well for me.
They do a free trial for 21 days, you can download it from here I believe....
http://www.glowcode.com/eval.htm
Cheers,
Ali
|
|
|
|
|
Hi,
I am writing a serial application to communicate with an external device using RS-232. Requirement is to Write to the external device continuously and read from the device continuously. I have created a thread that performs Read based on the event EV_RXCHAR. On receiving a character i would store it in my local buffer for processing.
I have implemented the write using a 1 millisecond timer in the same thread as read.
The problem is to make this application write and read based on events.
Is it logical to put this write function in a separate thread and will my application be still able to receive Read events?
Please suggest me as to what to be done.
Regards,
Siva
|
|
|
|
|
i've load and displayed a bitmap in a view using StretchBlt. it succeed.and now, how can i print it out on paper? i really got totally blank how to start it. i can't find any samples on printing bitmap from msdn library. can anybody please tell me where i can find related codes that i can refer to. or maybe steps on how to do it. thank you
|
|
|
|
|
Hi,
a little example
PRINTDLG pd;
DOCINFO di;
int iError;
float fx, fy;
float fPixXWnd, fPixYWnd, fPixXPrint, fPixYPrint;
float fScaleX, fScaleY;
HDC ScreenHdc;
// Initialize the PRINTDLG structure.
memset(&pd, 0, sizeof(PRINTDLG));
pd.lStructSize = sizeof(PRINTDLG);
pd.lpfnPrintHook = NULL;
pd.lpfnSetupHook = NULL;
pd.Flags = /*PD_RETURNDEFAULT |*/ PD_RETURNDC;
//open the Printdialog and get a HDC for the printer
if(PrintDlg(&pd))
{
memset( &di, 0, sizeof(DOCINFO) );
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = "DocName";
di.lpszOutput = (LPTSTR) NULL;
// Begin a print job by calling the StartDoc function.
iError = StartDoc(pd.hDC, &di);
if (iError == SP_ERROR)
{
ASSERT(0);
}
// Inform the driver that the application is about to begin sending data.
iError = StartPage(pd.hDC);
if (iError <= 0)
{
ASSERT(0);
}
//Get the Screen-resolution(1)
ScreenHdc = ::GetDC(NULL);
fPixXWnd = ::GetDeviceCaps(ScreenHdc, LOGPIXELSX);
fPixYWnd = ::GetDeviceCaps(ScreenHdc, LOGPIXELSY);
::ReleaseDC(NULL, ScreenHdc);
//...or get the Screen-resolution(2), not tested
fPixXWnd = ::GetSystemMetrics(SM_CXFULLSCREEN);
fPixYWnd = ::GetSystemMetrics(SM_CYFULLSCREEN);
//Get the Printer-resolution
fPixXPrint = (float)::GetDeviceCaps(pd.hDC, LOGPIXELSX);
fPixYPrint = (float)::GetDeviceCaps(pd.hDC, LOGPIXELSY);
//the alignment for your window-coordinate
fScaleX = fPixXPrint / fPixXWnd;
fScaleY = fPixYPrint / fPixYWnd;
....
e.g. you draw your Bitmap to your view with
StretchBlt(hdcWnd, 10, 10, 100, 100, hdcBmp, 0, 0, 50, 50, SRCCOPY);
now write the following for your Printer
StretchBlt(hdcPrint, 10*fScaleX, 10*fScaleY, 100*fScaleX, 100*fScaleY, hdcBmp, 0, 0, 50, 50, SRCCOPY);
HTH
Regards
Frank
|
|
|
|
|
Hi !
I posted a question yesterday about printing a postscript file in C++. I still need more informations about this. How can I, in C++ : open the printer device, write the file to the open handle, and close the printer device ?
Thank you for your help !
Jerome
|
|
|
|
|
Off the top of my head:
OpenPrinter
StartDoc
WritePrinter
EndDoc
ClosePrinter
if you need further advise, let me know. I've done it in one of my projects.
Joel Lucsy
|
|
|
|
|
Thank you for your answer. But I guess you are mentionning MFC functions, right ? I was trying to do it in standard C++ (I didnt mention it clearly in my question).
Thank you for your help anyway,
Jerome
|
|
|
|
|
Those are standard Win32 functions, no MFC needed. Did you try looking them up in MSDN?
Joel Lucsy
|
|
|
|
|
Actually, my application has to be crossplatform, so I'm not allowed to use any Win32 functions. This is why I wanted to do it using standard C++ !
Jerome
|
|
|
|
|
Ah, crossplatform, that is an entirely different matter. Since everything is a file under *nix you may be able to use straight file operations as long as you know how the printer is connected. Note, however, that Win32 and *nix completely differ on how printers are handled, you will have to right different code for each.
For *nix, look for the CUPS package. This is the only thing I know of that may make things easier for that platform.
Joel Lucsy
|
|
|
|
|
Hi All gurus,
I have a small problem regarding windows startup time..I have to add an application at windows startup..I have found many things on that and I have finished this part..but the real problem occurs when I restart or logoff..I want my application to be the first one to load..after necessary windows..programs..so that user is not able to access anything..before startup..and must see my application first..can anyone help me out..I know something can be done..Any help or pointers are highly appreciated..
Thanks a lot in advance,
Himanshu
|
|
|
|
|
Hi Himanshu
I know 2 ways:
- move your program (link) to the autostart folder
- write your program as service and start the service always -> systemsettings (I think the better way)
Regards
Frank
|
|
|
|
|
There is no way, short of replacing system files, to guarantee that your application will be the first to start. Items in the startup folder are loaded after all services have been loaded. Even if it were a service, you could only guarantee that it start AFTER another application, but never before.
|
|
|
|
|
how to create text editor into single dialog/mfc???? (like notepad)
or can I link notepad into my program??
====================^_^
|
|
|
|
|
ariez wrote:
how to create text editor into single dialog/mfc???? (like notepad)
You can run the MFC application wizard to build an SDI application, but on the very last step, select CEditView as the base class. Compile the program and you will have a text editor without writing a single line of code.
ariez wrote:
or can I link notepad into my program??
You can run notepad from your program by using ShellExecute(). Check MSDN on how to use that function.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Check out the Wordpad example on MSDN.
|
|
|
|
|
Hi,
How to use VC++ to trigger a list box's onChange event for a Select object in a html page.
I use CHtmlView, I can get the Interface of the listbox. I also use put_selectedIndex to chance the select item.
Thanks a lot!!
Alan Shen
|
|
|
|
|
Hi:
I create a splitterwnd in my application with 2 rows ,1 colume.I want to change the size of one pane in the SplitterWnd(such as the view in first row),and I can't find a function in MSDN to do so. How could I do?
Thanks
Benben
|
|
|
|