|
I have a text/rich text box on a dialog. Vertical scroll is enabled for this text box. I write text on the text box. Ofcourse some text may be hidden that we can see after scrolling up or down.
Now i want everything written in the text box to be represented by a CBitmap object. How can i do so ????
Actually i want the contents of text box to be stored in a bmp file. I know how to store CBitmap contents in a BMP file, but i don't know how to first represent the text box contents in CBitmap object (as it is).
Thanks
|
|
|
|
|
you can redirect a RichText control's output using the DrawBand and FormatRange calls. i don't have any code handy to share, but it really only takes a few lines to do this. try googling on those function calls.
-c
|
|
|
|
|
You can also create a memory DC, send the control a WM_PAINT message with the handle of that DC, and extract the BMP from the DC.
|
|
|
|
|
When you right click on ANY files,you will see popup menu with SEND TO option,which you can send files to Floppy disk,Zip compressed File,My document and..... . How can I add an option to it,I think I should do it with registery.
Also how I can add menu to popup menu of specific extention,,I mean when I right click a specific extention in win explorer,it show up with additional action ,something like "Enqueue in winamp" for mp3 file.
Thanks
Mazy
No sig. available now.
|
|
|
|
|
|
Yes,I found your articles.
Mazy
No sig. available now.
|
|
|
|
|
hello
i had add a ressource at my menu it's Slider and the name that give to it it's IDC_SLIDER1.
i want to have the position of the slider with GetPos( );
must i use IDC_SLIDER1 or what to have the position and initialise the range and position?
|
|
|
|
|
If you don't want to use DDX you could add a pointer to a CSliderCtrl called m_wndSlider and then use the code below
int initfunc()
{
m_wndSlider= ((CSliderCtrl*)GetDlgItem(IDC_SLIDER1));
m_wndSlider->SetRange(0,100);
m_wndSlider->SetPos(0);
return 0;
}
int getSliderValue()
{
return m_wndSlider.GetPos();
}
KMaz
|
|
|
|
|
i import a bitmap in Resources then get it's ID,but how can i retrive his handle .
i tried
myStatic.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(ID_of_mypic)));
but my pic doesnot appear.
|
|
|
|
|
|
hello
i had add a ressource at my menu it's Slider and the name that give to it it's IDC_SLIDER1.
i want to have the position of the slider with GetPos( );
must i use IDC_SLIDER1 or what to have the position and initilise the range and position?
|
|
|
|
|
i put a picture control onto a form,& i wanna change it's content in a button click event.i've tried with function (CStatic)SetBitMap ,but it seems doesn't work! it puzzled me for two days ,somebody help me!;P;P
|
|
|
|
|
first, go to classwizard from by right clicking on your dialog class
click the member variables tab and add a variable for your picture CStatic as a CStatic CONTROL, and call it m_picture. Now left click on your CStatic in the resource editor and make sure it's set to type: bitmap
Now double click on the button you want to control the picture change in the resource editor and let it add the mapped function for you by hitting "ok".
Now you should be in your dialog with the new button pressed mapped function
now add this code like so
void Cdlg::OnButtonClick()
{HBITMAP hBitmap = (HBITMAP) ::LoadImage(NULL, _T("C:\\some\\image\\location.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
m_picture.SetBitmap(hBitmap);
}
now compile and watch as the code works.
PS- that obviously works just as well using a resource bitmap, and if it's not a dialog you would obviously create the CStatic naming it m_picture(class member) and initialize it and show it before using it.
|
|
|
|
|
THANK U!!!!!!!! IT WORKS!
|
|
|
|
|
Hi everybody
I am trying to use the CheckSpelling method of MSWord in order to check how a word is spelled. It works perfectly with English but I want to test also against Spanish words. Now I have installed Spanish in Word. I have checked that word must detect language change automatically and also when testing against Word spell check works fine with Spanish words.
The method call that I use is:
oWordApp.CheckSpelling(szWord, vOpt, vTrue, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt);
It seems to me that I cannot find a way to change the spellchecking language in runtime. I would appreciate any suggestion.
Thank you very much.
Spiros Prantalos
Miami the place to be!!
|
|
|
|
|
Hi,
I have a listview as one of my splitter panes. A function in this view is as follows:
void MyFunction(CString* str)<br />
{<br />
}
But whenever I try to do so, it asserts saying that it isn't a window. A listview works just fine in another 2 applications I have a listview in.
Everything is standard...I haven't overridden any functions. The documentation says I don't need to create a ListCtrl because the view did.
Any suggestions?
Shutter
|
|
|
|
|
this may sound awkward, but did you try passing the CString by value instead?
I've had some nasty stuff happen when I tried passing CStrings by a pointer then using them in controls.
hey
|
|
|
|
|
That was a typo there...actually, I'm just using a CString instead of a CString*... I did try your code, but unfortunately it didn't work either.
I've tried many functions... they all assert. It seems to think that there isn't a window there.
Perhaps it's a cast of some sort that I'm missing...I really have no idea.
Shutter
|
|
|
|
|
Add a member variable to the main frame that corresponds to the listview.
Kuphryn
|
|
|
|
|
Could you expand on that?
Shutter
|
|
|
|
|
In your code you get a pointer to the listview via GetListBox(). I meant you could assign a member variable to the listview instead of GetListBox().
Kuphryn
|
|
|
|
|
There's also the possibility that if you call this function from a thread that is not the creator of the listview control, this assert will fire (something like ASSERT(IsWindow(..))). Is this the case?
|
|
|
|
|
I haven't involved separate threads in the application. I've tried creating a ListCtrl in a formview, tried adding a ListCtrl into a CView, tried using a CListView... but still no luck.
The thing is, I can see the header when I have it in Report mode, and Spy++ picks up on the windows messages for it. But even calling IsWindow on it returns false.
What gets me is it's a CListView with no modification whatsoever. Oh well, I'll try more in the morning.
Shutter
|
|
|
|
|
What is the value of m_hWnd at the time you get the ASSERT failure?
Is it NULL? You haven't created the window.
Is it 0xDDDDDDDD? You have deleted the CListView object.
Is it 0xCDCDCDCD? I don't know how this could be. But it is interesting. (It would mean m_hWnd had not be initialized.)
If it is something else, what is it?
--------
There are 10 types of people in this world. Those who know binary and those who don't.
|
|
|
|
|
It comes back null. But isn't the ListView supposed to create it?
|
|
|
|