|
i haven't worked on vs.net but in vc++ vs6.0 we do it like this::
1: add a dialog to the resource.
2: using classwizard add a class to this dialog resource.
3: in initinstance() write
CDialog1 dlg;
dlg.domodal();
4: or whereever you need this code i.e. if yo want to show this dialog at click of an button add this code to the message handler of that button's click event.
that's it.
i hope you get an idea of how to proceed.
cheers..
Himanshu
|
|
|
|
|
thanks for your answer. if i use a Dialog as CDialog Base Class then i can't use this Dialog for Moitoring the information. i want to Use a Dialog for monitoring (so the Focus is always Set on the Main Window and this Dialog never Gets Focus)
may be using Dialog for this reason is wrong. what should i do ?
|
|
|
|
|
my question:
in my app,i want to print some text by a bitmap.and the text is dynamiclly changed when printing .
now i want to do so:
build a temporary bitmap, load the bitmap and text out some text to the
bitmap ,and save bitmap .then if i use ACDSEE to look at the bitmap we can find the text in the bitmap;
but how can i do ?i want to programe a general function;
bool TxtToBitmap(CString &strBmpFile,CString &strOutputText)
then after i use the function ,i want the strBmpFile can include the strOutputText
who can help me?thanks!!
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
at www.aoi.it, there is cximage (v5.50) with a DrawText method.
|
|
|
|
|
dear all,
i want my mfc dialog based application to detect system shutdown.
is there any way to do it?
thanx
|
|
|
|
|
Handle the WM_ENDSESSION message, you can examine the parameters to tell if it's a shutdown or just the user logging off.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
(hi,
I used following lines of codes::
CString strEdit;
GetWindowText(strEdit);
but it is giving an error as ATL::GetWIndowTextA() cannot convert parameter 1 from Cstring to unsigned short**. But when I type it is asking for a Cstring only.
can anyone help me out!!!!!!!Please...
Himanshu
|
|
|
|
|
The ATL function CWindow::GetWindowText() doesn't work with CString s, since CString is MFC. You need to pass a BSTR or a CComBSTR (easier to use, it handles memory management for you).
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
thanks a lot Mike. It worked.
cheers..
Himanshu
|
|
|
|
|
Hi,
I want to design a 8086 Assembler in VC++ for my college Project. Please tell me which book I should follow to design the Assembler .Please Help me.
|
|
|
|
|
I have a dll that includes a particular header file. In my main application code it too uses the same same header file. When I include the header file for my dll it tries to inclue the header file twice. How do I get the compiler to only include the file if it has not already been loaded?
Example:
DLL.h File -
#include "Myheader.h"
MainApp.h File -
#include "Myheader.h"
#include "DLL.h"
Thanks for the help,
-Eric
|
|
|
|
|
The standard way to prevent multiple inclusion of a header file is to add this in each .h file. This example depicts foo.h.
#ifndef foo_h
#define foo_h
...
#endif
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ok.. I found it.
Needed to use #if !defined and #endif in the header file.
-Eric
|
|
|
|
|
In Myheader.h:
#ifndef MYHEADER_H_INCLUDED
#define MYHEADER_H_INCLUDED
#endif There is also the #pragma once command, however I prefer the #ifdef method so that I can test for the presence of the symbol to tell whether a header has been included.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi all,
I was wondering...
How can you give the desktop or taskbar the keyboard focus?
I know there is an SetFocus function but that only works for a window that's your app own.
Aidman » over and out
|
|
|
|
|
In the Platform SDK for SetFocus, it includes the following sentence:
By using the AttachThreadInput function, a thread can attach its input processing to another thread. This allows a thread to call SetFocus to set the keyboard focus to a window attached to another thread's message queue.
Which should help you get around the (deliberate) limitation. You could always detach straight after.
Iain.
|
|
|
|
|
But how can I get the Thread handle of the Desktop or Taskbar wich need to attach to?
Aidman » over and out
|
|
|
|
|
GetWindowThreadProcessId should give you the information you need.
Iain.
|
|
|
|
|
I tried to that, but I don't really understand how it is supposed to be done. Must I do this in a callback function or can I do it in the winman? Could you please demonstrate this process in code please?
Aidman » over and out
|
|
|
|
|
I'm using SetTimer() and KillTimer() with the simple WM_TIMER event in my CWnd application.
Given the ID number for a timer which has been set, is there a way to find out how much time is remaining before the next call for that timer?
|
|
|
|
|
No, for two reasons. 1, the timeout you pass to SetTimer() is usually not the same as the actual timeout used by the OS. The actual timeout is always a multiple of a hardware timer (about 55 ms I think on Win 9x). 2, WM_TIMER is posted to your message queue, and it's impossible to predict how much time will elapse before that message is processed.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
hi,
using the MFC, I just want to have a window in which u can chat, so with an edit control at the bottom and also a view to display a text.
and then my real problem will be to display a text on this window, I thing that I will have to use the OnPaint(), but I don't really know how to deal with that stuff.
thx for ur help.
--
Kas'pac'll be back.
|
|
|
|
|
Hello.
You can use the CFormView Class .The FormView have a look like Dialog.You can place a RichEdit control on the top of form view and place a Edit control on the bottom of form view.
Good luck!
|
|
|
|
|
Hi,
thanks for ur idea TLiu, I'll try that, but I still wonder how to do to display a text on the RichEdit control.
thx very much.
--
Kaspac'll be back.
|
|
|
|
|
You can reference to MSDN about CRichEidt.I remenber that there is a sample in MSDN about wordpad.Using CRichEdit in the sample.;)
|
|
|
|