|
priyank_ldce wrote: I am working on clipboard in VC++ 2003. I want to copy a GDI Bitmap Class image to clipboard. Does anyone know how can I do this?
Take a look at CF_BITMAP in MSDN for more information.
Owner drawn
Jesus Loves
|
|
|
|
|
|
Hi all,
I would like to know if someone could give me some advise about monitoring a computers memory i.e. if the computer runs out of resources I want to restart the computer, (but only if the memory resource are insuffient).
Would it be a good idea to use the function QueryMemoryResourceNotification() , or is there another function I not aware of.
Thanx in advance
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Nevermind got what I was looking for: GlobalMemoryStatus() ....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
A activex control was created that gets called through a php page with ms word 2003 embeded in a dialog box, in the activex control.
a tool bar is also created in the derivation of MyDialog::OnInitDialog() with some buttons in the dialog box like this:
if (!m_ToolBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY) || !m_ToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
// Move the toolbar so it is VISIBLE on the screen.
CRect rc;
GetClientRect(&rc);
rc.bottom = rc.top + 34;
rc.bottom = rc.left + 30;
m_ToolBar.MoveWindow(&rc);
m_ToolBar.ShowWindow(SW_SHOW);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
EnableToolTips(true); //enable tool tips
//////////////////in its message map i'm calling OnToolTipNotify////////
BEGIN_MESSAGE_MAP(CDlgDocument, CDialog)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
END_MESSAGE_MAP()
///////declaration of OnToolTipNotify in the 'void MyDialog:public CDialog'///
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR,LRESULT *pResult);
///////////and definitition of OnToolTipNotify is://////
BOOL CDlgDocument::OnToolTipNotify(UINT id, NMHDR *pNMHDR,LRESULT *pResult)
{
// need to handle both ANSI and UNICODE versions of the message
TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
TCHAR szFullText[256];
CString strTipText;
UINT nID = pNMHDR->idFrom;
if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||
pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
if (nID != 0) // will be zero on a separator
{
// don't handle the message if no string resource found
if (AfxLoadString(nID, szFullText) == 0)
return FALSE;
// this is the command id, not the button index
AfxExtractSubString(strTipText, szFullText, 1, '\n');
}
#ifndef _UNICODE
if (pNMHDR->code == TTN_NEEDTEXTA)
lstrcpyn(pTTTA->szText, strTipText, _countof(pTTTA->szText));
else
_mbstowcsz(pTTTW->szText, strTipText, _countof(pTTTW->szText));
#else
if (pNMHDR->code == TTN_NEEDTEXTA)
_wcstombsz(pTTTA->szText, strTipText, _countof(pTTTA->szText));
else
lstrcpyn(pTTTW->szText, strTipText, _countof(pTTTW->szText));
#endif
*pResult = 0;
return TRUE; // message was handled
}
i've tried most of the ideas on the net but couldn't view the tool tip.
kindly help me out how tool tips can be displayed for the tool bar
buttons?
note: the activex control is executing in the internet explorer 6.0.
praveen k. sethiya
|
|
|
|
|
minkowski wrote: how I can get the default text highlighted in the text box
CEdit has SetSel() method. Use this method to select the text. To select the entire content in use SetSel as,
SetSel(0, -1)
Do your Duty and Don't expect the Result
|
|
|
|
|
Ok thank you. I will try that.
|
|
|
|
|
|
Sir,
this is off topic, but could you please add the closing tag in your signature, so that you don't break the site's styles... (see here[^])
thanks.
|
|
|
|
|
Hi Toxcct,
I'm using the Signature and Display Name for quite some time..
But i found that i didn't close the tag in display name and not in my signature.. and if you still feel any thing bad, no problem please notify me..
and finally one request no Sir business.. you can call me Parthi ,
Hope you don't mind by calling u Toxcct ..;)
Do your Duty and Don't expect the Result
|
|
|
|
|
Parthi_Appu wrote: and if you still feel any thing bad, no problem please notify me..
it looks to be alright now...
see you Parthi
|
|
|
|
|
Hi,
I wish to the set focus in an edit box by calling another function. Currently I am using SetFocus() but I find that the default text is not highlighted, instead the cursor is at the beginning of the text box. I was wondering how I can get the default text highlighted in the text box when I use my function.
Thank you for any suggestions .
|
|
|
|
|
m_EditBox.SetSel(0, -1);
m_EditBox.SetFocus();
|
|
|
|
|
Hello all,
I am facing a very peculiar problem.I am not able to add new functions/event handlers into a particular class of my project.when i try to add an event handler it gives error saying that "the code element CResult is read only and add remove operation is impossible" while i am still able to add event handlers in to the other classes of the project. can anybody please tell me what the problem could be???
|
|
|
|
|
Did you check if the file was not read-only ?
|
|
|
|
|
Is this problem same as refered here[^]?
|
|
|
|
|
It seems your file is read only.
|
|
|
|
|
Hi,
I want to browse the list of port name to find the port com number of my serial gadget.
I found examples in DDK, but i want simple code to be integrated in my Visual C++ application.
Regards.
|
|
|
|
|
This should do the trick.
CString strPortName, strDesc;
CStringList slPorts;
unsigned long lNeeded = 0;
unsigned long lReturn = 0;
PORT_INFO_2* piPorts = NULL;
EnumPorts (NULL, 2, NULL, NULL, &lNeeded, &lReturn);
if (lNeeded > 0 && GetLastError () == ERROR_INSUFFICIENT_BUFFER)
{
piPorts = new PORT_INFO_2[1 + (lNeeded / 20)];
if (EnumPorts (NULL, 2, (BYTE*)piPorts, lNeeded, &lNeeded, &lReturn) != 0)
{
for (unsigned long nPort = 0; nPort < lReturn; nPort++)
{
strPortName = (char*) piPorts[nPort].pPortName;
strDesc = (char*) piPorts[nPort].pDescription;
strPortName.MakeUpper ();
strDesc.MakeUpper ();
if (strPortName.Left (3) == _T("COM") || strDesc == _T("COMMUNICATIONS PORT"))
slPorts.AddTail (strPortName);
}
}
delete [] piPorts;
}
codito ergo sum
|
|
|
|
|
Thanks for your answer.
I tested the code but the result is :
PortName = "COM16:"
MonitorName = "Moniteur Local"
Description = "Port Local"
But information that i want is like the Device Mange in panel control
Ports (COM & LPT)
--> "Gadget Serial" (COM16)
I want to trigge with Gadget Serial
Best Regards.
|
|
|
|
|
hi all i want to write the values inot database through ADO through Command variable but it gives error when i pass same values through stored procedure it works fine,here is the code
m_cptr->CommandText=(_bstr_t)"Insert into tbltemp(v1,v2,v3)values(@UserIp,@Pic,@WTime");<br />
m_cptr->Parameters->Append(m_cptr->CreateParameter(_bstr_t("@UserIp"),adVarChar,adParamInput,strIp.GetLength(),_bstr_t(strIp)));<br />
m_cptr->Parameters->Append(m_cptr->CreateParameter(_bstr_t("@Pic"),adLongVarBinary,adParamInput,obj.GetLength(),bpic));<br />
m_cptr->Parameters->Append(m_cptr->CreateParameter(_bstr_t("@WTime"),adVarChar,adParamInput,strTime.GetLength(),_bstr_t(strTime)));<br />
m_cptr->Execute(NULL,NULL,adCmdText);
but when execute method is throws exception called it gives error @UserIp
undeclared identifier
i tried to insert simple con.execute query method without command but it does not type cast teh bpic which contain image data and not insert in databse.
tell me how to do that.
Tasleem Arif
|
|
|
|
|
can antbody help me.how to make oledb connection?
from where to start?
i am new to database in vc
|
|
|
|
|
|
Thanks
modified 28-Sep-16 7:30am.
|
|
|
|
|
How many times in one day do you need to ask the same question in every forum posible?
2:56 16 Oct '06
CDO tool needed!!! - oliver_mak
Visual Basic / VB.NET (Programming Forums)
2:56 16 Oct '06
CDO tool needed!!! - oliver_mak
Web Development (Programming Forums)
2:56 16 Oct '06
CDO tool needed!!! - oliver_mak
C# (Programming Forums)
2:56 16 Oct '06
CDO tool needed!!! - oliver_mak
Collaboration / Testing (Programming Forums)
2:55 16 Oct '06
CDO tool needed!!! - oliver_mak
ASP.NET (Programming Forums)
2:54 16 Oct '06
CDO tool needed!!! - oliver_mak
Visual C++ / MFC (Programming Forums)
Maybe its just me, but I have no idea what your asking for.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|