|
Hi Sarath,
Thanks for the reply.
I have created m_FCONT of CRichEditCtrl,
for reading the contents is this function enough ??
char ch;
FILE *fp;
fp=fopen(str,"r");
ch=getc(fp);
while(!feof(fp))
{
ch=getc(fp);
}
|
|
|
|
|
vinaycool wrote: ch=getc(fp);
Reading one character at a time is not very efficient. I suggest using CRichEditCtrl::StreamIn() .
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
I create a dialog dynamic, and only can move it in the main dialog.I have not ever set its parent. How to do to move it out of main dialog?
My app is based on dialog.
Thank in advance
|
|
|
|
|
chybin wrote: I create a dialog dynamic, and only can move it in the main dialog.I have not ever set its parent. How to do to move it out of main dialog?
Make it a popup window by adding WS_POPUP style to it. Now I guess it's a child (WS_CHILD ). So remove WS_CHILD and add WS_POPUP .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
|
I need to use a function which draws to a window using it's HWND handle, now I need to draw to a bitmap object rather than the window (It's now server based and there are no windows).
Is this possible? How would I go about it?
Thanks in advance!
|
|
|
|
|
the first thing you should do is:
HDC hDc = GetDC(hWnd);
then you can create a compatible bitmap, select it into your DC, and start drawing on it.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
I was hoping to do this without a window but if I have to create a window then that will be OK but I have been trying to make this work for 2 days now with no luck.
If I use the code:
<br />
page.DrawEx(0, 0, rect, 0, 0, (short)dZoomFactor);<br />
Then it renders the image perfectly in the top corner of the desktop window without any problems but when I create a window and pass the hwnd and DC (Tried GetDC and GetWindowDC), I get nothing.
My eventual aim is to render the page to a bitmap and save as a graphic file.
Any pointers in the right direction?
Thanks,
Dan
|
|
|
|
|
Hope I understood your question
<br />
HDC hdc=CreateCompatibleDC(::GetDC(this->m_hWnd));<br />
HBITMAP hbit=CreateCompatibleBitmap(GetDC()->m_hDC,800,600);<br />
hbit=(HBITMAP)SelectObject(hdc,hbit);<br />
hbit=(HBITMAP)LoadImage(AfxGetInstanceHandle(),"d:\\error.bmp",IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);<br />
<br />
SelectObject(hdc,hbit);<br />
BitBlt(GetDC()->m_hDC,0,0,800,600,hdc,0,0,SRCCOPY);<br />
<br />
whitesky
|
|
|
|
|
Good. I'm just in time. This is C file handling code, you should never use it. Instead use ifstream and ofstream.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is it possible to automate Outlook Express such that I can create a message with
- a recipient
- a subject
- and an attachment
even if Outlook Express is not the default mail client? I am aware of MAPI but, would love to have something that can work with Outlook Express alone and Outlook alone.
Thanks
|
|
|
|
|
|
hi! thanks for the answer.
i already saw this article and while it does create messages, it doesnt seem to do what i want.
What I need is to create a message with an attachment, then display that message window. That article doesnt seem to handle this but just processes the messages in the OE Store itself. Or am I missing something?
|
|
|
|
|
Hi Does anyone know how i can remove individual items from a toolbar in a SDI app ?
not 'grey' the button but actually remove it
thanks
Si
|
|
|
|
|
si_69 wrote: Hi Does anyone know how i can remove individual items from a toolbar in a SDI app ?
not 'grey' the button but actually remove it
I think you are design the Toolbar and you don't want some button's
Simply drag the buttons from toolbar and drop any where...
hope i think right way...
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_LaxmanSimply drag the buttons from toolbar and drop any where...
hope i think right way...
no, i want to do this programmatically, not at design time
depending on how the user access my application, some toolbar items
will not be visible
thanks
|
|
|
|
|
si_69 wrote: o, i want to do this programmatically, not at design time
depending on how the user access my application, some toolbar items
will not be visible
Get the Handle of the button and use
ShowWindow(SW_HIDE);
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Open the resource editor in your application and select Toolbar entry from the window that is displayed.
From there select IDR_TOOLBAR and open it.
Just click on the button you don't need on the tool bar and drag it to any empty space on the window.
That is all...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I remember that some time ago, I needed to do the same for my app.
What I did was retrieving the CToolbarCtrl class (through GetToolbarCtrl[^]) and then disabling the button with EnableButton[^].
I remember there was some issue because the toolbar was not properly refreshed (you had to move it first and then it displayed correctly). I solved this issue but I don't remember exactly how (I think by resizing the toolbar by code).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
si_69 wrote: not 'grey' the button but actually remove it
Use HideButton or DeleteButton .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
I'm not getting hide button function neither in Visual Studio 2003 nor Visual Studio 6
So i think this will work fine.
m_wndToolBar.SendMessage(TB_HIDEBUTTON, nIndex, MAKELPARAM(bEnable, 0));
SaRath
|
|
|
|
|
SaRath C wrote: I'm not getting hide button function neither in Visual Studio 2003 nor Visual Studio 6
So i think this will work fine.
m_wndToolBar.SendMessage(TB_HIDEBUTTON, nIndex, MAKELPARAM(bEnable, 0));
It's a member function of CToolBarCtrl and not of CToolBar .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
wrote: It's a member function of CToolBarCtrl and not of CToolBar.
No issue it works fine..
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
hi friends,
i want to change the text colour of a static text, when the mouse cursor stays over it.it'll be realy great if someone can help me out in this.
thank you in advance
rajeev
|
|
|
|
|
rajeev82 wrote: i want to change the text colour of a static text, when the mouse cursor stays over it.it'll be realy great if someone can help me out in this.
You can derive the class from CStatic and override the MouseOver and MouseLeave Messages.
Knock out 't' from can't,
You can if you think you can
|
|
|
|