|
Try with the interface ICopyHook . For more details look at windows shell programming.
|
|
|
|
|
hi,
i added to my consol application (supporting MFC) the microsoft winsock 6.0 control.
my problem is : i don't know how to work with it.
i know the Create() , Bind() , Connect() function in CSocket class, but i can't do the same with CMSWinsockControl class........
can any1 write sample code or refer me to one that shows how to handle this class???
tnx again.....
uzeb
|
|
|
|
|
I make an editor with a CRichEditView, I want to add a page break function.
How can I add a page break in this control ?
I found a page break effect in PARAFORMAT2 but it's disable.
Is someone have an idea ?
Than you
|
|
|
|
|
This Microsoft article http://support.microsoft.com/support/kb/articles/Q99/8/00.ASP
says that by just calling ShowWindow(SW_HIDE) will hide the app from
both the task bar and task list. I tried in Win98 and it just hides from task bar but
NOT the task list. Any help is appreciated.
Thanks.
|
|
|
|
|
If 'Task List' means 'Process List', use RegisterServicesProcess
function. Register service program through this function,
this process will be not shown at CTRL+ALT+DEL dialog box.
To find more information, visit here,
http://msdn.microsoft.com/library/psdk/win95/95func_3t0z.htm
|
|
|
|
|
Hi all,
i am drawing the listitems by myself using OnCustomDraw().
Calculating the text length i am using pDC->GetTextExtended(s) where pDC is the DC i received in the parameter struct.
That's working fine, but if i want to calculate the text lenght in another member function using:
CDC *pDC = GetDC();
CSize cs = pDC->GetTextExtended(s);
where s is the same string, i get a different size.
Any advise.
TIA Chris
|
|
|
|
|
In MSDN Q247791 , microsoft said
"
SYMPTOMS
Modeless forms in Visual Basic ActiveX DLLs do not display in a Visual C++
application. Instead, a dialog box comes up informing the user that the
client doesn't support Modeless Forms.
CAUSE
In order to work properly, a Visual Basic modeless form requires access to
the message loop of the client application. This access is provided by a COM
object known as the Component Manager, which is integrated directly into the
message loop of the client application. In order to determine if the client
supports modeless forms, Visual Basic gets a reference to the message filter
for the application, and calls IUnknown::QueryInterface for the Component
Manager's primary interface. If this works, modeless forms can be supported.
If it fails, the client cannot support modeless forms.
"
I'm wondering how Visual Basic ActiveX DLLs get the reference to Component Manager which implemented by client in order to display modeless forms in the ActiveX DLL.
Thanks for any suggestion?
|
|
|
|
|
Can I call a CDialog's DoModal() or any other parent window (CView, CMainFrm)
functions from JScript code in HTML contained in a CHTMLView derived class?
Thanks in advance
|
|
|
|
|
You can communicate with the container of your script ( e.q. your CHtmlView derived class ) only if you extend the DHTML object model . The communication is thru the window.external object . In order to extend the DHTML object model your container must implement some interfaces : IDocHostUIHandler , etc .For details see MSDN / Workshop / Reusing Browsing technology . If you have some questions please e-amil me.
|
|
|
|
|
I'm writing a application with a nested splitter
The first spltter has 2 colomns, the second (in the right colomn) has a number of rows which I want to change programmically (between 2 and 5).
In the present implementation I delete the second splitter when i need to add or remove a pane, and "built" the new one with the right number of rows. This implementation has a flaw because although I use the InitialUpdate for every view , nothing happens. Only when I "toutch the splitter-bar, I "see" the updated splitter.
Does anyone no this problem and/or has a more elegant solution?
I saw a proposal somewhere which hides panes. But in that case, can you then still enlarge the views with the mouse (which I don not want to be possible !) ?
Thanks in advance,
Bert....
|
|
|
|
|
Here is the code who hide / show a row . This code is written especially to hide / show only a row at a time . You can use it also to hide / show more then one row, but be aware to the sequence of hide / show operations.
Derive a class from CSplitterWnd, and add this code :
void CMySplitterWnd::HideRow(int rowHide)
{
ASSERT(m_nRows > 1);
ASSERT(rowHide < m_nRows);
SetActivePane( 0, 0 );
CWnd* pPaneHide = GetPane(rowHide, 0);
ASSERT(pPaneHide != NULL);
pPaneHide->ShowWindow(SW_HIDE);
pPaneHide->SetDlgCtrlID(AFX_IDW_PANE_FIRST + m_nRows);
for( int row = rowHide + 1; row < m_nRows; row++ )
{
CWnd* pPane = GetPane( row, 0 );
ASSERT( pPane != NULL );
pPane->SetDlgCtrlID( IdFromRowCol(row - 1, 0) );
m_pRowInfo[row-1] = m_pRowInfo[row];
}
m_nRows--;
m_pRowInfo[m_nRows] = m_pRowInfo[rowHide];
RecalcLayout();
}
void CTSplitterWnd::ShowRow(int rowShow)
{
ASSERT(m_nRows < m_nMaxRows);
int rowNew = rowShow;
CRowColInfo rowNewInfo = m_pRowInfo[m_nRows];
m_nRows++;
int row;
CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST +
m_nRows);
ASSERT(pPaneShow != NULL);
pPaneShow->ShowWindow(SW_SHOWNA);
for(row = m_nRows - 2; row >= rowNew; row--)
{
CWnd* pPane = GetPane(row, 0);
ASSERT(pPane != NULL);
pPane->SetDlgCtrlID(IdFromRowCol(row + 1, 0));
m_pRowInfo[row + 1] = m_pRowInfo[row];
}
pPaneShow->SetDlgCtrlID(IdFromRowCol(rowNew, 0));
m_pRowInfo[rowNew] = rowNewInfo;
RecalcLayout();
}
On this base you can write the functions for hide / show a colon
|
|
|
|
|
Hi
I need the complex class for (!) complex calculations (Visual C++ 5.0).
There is no problem in using the class but:
If I try to get the conjugate complex of a complex it doesn´t work !!!
In the complex.h is conjg defined but if I use conjg an error occured:
- conjg is undeclared...
e.g.
#include <complex.h>
using namespace std;
complex<double> x(1,2);
sqrt(x) is no problem, but conjg(x) doesn´t work.
Can anybody help me ?
bye and thanks,
Sascha
|
|
|
|
|
Someone messed up in the docs. The function is called conj(). (I just did a find-in-files for "conjg", found nothing, then tried "conj" and found it.)
|
|
|
|
|
How can I modify the background color of CScrollView?
Thanks
|
|
|
|
|
How can I create SQL queryes and binde whith C++ code ??
Thank You.
|
|
|
|
|
In which platform? If you're working with VisualC++, you can use a CDatabase object, open it, put the query in a CString, and call the method CDatabase::ExecuteSQL.
|
|
|
|
|
Hi , I m tryingto share memory between to process. One must send a string to the other one. The method I MUST use is :
first Global Alloc to obtain memory and fill it with the string
And second pass the handle to the other process with
SendMessage
But i doesn t work for me.
Could someone write me a piece of code for the two process please ?
Thanx
|
|
|
|
|
Hi,
Have a look at the File Mapping... It allows two or more applications to share memory. Have a look at the example in MSDN called "Creating Named Shared Memory".
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
hi,
i programed sql6.5 db browser with vc6 & ado. but when i query too much records,
ado exception occured when recordset open. can you help me?
and:
i have tried to access sql6.5 with db_library, and when i query lots of records, program
is ok. why? i wanna know more about db_library, where i can get some articles and samples?
thank you.
|
|
|
|
|
HI,
How can I display to the screen the content data of the thread while working? just like monitoring, for example I create a thread that will make a loop from 1 to 100 and every time the loop increment it display on the screen(CView, CScrollview... etc) what number the loop is.
The thread is created using afxBeginthread.
I will appriciate your help guys!
-delz
|
|
|
|
|
Hi,
You can use the standard ways of displaying information on the screen. The only difference is that you must put this code into the critical section, so you will not try to access the same dialog object simultaneously.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi again,
I'm new in VC++ ,I try this one but I get Debug Assertion fail.
UINT My_Thread(LPVOID pParam) {
int i
CDC DC;
CString a;
for(i=0;i<3;i++) {
_itoa(i, a, 10);
DC.TextOut(10,10,a);
}
}
|
|
|
|
|
Hi all:
This is about copying files over a network. My program has its own copy routine, using CreateFile, ReadFile, and WriteFile. It works perfectly for local files, and perfectly for files on a network, if they are public (i.e. no passwords), but sometimes doesn't work if the file is password protected. My application uses WNetAddConnection2 and prompts for a password if it doesn't work. Even when I type in the correct password, some of the files in the shared folder copy, some don't at all (a zero byte file is created) or only partially copy. Does anyone have any idea what causes this?
Here's a snippet:
while ( ReadFile(hSrcFile,..,&dwBytesRead,...)
{
WriteFile(hSrc,...,dwBytesRead,...);
// WriteFile uses the dwBytesRead from ReadFile to determine how much it should write
}
Anyone have a clue as to what could be wrong?
|
|
|
|
|
I have a small routine for switching the current view in an MFC SDI application that works fine in Win95/98. when I run it under Win2000 it does not work. The return codes indicate success, but the window never gets repainted with my new view. Any one run into this yet? Here is the code:
BOOL CMainFrame::SwitchView(eViews eView)
{
CView* pOldView = GetActiveView();
CView* pNewView;
switch(eView)
{
case eView1:
pNewView = (CView*) new CView1;
break;
default:
pNewView = (CView*) new CView2;
break;
}
CCreateContext context;
context.m_pCurrentDoc = pOldView->GetDocument();
pNewView->Create(NULL, NULL, 0L, CFrameWnd::rectDefault, this, eView, &context);
pNewView->OnInitialUpdate();
SetActiveView(pNewView);
pNewView->ShowWindow(SW_SHOW);
pOldView->ShowWindow(SW_HIDE);
::SetWindowWord(pNewView->m_hWnd, GWL_ID, AFX_IDW_PANE_FIRST);
RecalcLayout();
delete pOldView;
m_eCurrentView = eView;
return TRUE;
}
|
|
|
|
|
First of all excuse my english, I'm just a begginer using it.
I have received a class that allows me to dock windows on a MDI/SDI frame. Using this class I have developed a Dev. Studio like application, that has tabs at it's bottom in a docking window.
In some of those tabs I have placed a CEdit that don't allow the user to enter data (Read Only), but I would like to have those ones in a white background.
I don't know how to make it, your help would be very useful.
Note:
the controls are created flyby, there is not a dialog where they are placed.
Thank you in advance.
|
|
|
|