|
Hi,
Can anybody help me with my problem?
How to load RTF file with pictures in CRichEditCtrl?
I know how to insert picture (BMP) file in my CRichEditCtrl.
I also know how to save the contents of the CRichEditCtrl as RTF file.
I need to load a RTF file with pictures (BMP) in it, in my CRicheEdit control,
but I don't know how to do that.
Can you help me?
Thanks!
Yasen
|
|
|
|
|
I have a dialog in which i create buttons dynamically, i have derived my own class called CBokningsButton from CButton... here's the problem, i get an assertion error when i try to do: m_tooltip.AddTool(GetDlgItem(9001 ,"hey"));
the assertion error is: ASSERT(::IsWindow(m_hWnd));
the wierd part (or the part I find wierd) is that i can do this if i double create the buttons. it hard for me to explain exactly how i mean but ill try:
When i run the prog it creates some buttons then if the user change some stuff it deletes the buttons and create new ones. each button represents a different time in a day, depending on which day the users select the buttons can have a different layout depending in the information i get from a mysql database.
So before i create buttons i delete the old ones like this:
CBokningsButton* ptrButton;
for(int t=0;t<200;t++)
{
if( (ptrButton = (CBokningsButton*)GetDlgItem(9001+t)) != NULL)
{
// button exists
ptrButton->DestroyWindow();
}
}
now i know this i like the worst solution ever to delete buttons but never mind that now, the thing is that if i replace the DestroyWindow() line with my AddTool line i get the tooltips to work the second time i create the buttons (rember that now the old ones hasnt been deleted so the new are just printed on top of the old ones).
If i try to do the AddTool any place else in the program i get the assertion error...
i thought it to be most logical to do AddTool at the same time i create the button but that gives me the same error
does anyone know what im talking about and if so can you help me?
thanx
/Eric
|
|
|
|
|
Hai everybody..
I want to make the FlexGrid cell as EditBox...I have wtitten the code for this but when move out of that cell after editing cell is not getting its border back...can anybody help me???
ThomasKennedyBose
|
|
|
|
|
How are you doing this because I have played with this option just for fun so I could be able to help.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I have Dockable Window...Iam placing FlexControl over it...when the user clicks on it(on a perticular cell),..it should be able to act as a EditControl and when the user leaves the cell or enters into next cell previous cell sholud be filled with the text and all the border lines should appear...I have created a Edit control and placing over the cell where the user will click..getting the string from it placing the on same cell(its border lines are not appearing properly)when the user leaves or enters the next cell.
I couldn't find much documentation on this FlexGrid any where...can u please help me !thanks in advance.
ThomasKennedyBose
|
|
|
|
|
Actually when I asked you I meant to see some source code because I can't really guess, but from your description my initial guess is that the Redraw property might not be set to true. If you don't know what that is go to the RC editor, right click on the grid and select PROPERTIES and there the tab ALL. Scroll down and find Redraw and make sure that is set to TRUE.
If that doesn't help, then show me some source code (please only the relevant parts) like when you enter the cell, how do you create the edit controll, and what do you do when you leave the cell.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I am using ShellExecuteEx to open files (any type), but need a reliable process handle returned - I am finding that if the file is already open, then the handle returned is NULL, which isn't a lot of help.
Any suggestions?
Thanks in advanced.
|
|
|
|
|
If the file is already openned, does the process that ShellExecuteEx() spawned open the file at all? In other words, what does the spawned process do? If ShellExecuteEx() returns a NULL, then I suspect that the spawned process is terminated.
Kuphryn
|
|
|
|
|
Hello, I have a question for you. I have an application wrote in Visual C++ .NET and I have a Sql-Server 2000 database. How can I read and write records in sql-server db with MFC classes of Visual C++ ? I didn't find any class that allow this. I can't use ODBC. Does exist some classes that allow to use SQL Statement to perform operations ? Can I "bind" my variable ? Does exist, at least, a class like CDaoRecordSet ?
Thank you very much for any answer.
Andrea
|
|
|
|
|
CDaoWorkspace
CDaoDatabase
CDaoRecordset
...
|
|
|
|
|
Why not use ODBC? It is fairly simple to develop a thin, wrapper class around it and completely shield your app from the ODBC API. Been doing this for years and works great (actually, just as fast as the native driver implementation and supports the new varchar(256+) ).
|
|
|
|
|
Hello Everyone
I am looking for a way to make transparent icons for a VC++ application. These icons will be used in a CTreeCtrl object so as the empty space of the icon gets the background colour of the frame.
Any help or suggestions is highly appreciated.
Thanks
Ankush
|
|
|
|
|
Hi,
When using icons into resource editor, look for the "transparent color" into the palette.
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Hi
I cannot seem to find the option of "transparent color" in the palette. Can you please give more details.
Thanks
|
|
|
|
|
Hi,
I use Visual Studio.NET so I don't really know how to open it in other developpement environment. Here for VS.NET...
I assume that you already have opened a icon resource into the resource editor. If you select the icon, you are supposed to see your icon with a palette toolbox. If you don't see the toolbox, you can make it display by clicking "image" in the main menu and selecting "show color menu".The transparent color is represented by computer-shaped color box.
hope that help.
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Dear All,
I am developing an application in which I require a "tree control with checkboxes".
The structure of tree control is as:
Main_Root
Child_1
Child_2
Child_3
Child_4
Child_5
Child_6
ie. simple tree having one main root and having many child items.
I have two problems related to it.
1)
All child items should be checked to TRUE whenever we click checkbox of 'root 'item and vice-versa. How to proceed for it ???????
I mean to say that which event should I capture for this.( ie. TVN_SELCHANGING )
2)
Is there any way to disable a particular check-box in tree control.
Please send some code for this if possible.
Thanks in advance.
Rohit
|
|
|
|
|
Hi Rohit
I have no practical experience with checkboxes in tree, but have worked a lot with trees otherwise, but I think I might be able to help you. For your first question, you can do the following steps
1. Once you click the root item you can traverse the children and then the subsequent siblings with a HTREEITEM. First use treename.GetChildItem(/*HTREEITEM*/ hItem) and check it, then you can use a while loop to check all other siblings by using treename.GetNextSiblingItem(/*HTREEITEM*/ hItem)
Try out the above suggestion, if you need help then please do let me know
Ankush
|
|
|
|
|
Hi friends
I want to pass a SAFEARRAY of BSTR from a unmanaged code to a managed assembly. My constraint is I can accept just an IntPtr in the managed code. I tried passing SAFEARRAY*, but could not convert it to Array or string[] in the managed code. Can anybody suggest how to achieve it?
vikram
|
|
|
|
|
hi there..
i am enabling mfc in an activex control and what happens is that when i debug it ..it throws an access violation in OLE32.lib..
dont know why..ne ideas?
regards
safee
|
|
|
|
|
hello
i work on MFC project SDI,and i have add to my window a new DIALOGBAR ,and i want to add in it some control like slider and button but i have a problem how i can get message from a slider because the new DIALOGBAR is child and not main and one of this problem is:
when i add slider and one EditBox and i want to watch the progression number of the slider in the Edit no thing happned.
can you help me please?????
|
|
|
|
|
Hi,
Because the dialogbar is a child, you have to catch the message from the slider control into the parent window.
You have to catch the slider message with onHScroll() or onVScroll().
So into your parent window (probably the mainframe) you can put into your mainframe.h:
CSliderCtrl myslider;
and
void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
into your
mainframe.cpp
DDX_Control(pDX, IDC_MYSLIDER, myslider);
ON_WM_HSCROLL()
and
void mainframe::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CSliderCtrl* slider = (CSliderCtrl*) pScrollBar;
int position = slider->GetPos();
OnHScroll(nSBCode, nPos, pScrollBar);
}
so after having the position, you can put the value into the edit box.
It's up to you from now
bye
Everything's beautiful if you look at it long enough...
|
|
|
|
|
i was made all what you tell me but it have an error in DDX_Control(pDX, IDC_MYSLIDER, myslider);
it's ask that pDX undeclared identifier,why?and when i must put it in the constructor or where exactely.
|
|
|
|
|
Hi,
DDX_Control(pDX, IDC_MYSLIDER, myslider);
into DoDataExchange(CDataExchange* pDX)
ON_WM_HSCROLL()
into the MessageMap
bye
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Hi,
I am using Microsoft DataControl Grid 6.0. While clicking on a cell, I have to display a combo Box in that cell.
The width and height of the combo box should be the same as the cell.In the grid ,the column and row size are resizable.But the combo Box placement and size both are not coming properly. I have used the following code.Help me.
CRect objRect;
float nRowHeight = m_DBgrid.GetRowHeight();
float nDataColLeft = objDataGridColumn.GetLeft();
float nRowTop = m_DBgrid.RowTop(nRowNo);
float nColWidth = objDataGridColumn.GetWidth();
CRect objRect1;
m_DBgrid.GetWindowRect(objRect1);
ScreenToClient(objRect1);
objRect.left = (int) (objRect1.left + 22);
objRect.top = (int) (objRect1.top + (-nRowTop) + (nRowNo + 2) * 2 ) ;
objRect.right = (int) (nColWidth + 22);
objRect.bottom = (int) (nRowHeight + objRect.top);
m_cCombo.ShowWindow(SW_SHOW);
m_cCombo.SetWindowPos(NULL, objRect.left, objRect.top, objRect.right, objRect.bottom, SWP_SHOWWINDOW);
m_cCombo.SetItemHeight(-1,(int)(nRowHeight - 1));
|
|
|
|
|
Hello!
I have a little problem: I want to access an acount on the web(using IE), from my Visual C++(6) application, knowing the url, user-name & password.
For example:
url: http://mail.yahoo.com
user: dorutzu
pass: the_password
All I want to happen is a new browser window to appear with my account opened in it.
Any ideea how this can be made possible(for any web-site)?
Thank you in advance...I'm waiting for your answers here or eventualy at dorutzu@yahoo.com
|
|
|
|